I’m creating a piston to function as a fancy “Wake-Up Alarm”. I got the idea from a piston @Arnqvist created to heat his vehicle. The execution time is set with a Virtual Device Handler @Arnqvist created.
Here is what I’ve managed to do so far: The “Alarm” (Piston) is turned on with the Virtual Device and runs at the time set in the Virtual Device Settings. The piston uses the alarm time to calculate when to turn on devices like heaters, water heaters etc. It warns me it the “Alarm” is turned on when I’m not at home, and likewise warns me if I’m at home, but the Alarm is not turned on (if the next day is a weekday).
Example of Piston State:
I’ll appreciate it if the more experienced could comment on any design flaws or where I could improve on the design.
Also, I would like to know:
Is there an easier way to indicate if a (Virtual) Device is turned on/off in the Piston State (I currently set text (ON/OFF) as the contents of a variable to accomplish this, but I can imagine that it could easily happen that the contents of the text
and the actual switch state, could go out of sync.
If a device is not turned on due to a condition being false, is it possible to report in the piston state why the device was not turned on? (i.e. which condition was false). It would e.g. be nice to indicate in the piston-state something like “Did not turn Heater on as outside temperature is above threshold”. (I suppose that will go in the “else” part of the statement if this is possible).
I get the piston execution time from a variable “WhenDidItHappen” (I do this from an example I got on the forum). Will this Variable be updated each time a statement is executed?
Currently, my piston state shows if the alarm is ON/OFF and always display the time for which the alarm has been set (regardless of whether it’ been turned Off). Is conditional formating possible in respect of the Piston State and if so, how would I only display the time for which the alarm is set if the Alarm is turned On?
Thanks guys