Jump to content
C4 Forums | Control4

Help debugging my first (simple) Programing


Recommended Posts

I have a very simple program I am trying to get running correctly. The program sends a Push Notification if the Garage Door is left open.

  1. When there's change in status for the garage door sensor
  2. Start a (5 minute) timer
  3. When the timer expires
  4. Check the status of the Sensor. If it's open
  5. Send a Push Notification.

1, 2, 3, and 5 are all fine and working. 4 is where things are going south. That line is:


If Garage->Garage Door (Sensor)->RelayState is False


It doesn't matter if you set that to is True or is False, the next event (Send Push Notification) always fires. Does True and False not equal 1 and 0?


Apparently not, since neither work. But then how do you test for a custom variable?


I see the option to set it to be = or != (not equal) to the value of something else, but that drop down doesn't contain any custom variables, only the state of other devices. I don't want to test against the state of some other device. I basically only want to send the Push Notification if the Garage Door is open.


Right now, it sends regardless of the state of the garage door. Open. Closed. Is True. Is False.


I'm overlooking something.


FYI. I have confirmed that the Sensor RelayState is changing. If you use this variable ${Garage::Garage Door (Sensor)::RelayState} in the actual Push Notification, you'll see it be 1 when closed and 0 when open.


Link to comment
Share on other sites

Relay state is not what you want to program off of.


What you want to program off of is just the door. Select the door itself (not the break-out relay state), select conditionals and do IF the garage door is open....


Second, I suspect your last statement - send notification isn't embedded under the IF statement, which is why you get the notification regardless of setting.



WHEN timer expires:

IF garage door is open

Send notification




It should look like

WHEN timer expires:

IF garage door is open

    Send notification

Drag the last line on top of the ? sign untill you see an arrow to the right.

Link to comment
Share on other sites


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

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.