Same issue here.
Part of the apparently missing “switch state” issue may be due to the fact that the device supports both rocker switches and momentary push switches. A rocker switch obviously has a state, mechanically/electrically. But because this device also works with momentary push “switches” those don’t have state in the same way.
This really sucks, but seems it is the nature of the device I apparently wasted my money on.
I want one set of behaviours when the rocker switch is Off and another when it is On, I expected the rocker state to be presented as a sensor, but instead all I can do is trigger a toggle and not actually report switch state. I could work around this by storing a variable in HA that holds the current state of the rocker switch and turn it on or off accordingly on a toggle event (not fool proof, it could well go out of sync) but I’m struggling even to do that.
I mapped the toggle action to toggling the switch on and off, and doing that the damned relay seems to emit the same event as the switch so if you ask it to toggle in response to a toggle it keeps on toggling and now the relay is stuck on regardless of what state the HA dashboard thinks it’s in.
Disappointing to say the least. This should be really really simple but I’ve wasted not only money buying 5 of these useless switches but 3 hours of my life trying to turn a light on in response to a switch (!)
Edit: I should also note I’ve tried ZHA and Z2M and I’m having an equally bad time with both.
Edit 2: I have now finally got this working the way I want. It’s using Z2M now. What I had to do:
1: Force remove the devices from my zigbee network.
2: Delete all previous attempts at automation
3: Create an inputboolean helper to track the status of the physical switch (I can soft-flip it if it gets desynced)
4: Create an automation on the action: toggle event of the switch with a ‘choice’ as the action. If input boolean is true, set input boolean false and set switch relay OFF and the reverse choice for turning on.
4a: It is critical that you don’t just toggle the relay on a toggle action, as toggling the relay will send the toggle switch action as well as respond to it, which gets the device stuck in a loop.
5: create a second automation for the motion sensor with input_boolean = off as a condition. Again, critical that you use switch ON and switch OFF and not toggle to avoid getting stuck in a loop.
Now my motion sensor controls the light when the switch is ‘off’, and the light is overridden to ON when the switch is ON.
Like I said, any occasional desyncs caused by reboots can be corrected by soft flipping the input boolean in ha