has anyone an idea, how to solve that problem:
I have several lights controlled with zigbee2mqtt - everything works fine.
The lights itself can be powered on/off with shelly1 (wifi relay).
Toggling the physical light-switch triggers the shelly, which powers the bulb. Shelly does this independantly and i don’t want to change this (fallback in case HASS is offline).
The HASS-state of the zigbee light changes to “unavaiable” if shelly powers off the zigbee bulb. Sure, because zigbee2mqtt pings the devices, gets no answer and then sends unavailable. Thats fine.
Question: How to automate, that triggering the light with status “unavailable” to “on” triggers the shelly on instead (which switches the light on).
In Lovelace, especially lovelace-floorplan, i want to have one single icon with the status of the light; short press for on/off and long-press for changing RGB and brightness.
Turning the group “on” set shelly to on and HASS will not send anything to zigbee2mqtt, because the devices are unavailable, but the 4 zigbee bulbs immediately start to light because they get now main power - and a couple of seconds later the zigbee bulbs also showing up as “on” in HASS.
Long pressing the icon in lovelace you can set color and brightness, which is ignored by shelly, because it supports only on and off. But the zigbee bulbs are doing the expected.
Not so good:
Switching the group to “off” the shelly immediately disables power and the bulbs are getting dark, but it takes up to 15-30 seconds until HASS shows the whole group as “off”, because the zigbee bulbs are not reporting the “off” state (no power, no zigbee). You have to wait until zigbee detects the unavailibility, if enabled - you have to set advanced.availibility_timeout in zigbee2mqtt configuration for this to work.
Workaround:
Here is my trigger which fakes zigbee2mqtt “off” messages using mqtt service. So HASS shows immediately off.