Setting a Variable


#1

The piston is supposed to close garage door at sunrise and after 15 min if garage door is opened during that time period
The Variable that I have will not change to false when the contact sensor closes manually. Does the piston have to run for the variable to change


#2

The piston will run anytime the contact changes, as your first line is a trigger. It will only execute the task under the trigger if it changes to open. You could change that line to if the contact changes. Then put you conditions for open and close under it.

If contact changes
    if contact is open
    and
    time is ......
        Do stuff

    if contact is closed
    and
    time is
          Do stuff

You last if only has conditions so there is no trigger. So yes the piston must be triggered by some event before it does anything.

Check this out
Conditions and Triggers: The difference?.


#3

Thanks
Im trying to change my piston to reflect your example
I can change to
Garage Door Sensor’s contact changes
I dont know how you got the next lines. If I add new condition it puts an “and” between the lines


#4

I am not 100% sure what you are trying to do, but I think if the door opens during the day, Sunrise to Sunset, then close it after 15 minutes.

Then close it every day at sunset. I haven’t tested this but I think it would do that.

In my personal opinion I have never thought it a good idea to just close a garage door. I prefer to just get notifications that it is open and I must close it myself.


#5

Thanks I changed the times on the posted piston just so I could see if it works. The piston you posted I had something like it but for some reason it didnt work maybe twice out of 7 days thats y I was trying to use variables. Ill give yours a try. About your word of caution. With the garage door sensors door should not close if someone was standing in the opening. But I understand the caution
Thanks


#6

hi @trickyrick
I believe @Terminal’s warning wasn’t about if the door hitting someone, it was about, you won’t be able to tell IF the door is closed for real or Webcore is thinking it did.
Anyting home safety and security related parts should be left out of the SMhome systems - or it should be double checked - (since it’s still a very primitive tech)


#7

Ok that makes sense. I also have a web cam pointed at my door as well. Cause you are right it did happen that my contact switch double sided tape let go