Is it possible to detect/trap for and error condition with a smart plug. I want to be able to know that the command to turn on or off a switch failed. The reason for the failure would be great but just to know that it didn't happen so it can be reported to a user is what I'm looking for.
Use case: I'm running a hydroponic system that waters for 2 minutes starting at 6 AM and repeating every 3 hours for a total of 3 times. I need to know if any of these waterings failed. Is this doable and let me know if more information is needed.
The best you could do is probably send the command, wait a bit, then check the device state. (This, of course, assumes that the device accurately reports state back to the hub; if not, you have other problems, though in some cases a “Refresh” command may help--but I’d still look at the device or driver for any problems first.)
So, something in your actions like:
On: My Switch
Wait for event: elapsed time --> 0:00:06
IF (My Switch is off) THEN
On: My Switch
END-IF
You could really repeat or check as many times as you want, but if trying twice doesn’t work, there are probably bigger problems to look at, IMHO (really even once, though we all have seen a flaky device or two…).