Sensor offline notification?

I’m not sure how well this would work as sensors could go on and offline regularly in short stints.

But when my sensor batteries go dead, sometimes all of a sudden, it can take me days before I realise they have. Can we add in automations an option to select, if offline for a period of time, notify me.

I thought setting the battery percentage lower then would work, but my sensors can go from something to offline before it triggers. Mainly sensors on doors where it’s cold and batteries are not constant in their drops.

This is the only method that I know of to monitor offline devices.

1 Like

If you’re handy with a scripting language, you could use the ST CLI to get device status via the devices: health command and keep track of how long (or how many times) or is offline. Once it is offline for your desired amount of time, send email or some other form of notification.

Are you talking about using the API rules? If yes could you post a sample rule. I can’t code but I can cut and paste.

No, I’m talking about the ST CLI that can be run from a Mac/Windows/Linux computer. You would need to be able to do some basic scripting/coding to parse the State and to keep track of how long it has been offline. Perhaps @TAustin could whip up something that would be portable across all the OSes that the CLI supports.

bep@debian10:~$ st devices:health 72
─────────────────────────────────────────────────────────
 Device Id          f92bbec0-2b31-435f-b85b-3b63e7330acf 
 State              OFFLINE                              
 Last Updated Date  2023-03-06T23:25:51.928Z             
─────────────────────────────────────────────────────────

bep@debian10:~$ st devices:health 72 -j
{
    "deviceId": "f92bbec0-2b31-435f-b85b-3b63e7330acf",
    "state": "OFFLINE",
    "lastUpdatedDate": "2023-03-06T23:25:51.928Z"
}
1 Like

My online/offline status driver that @Paul_Oliver referenced could be used if having my edgebridge app running on a LAN computer is a possibility.

It could be used in an automation or Rule that does the notification if offline for a period of time, rather than getting notified immediately. One could utilize my Edge Counter Utility to trigger after a period of time similar to this use case.

Or, as pointed out, you could do a custom script that would run on a LAN computer (either using CLI or API). The downsides to all these solutions is the need to poll the device(s) for their online/offline statuses. A SmartApp is really needed to be able to subscribe to states and get asynchronously notified.

1 Like