How to access zigbee2mqtt light online/offline status from HA

Hi!

I am writing a conditional automation that would do different stuff depending on if a zigbee2mqtt device (light) is reachable or not. I tried to do a toggle depending on brightness and power on status, but this does not work when device is offline (hard power switch off). In HA the device seems to still be on and on full brightness.

I can see the device as offline in zigbee2mqtt but I cannot find this info anywhere in HA to use it in the condition.

I would like to do a check if the bulb is online and only then it’s status would affect the end result of the conditional.

You need to enable this:

Then the state in home assistant will show as unavailable.

1 Like

Thank you!