Newbie having trouble with monitoring the Hub power source events


#1

I am trying to set up a very simple piston (my first) that will monitor the Hub’s power source switchover from “mains” to “battery” and back, and send an email and an SMS message when either transition occurs.
The ultimate goal is getting a power outage notification mechanism.
The problem is that my piston doesn’t seem to even be executed when I unplug and plug back the power to my ST hub.

Nothing seems to be happening.
The piston’s WebCoRE logs do show some lines when I pause and resume the piston, but nothing is shown when the real power source switch occurs.

I must be missing something very basic but fundamental…
Is there any special way I should be set up or registering the piston (other than just saving it)? Is the event I chose not the right one?

Please assist.


#2

I don’t think you can subscribe to the power source’s previous value in the same way you can for a device, so changes away from wont work.

Try the condition IS instead of the trigger changes away from

If this works, It might be beneficial for the options in the condition/trigger drop down list to be reduced… let us know how you get on.


#3

OK, so I finally got the time to update and test a script with the IS statement.

I figured since this is not going to be event subscription based, I’ll have to schedule the script to be executed on a timer.
Still, not much luck either…