I am using this battery alert script to notify me if any batteries that falls below the set threshold. This script also alert of battery that is in the unknown and unavailable states.
I have some Ikea remotes (E1524) and motion sensor (E1524) that are integrated with HA. I notice HA shows these sensor batteries as unknown after restarting of HA. It changes to a % when the devices are depressed, however. Besides from the motion sensor, I seldom use the remotes. What can I do to prevent HA detecting these devices as unknown after every restart? It’s quite cumbersome to have to track down all the devices and wake them up.
So I think I need to add retain: true to mqtt. I tried adding to the config file under zigbee2mqtt, but it isn’t working. Perhaps its the wrong place to add it or it is now depreciated?
Which version of Home Assistant are you using? There was a bug in how it handled MQTT Binary Sensors on startup in 0.112.0 (and didn’t get fixed until 0.112.5 which is only released for the Core installation method).
The correction is in 0.112.5 but that version was never released for Home Assistant OS, Supervised, or Container (only for Core). It will be available in 0.113.