So I have a simple piston that turns on the lights in my bedroom at 6 am in the morning.
How can I tell the piston not to run during my vacations or holidays?
I have other stuff in that piston so I cannot just pause it
Thanks
So I have a simple piston that turns on the lights in my bedroom at 6 am in the morning.
How can I tell the piston not to run during my vacations or holidays?
I have other stuff in that piston so I cannot just pause it
Thanks
There are many ways to do that. Most essentially involve setting a “flag” for your holiday condition and then checking that “flag” to see if it’s ON or not.
I’m using the term “flag” here because there are many things that you could use to “be” the flag. A boolean (global) variable, a virtual light switch, a real light switch, a ST location mode…you see what I’m saying.
Personally I use a virtual light switch as I can have my Alexa device turn those ON and OFF for me with voice commands, so I don’t have to open up the ST app.
Then once you have your flag setup…you just wrap whatever it is that you were trying to avoid in an IF statement.
IF vHoliday is OFF then
Proceed to do whatever you normally do…
ELSE do this instead (or just leave this blank to do nothing)
That depends on which method you want to use.
In my case, I first created a simulated device in the ST IDE. So then once I have this virtual device it just shows up in the ST app like any other light switch. You turn it on or off like any other device in the app…or I have Alexa do it as I stated above.
If you want to use a Location Mode then you have to use the App or a piston to change that.
if you want to use an actual physical light switch you would turn it on…
Personally, I find using a simulated device to be the easiest method.
Sure. Or not. I mean technically if you know in advance the exact days of the year when you will be on Holiday then you could create a piston to turn the switch on and off for you…
Also, I don’t really consider telling the Alexa device to turn the switch on to be “manual”.