Is there a way to target all devices for a status change trigger, without having to individually list them? The number of devices in my smart home is increasing steadily and every so often a device becomes unavailable. Rather than finding out that a motion sensor or switch is not available anymore when I use the device, I would like to get updated on my phone that I need to re(-)pair a device.
There are a lot of solutions for that. Google around. Im using uptime kuma to track devices avability. If device is not availsble it will send me message on my telegram account.
Trouble is, devices are not marked unavailable until several hours after they have stopped responding. This is because battery-powered devices can’t be contacted by the coordinator, they have to initiate a connection.
The ZHA Toolkit from HACS has a “ping” service - presumably that gives up after x tries.
Edit: If you have Zigbee devices going unavailable often enough to need to track them, I’d suggest you look into the reason. XY problem.
It is essentially to know, which devices are down, especially battery powered. I use a battery card. I also look for the states of my important devices every 4 hours (if it is not reported beforehand) and send a message as soon as it is unavailable.
In fact, my Node-RED script is even more clever. If more than five devices are down, it sends only one message (and not 20+, one for each device).
What I not figured out yet, how can I check whether the network is down (e.g. ZHA, MQTT, Homematic crashed)?