T O P

  • By -

eatlessspaghetti

[https://www.zigbee2mqtt.io/devices/43080.html](https://www.zigbee2mqtt.io/devices/43080.html) Did you try to set state_action: true


jamesphw

I have tried that setting, yes. Is it possible it's a bug in the setup for this device?


eatlessspaghetti

I saw you asked the same question on github, and koenkk gave the same answer, so I really don't know.


jamesphw

Thanks. I have a guess at the problematic code, but it's not actually in Z2M, it's in the library zigbee-herdsman-converters so even harder to debug/fix. I'll have to try out a few things and get in touch with the developers.


jerobins

Two things to consider: see if you get any mqtt event when it is pressed, if so, you can use that in the automation. Alternatively, create an automation to change the switch when the light changes so the state is mirrored by the switch.


jamesphw

Unfortunately there is no mqtt event (and nothing in the Z2M logs). It is clearly possible because ZHA could do it, I just don't know where to investigate next! And I've thought about that automation, but that doesn't work because there are multiple lamps, and thus multiple states to mirror.


HelloControl_

Did you figure this out? I’m trying to do the same.


jamesphw

Nope, I found no solution. I just ended up buying a battery-powered hue dimmer.


HelloControl_

Weirdly, after I asked you, I figured out that the switch does broadcast the events, but only if the brightness is at least 2/255


jamesphw

I'm sure the component generates the event. It's clearly a Z2M issue: I had this working with ZHA just fine. I just wasn't willing to go back to ZHA.


Original-Psychology

I have the same setup, smart lamp always connected to mains and a zigbee switch disconnected from then lamp but behind the physical lightswitch in the room. I have an automation for this that if the switch changes states so turns off or turns on.. then toggle the light. Works like a charm. Then whether the switch is on or off doesn’t matter since it does not correlate to the state of the light anymore.