Mains light switch with button press state change push notification?

I have my hands on a Mercator Ikuu single gang light switch as a test for my HA setup, which appears to use the Tuya TS0011 zigbee IC for control. I have a plan to use multiple of these ( single, dual, triple and quad gang) around the house.

I have this connected via Z2M and It’s possible to do some basic operations, ON, OFF, TOGGLE, Query State.

Unfortunately when I physically press the button on the light switch, it doesn’t push the state change, so the only way HA has to know if the light is ON or OFF is to query the switch’s state.

Ideally i would like to use the state change to trigger other events, turn on an exhaust fan, or a light further down the hallway etc and have them triggered instantly.
I want to avoid delays by querying the state of all my light switches multiple times a second clogging up the ZigBee network and slowing down the host PC running HA and Z2M.

Does anyone know of a wall switch (zigbee preferred) which pushes the switch state on physical button press?

or, is there some method of flashing the light switch’s micro-controller where i can more finely control the messages sent out from the wall switch ( esphome’esque type of flash )

Cheers!

Well any zigbee switch should (and in my experience does) reflect the state of the switch.

Sure, I can probe the switch to see what state it is in, but I want it to inform me when its pressed.

That particular switch is pretty useless then isn’t it. Choose another brand.

I’ve just spun up a second HA instance to see if it works better with ZHA.

Low and behold it all behaves exactly as expected, pressing the physical button updates HA with the state immediately.

Looks like its a limitation in Z2M not the wall switch.

That may be so. The implementation may be incomplete in Z2M.

Never seen a zigbee switch do that before. Are you certain that when you press the physical switch that the state of the switch entity does not change in HA?

Yeah, 100% certain, the entity in HA doesn’t update at all when i press the physical switch.

There’s also nothing on Z2M’s terminal output when i press the physical button either.

In the z2m gui, what does it say that the switch exposes?

We should probably look towards getting z2m working via PR or Issue if we can.

Ok, so I’ve now re-linked the wall switch back to Z2M… and there’s a MQTT message being published on each button press.

Zigbee2MQTT:info 2021-07-29 15:45:31: MQTT publish: topic ‘zigbee2mqtt/0x60a423fffe6cbc5e’, payload ‘{“linkquality”:90,“state”:“ON”}’

which means the GUI in HA gets updated as soon as I press the button.

I’m going to assume ZHA pushed a firmware update to the wall-switch when it was connected.

What HA version are you using?
Versions prior to 2021.2 had a bug in discovery. In result, when you were renaming device in z2m, not all its entities might have been renamed (if remember correctly restart of HA were fixing that). Maybe it was your case with the switch? that you just didn’t find it under expected name?

Running 2021.5.0, in a Docker Container, with Z2M on another PC (docker as well)

Maybe there was an issue with the discovery the first time and it resolved itself when it was re-linked, I was looking at all my MQTT messaged from Z2M’s terminal and nothing was showing up there during the button presses.

Well, now this one is working ill grab another to see if i have the same issue.

I just bought one of these to test it out. Looks like you have done this already :).
Was it discovered instantly by Z2M or did you have to add as a customer device ?

Z2M discovered the wall plate after about 2 seconds.
Didn’t need to add it as a custom device, Z2M recognised it as a TS0011 straight away.

1 Like

Given the link you share in your original post … Mercator Ikuu … it looks like you are in Australia :slight_smile:
Where did you purchase the light switch from? I bought the sample from Lighting Illusions.

Got them from Middys :+1:

Great. Just last question. Is this showing up as a router or an end device for you ?
Just wondering given it doesn’t have a neutral wire. Cheers

Appears to show up as a end device here.

Are you able to elaborate on how you got this device to report its on/off status?

I have latest Z2Mqtt and Hassio and see exactly the same problem, it doesn’t report. I tried using a sniffer and saw no packets from the device when pressing the button. Super annoying.

I have a dimmer version which also shows negative values in Hassio front end for dimness =(

Can’t tell you how I got it working, because there wasn’t anything specific like editing a JSON or yaml, but I’ll share with you what I did which made it work.

Originally connected to Z2M : didn’t show the state of the buttons.
Then disconnected Z2M
Spun up a new HA on a pi and connected the wall plate to the new HA instance via ZHA, which shows the state change on button press.

Disconnected ZHA and reconnected the wall plate to the original Z2M docker.

Then the wall plate would function as expected in Z2M

Shrugs

I tried this and found the ZHA could see the status updates but no mater what I do in Z2Mqtt, the updates are not seen.

I could make a bug report maybe, but I made a report for the dimmer version earlier and got no response. Any tips on where to go next?