I have connected an Aeotec Smart Switch 6 to a newer high efficiency washing machine with the goal of sending a text message when the wash cycle is complete. The idea was to have a variable changed to false when the switch reports o watts, which would trigger a text message reporting end of cycle. After monitoring it's energy consumption in real time during a typical cycle, I learned that this particular washer (Whirlpool HE top loader) periodically turns completely off (0.000 watts) for up to 3 seconds during various stages of the cycle.
I was unable to find any posts in the forums with information on how to create a trigger based on a variable remaining unchanged for a specified period of time (5 or more seconds). It appears that this can't be done using Indigo's native interface. Although I have virtually no coding expertise, it would seem reasonable to assume that this can be accomplished by running a python script using the datetime module:
1. Create an Indigo boolean variable for washer on (>0.000 watts) or off (=0.000 watts).
1. Create and Indigo (OFF) timestamp variable which would be updated each time that watts = 0.000 (false) after initial start of cycle.
2. Create 2nd Indigo (ON) timestamp variable which would be updated when watts > 0.000 (true).
3. Run python script each time ON timestamp is updated--
if difference between OFF and ON timestamp > 5 seconds, text message (messages app) is sent indicating end of cycle.
Any thoughts on how to build this script or if there may be a more straight forward way to achieve the Same results?