Jump to content

Program ? one button, result based on variable...


FrayAdjacent

Recommended Posts

I have set up buttons on my RemoteLinc for different areas using programs. Basically, one button pair turns on my upstairs stuff and sets the thermostat, and the off turns off the lights and sets the thermostat. I've had to set up two programs, though, since I have one set of actions I want to happen during daytime, and another at nighttime, and I'm not sure if a THEN/ELSE will do what I want, but that is my question.

 

I have a variable State that is set to 1 at 30 minutes before sunset, and set to 0 at sunrise, so that acts as my 'night time' indicator. I do an AND statement with the button on my RemoteLinc, and it activates one program or the other. (for the 'turn everything off' program, I only use one, since sending an OFF signal to a light that is already off won't do anything undesireable).

 

My question is, though, can I set up the IF statement to have a button press ANDed to the variable, then have the THEN statement be my 'night time' action, and the ELSE statement to be my daytime action? (given the variable state of 1 in the AND statement) Or will having the variable ANDed to a button execute the ELSE statement if the variable switches and the button is not pressed??

Link to comment

State variables trigger Programs when changed. Integer variables do not trigger Programs when changed. I think you want to use an Integer variable unless you want the Program to trigger at those specific times (Sunset-30, etc) in addition to triggering with a button press. The value in the Integer variable will control whether the If is True or False and run the Then or Else accordingly when a button is pressed.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...