itavero/homebridge-z2m

[Bug] Tuya button not working in Homekit - Tuya SH-SC07

gino-nl opened this issue · 14 comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This is driving me crazy.
I have 3x Tuya SH-SC07 in my Zigbee network that are not functioning properly.

I've added the button to my Zigbee network via Zigbee2MQTT.
The button is also visible in Homekit(via homebridge-z2m), with its three actions (Single click, Double click, and Hold) configurable.

When I press the button, the action is recognized in the Zigbee2MQTT web interface but not in Homekit.
All other remotes (Hue Dimmer, Tuya Door sensor, etc.) in the same network, work just fine in Homekit.

What am I doing wrong? What should I try to solve this issue?

Related devices

Tuya SH-SC07

Related Devices

Tuya SH-SC07

Steps To Reproduce

No response

Expected behavior

No response

Device entry

No response

Status update

No response

Messages from this plugin

No response

This plugin

1.9.3

Homebridge

1.6.1

Zigbee2MQTT

1.35.3 commit: fe0742a

Homebridge Config UI X (if applicable)

4.50.4

Have you checked if the device actually sends the action values that are in its exposes information?

Some of these devices have a legacy option in Zigbee2MQTT itself that can mess up the values.

I have exactly the same problem, in zigbee2mqtt I see that I am pressing the button, but when I look in homebridge I see nothing happening. I can see in the debug log that a message is being sent, but homebridge cannot do anything with this. I haven't figured out the solution yet, but I will add the reports.

I also found out that it is not the brand of the button, I have one from Xiaomi and one from Ikea but they both have the same.

I hope there is someone who can help.

"
[22/03/2024, 16:01:40] [zigbee2mqtt] Received devices...
[22/03/2024, 16:01:40] [zigbee2mqtt] Handled device update for Ikea Button: {"action":"off","battery":100,"device":{"friendlyName":"Ikea Button","ieeeAddr":"0x8c6fb9fffeab6b84","manufacturerID":4476,"model":"E2201","networkAddress":10398,"type":"EndDevice"},"linkquality":192,"update":{"installed_version":16777287,"latest_version":16777287,"state":"idle"}}
[22/03/2024, 16:01:41] [zigbee2mqtt] Handled device update for Ikea Button: {"action":"on","battery":100,"device":{"friendlyName":"Ikea Button","ieeeAddr":"0x8c6fb9fffeab6b84","manufacturerID":4476,"model":"E2201","networkAddress":10398,"type":"EndDevice"},"linkquality":188,"update":{"installed_version":16777287,"latest_version":16777287,"state":"idle"}}
"

Have you checked if the device actually sends the action values that are in its exposes information?

Some of these devices have a legacy option in Zigbee2MQTT itself that can mess up the values.

Did you check this?

And on a related note, can you both share the mapping that is shown when the homebridge-z2m plugin starts?

I can't find a legacy setting, if there is one where is it normally located?

do you mean this with the mapping? this is what the log shows after starting homebridge.
there is a bit more above, but that is about lamps and there were some other things from other plugins, if you need everything I will add it.

[22/03/2024, 19:08:59] [zigbee2mqtt] Mapping of property 'action' of device 'Ikea Button':
Button 1 (off):
        - SINGLE: off
Button 2 (on):
        - SINGLE: on
Button 3 (brightness_stop):
        - SINGLE: brightness_stop
Button 4 (brightness_move_down):
        - SINGLE: brightness_move_down
Button 5 (brightness_move_up):
        - SINGLE: brightness_move_up
[22/03/2024, 19:08:59] [zigbee2mqtt] Mapping of property 'action' of device 'Button 2':
Button 1:
        - SINGLE: single
        - DOUBLE: double
        - LONG  : hold
Button 2 #ext1:
        - SINGLE: triple
        - DOUBLE: quadruple
Button 3 (many):
        - SINGLE: many
[22/03/2024, 19:08:59] [zigbee2mqtt] Mapping of property 'action' of device 'Ikea Button':

Button 1 (off):

        - SINGLE: off

Button 2 (on):

        - SINGLE: on

Button 3 (brightness_stop):

        - SINGLE: brightness_stop

Button 4 (brightness_move_down):

        - SINGLE: brightness_move_down

Button 5 (brightness_move_up):

        - SINGLE: brightness_move_up

This seems to match what is on the Zigbee2MQTT website for the E2201.
That particular device does not seem to have a legacy option.

If you look at the messages being send by Zigbee2MQTT, you also see these values?
Yet actions attached to the button are not executed?
I assume you have some Apple device acting as Home hub, right?

Can you tell me the model of the other button?

Uploading Scherm­afbeelding 2024-03-22 om 19.26.13.png…
This is the log on the Ikea button from zigbee2mqtt

Debug 2024-03-22 19:22:02Received Zigbee message from 'Ikea Button', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
Info 2024-03-22 19:22:02MQTT publish: topic 'zigbee2mqtt/Ikea Button', payload '{"action":"on","battery":100,"device":{"friendlyName":"Ikea Button","ieeeAddr":"0x8c6fb9fffeab6b84","manufacturerID":4476,"model":"E2201","networkAddress":10398,"type":"EndDevice"},"linkquality":192,"update":{"installed_version":16777287,"latest_version":16777287,"state":"idle"}}'
Debug 2024-03-22 19:22:04Received Zigbee message from 'Ikea Button', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
Info 2024-03-22 19:22:04MQTT publish: topic 'zigbee2mqtt/Ikea Button', payload '{"action":"off","battery":100,"device":{"friendlyName":"Ikea Button","ieeeAddr":"0x8c6fb9fffeab6b84","manufacturerID":4476,"model":"E2201","networkAddress":10398,"type":"EndDevice"},"linkquality":192,"update":{"installed_version":16777287,"latest_version":16777287,"state":"idle"}}'
Debug 2024-03-22 19:22:05Received Zigbee message from 'Ikea Button', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
Info 2024-03-22 19:22:05MQTT publish: topic 'zigbee2mqtt/Ikea Button', payload '{"action":"on","battery":100,"device":{"friendlyName":"Ikea Button","ieeeAddr":"0x8c6fb9fffeab6b84","manufacturerID":4476,"model":"E2201","networkAddress":10398,"type":"EndDevice"},"linkquality":192,"update":{"installed_version":16777287,"latest_version":16777287,"state":"idle"}}'

the other button is a xiaomi WXKG01LM.
Yes, I have an Apple TV and HomePod Mini here and run Homebridge/MQTT on a Raspberry Pi4B.
Scherm­afbeelding 2024-03-22 om 19 24 13

I have discovered something new, when I use the "eve for matter and homekit" app I can see and operate the buttons. Not quite as it should be, but it works. Perhaps this is interesting to investigate further.

Might be that Apple is being Apple again and they broke backwards compatibility in their Home app.

To be honest, I mostly use Eve or Controller for HomeKit to setup and manage automations. At least then I can access all characteristics and such.

That could be a good idea anyway, thanks for your thoughts!

Sorry for my late reply. I couldn’t find the damn button (put it in a drawer and forgot about it 😅).

The button has no legacy mode.

Some additional info, now that I've enable Debug-mode in Homebridge:
button press
Homebridge does receive some data from Z2M when the button is pushed, but does nothing with it :-(

Here is the mapping of the device shown when the homebridge-z2m plugin starts:
mapping

Here is the device info from Z2M:
device info

Btw... Eve app also doesn't show any activity when button is pressed.

I now have my buttons in HomeKit by first adding them to the Eve app and creating an automation, and removing them after executing the automation, after which they suddenly appeared in the HomeKit app. maybe that will help you too.