Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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??

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.

  • Author

Lee, thanks, that helps a bunch! So I could set a 'nighttime' integer instead of a state, that would then only be evaluated when the button is pressed... Nice. I'll give it a shot!

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.