Test is a Garage Door sensor is open/closed

(Chrisb) #1

I’m trying to write an app where there is an if/then statement that tests a SmartSense Garage Door Sensor Button to see if it’s open or closed. Here’s the code I’m using:

if (door.contact == "closed") then {

It doesn’t seem to be working though. Any ideas?

(C Chen) #2

door.currentContact :slight_smile:

(Longhorn84) #3

What’s the application? I am trying to find an app for my gate that allows me to use the zwave relay to control (in-place) but use a open/close vs an orientation change. Is this what you’re trying to accomplish?

(Chrisb) #4


Thanks for the info. I actually found it by looking in a different app but forgot to come back here and update.


No… something like that should exist if you change your device type of GarageDoor sensor for the multi.

What I’m doing with this app is setting up interface with my Ubi. The garage door works as a simple relay obviously. Close the loop and the garage opens if it’s closed, or closes if it’s opened. I wanted to be able to say to my Ubi: “Open the garage” - and it’ll only open it if it’s already closed. Likewise, if I say “Close the garage” it shouldn’t open it if it’s already closed.

This means that I can’t tie the custom behavior directly to the relay outlet. Instead these custom behaviors each trip a separate virtual tile. This virtual tile runs a program.

If it’s the ‘Close’ tile, it checks to see if the current state is open. If the garage is open, it closes it. If it’s already closed, it trips another virtual tile which signals to the Ubi to say: “The Garage is already Closed.”

It it’s the ‘Open’ tile that is tripped, it does much the same thing.

This is just an effort to make the Ubi commands more ‘natural language,’ which helps with the WAF.