I have this simple automation for spotting if a battery sensor has not been seen for a prescribed period.
Is there a way to put the condition and action into an iterator loop over a set of sensors?
Basically I want to iterate the whole condition/action unit over a set of 2 dozen devices, replacing the string: sensor.genius_valve_21 from values from a list.
Ignore the testing values of /10 timing and > 280 seconds - these are so I can see it working. In reality, I’d test perhaps once every hour and look for stuff that had not responded in that time.
Thank you kindly for any pointers where I should start…
Do all of these sensors use the same integration and, if they do, which one is it?
FWIW, some integrations have the ability to indicate an entity is unavailable if it has not received a new value within a desired time period. For example, the MQTT Sensor integration offers expire_after.
That’s possible - but with temperature being one of the sensor metrics, in practice, it always jitters enough to send a reading… And the battery level is another metric, so that will generally decay, especially if we have a reading in /10ths of a %.
If sensor went for an hour without being noted, it’s a high probability that it’s died - at least enough to go and check manually.
It would be nice if there was a “last seen” property somewhere, but I gather there isn’t - so this’ll be OK…
ble_monitor from HACS (BLE fridge sensors)
z-wave (various devices)
genius (Heat Genius API integration to separate Genius Z-Wave hub that does the heating, on a separate ZWave network (many valves and thermostats with batteries).
I’ve tried this with all 3 and it looks like it will work as all 3 do normally report a state change quite frequently.
On a separate note, I was wondering if MQTT was the way out - but I wasn’t sure if it could be made to integrate with any random integration - and it seemed like more work
It crossed my mind that if you’re using this to monitor a device’s battery level, is it necessary to poll it every 10 minutes? Batteries typically last a long time so checking their level once a day seems adequate.
Or have you selected a 10-minute interval to promptly detect “dead” sensors?