itavero / homebridge-z2m

Expose your Zigbee devices to HomeKit with ease, by integrating 🐝 Zigbee2MQTT with 🏠 Homebridge.
https://z2m.dev
Apache License 2.0
297 stars 47 forks source link

[Device] Niko Wireless Zigbee Switch (battery, single button) #781

Open noworthwhile opened 7 months ago

noworthwhile commented 7 months ago

Device Model

NIKO NV; Battery switch, 1 button

Is there an existing issue for this?

Supported by Zigbee2MQTT?

Missing features / functionality

This wireless single button from Niko reports 5 states within Zigbee2mqtt as seen in the following code from the boot up of Homebridge.

`[12/5/2023, 12:22:17 PM] [zigbee2mqtt] Mapping of property 'action' of device 'Niko Wireless button': Button 1 (off):

This shows 5 different buttons within HomeKit.

"Brightness_move_up and _down" are long presses, and button 3 always activates when the long press is ended.

This prevents correct operation within HomeKit

HomeKit Services and Characteristics

Possible to expose a simple "Toggle" and a "Long press" ?

Scenes and automations are not working correctly with the current behaviour

Exposes information from Zigbee2MQTT

"0x003c84fffe8c03a8": {
            "date_code": "20220223",
            "definition": {
                "description": "Battery switch with 1 button",
                "exposes": [
                    {
                        "access": 1,
                        "description": "Triggered action (e.g. a button click)",
                        "label": "Action",
                        "name": "action",
                        "property": "action",
                        "type": "enum",
                        "values": [
                            "on",
                            "off",
                            "brightness_move_up",
                            "brightness_move_down",
                            "brightness_stop"
                        ]
                    },

Additional information / Other remarks

No response

itavero commented 7 months ago

What's not working currently in HomeKit?

All Action values are exposed. Combining them into a single button will not change the behavior or the events that get triggered.

noworthwhile commented 7 months ago

Five buttons are exposed to HomeKit:

A single press is mapped to button one in HomeKit, then a second single press is mapped to button two. then it goes back to button one, and then two and so on.

Long pressing is mapped to button 4, and then another long press is mapped to button 5. Releasing the long press from either of the two long presses is mapped to button 3.

Mapping the button to turning on and off a connected light with a single short press is not working, as the switch will use either button 1 or 2, depending what was pressed before.

Example:

  1. Turn on light with switch => switch pressed button 1 in HomeKit, light turns on.
  2. Turn off light via app/voice => switch is still in button 1 state
  3. Press light switch again => button 2 is pressed in HomeKit ie: turn OFF the lights but they already are off, so the button press is useless.
  4. Press light switch again => button 1 is pressed in HomeKit, light is turned on.

Is it possible to configure the switch to be only: button 1 : Toggle(ON/OFF), button 2 : Long press?

Thank you for your answer.

itavero commented 6 months ago

For such customization, I would suggest to see if you can handle this particular device with a plugin like homebridge-mqttthing.

stale[bot] commented 3 months ago

It appears that this issue did not have an update in quite some time. Please check if you can provide any additional information to help resolve this issue. If there isn't any activity in the next two weeks, this issue will be closed automatically. Thank you for your contributions!