I have a smart plug connected to a freezer in my garage. I use it to monitor power consumption to detect if the freezer stops working. I also want to monitor to see if the plug itself is still alive. The node red flow I have sends a ping to the plug every hour, waits 10 seconds, then checks the state of the entity called sensor.node_101_node_status (this is the status for that plug). This worked for a while but has now started to report that the plug is dead, intermittently. I’m not sure why it all of a sudden started doing this.
Anyways, as I thought about this, I started to think that maybe I don’t even need to ping the plug. If the plug goes away or the power to it fails, the status should show it, right? If so, it seems like I ought to be able to just use an inject node to check the status (current state node), then take action if it’s not “alive”. Does this seem reasonable?
Have you done monitoring like this before? If so, what was your approach?
Whenever I’ve had Z-wave devices go offline, most of their entity’s values change to “unavailable”, so an automation triggered by that should work.
Alternately, you could base the automation on the device’s “Last Seen” entity, and if it’s more than, say, 10 minutes (I think default ping frequency is 5 minutes), run your action(s).
Ok, I played a bit. It looks like I do need to ping the plug in order to see a node_status change. I guess I need to play with the delay. Not sure why what I was doing was unreliable.
Ok, this last seen idea is interesting. Do you know how this is being updated if I don’t have anything pinging the plug? Or would this also require me to have an automation that did regular pings?
Update: “Last seen” seems to be being updated every couple of minutes even though I disabled the pings. Not sure how this is happening. Is there some sort of z-wave protocol doing this “under the hood”?
It’s either the Zwave JS integration, or just core HA, always keeping tabs on connected devices to make sure they’re available. This is the default behavior, you have to manually disable for any device you don’t want regularly polled.