Event when zigbee router is powered on

I have a CC2531 USB router that I’m using to extend the range of Zigbee to my garage. The problem is that from time to time I need to temporarily turn the router off but when I turn it back on, everything is out of sync e.g. a switch in the garage usually sends an event so I can easily check if I’ve left it switched on, but after power cycling the router, the indication (HA dashboard and indoor light) is often in the wrong state.

What I’d like to do is add an automation, triggered by the router being switched back on (or becoming ‘available’) which then checks the state of various switches etc. and updates the HA dashboard.

I don’t see any option to do this but others have told me it should be possible. I see trigger options for the CC2531 LED being turned on and off, and ‘Opening’ open or closed. I have no idea what ‘Opening’ means for this board.

I’m using Zigbee with ZHA.

Does your Zigbee router device have a corresponding sensor entity that reports its link quality (signal strength)?

If it does then check the value it reports when the Zigbee router is unplugged. For example, if it’s unavailable then you can use that in a State Trigger to detect when the value changes from unavailable to something else (meaning it was powered on).

alias: example
trigger: 
  - platform: state
    entity_id: sensor.your_zigbee_router_linkquality
    from: 'unavailable'
condition: []
action:
... etc ...

All it has is ‘Light’, ‘opening’ LQI and RSSI. It reports itself as ‘lumi router’. I think I had to flash it before I could use it as a router, so maybe there’s some alternative firmware that would report the signal strength or something else?

Either one of those will do the trick.

Thanks. Hadn’t thought of using the debug features in this way.
Btw, the LQI doesn’t work in the visual editor as it thinks it needs a level but it’s missing from the GUI. RSSI is ok.
I think the ‘opening’ would work as well. It seems to track the on-state of the router. Confusing name though!

1 Like