Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW DEVICE] Support for Sonoff SNZB-01 Wireless Switch (button) #170

Closed
wafliron opened this issue Nov 4, 2020 · 8 comments
Closed

[NEW DEVICE] Support for Sonoff SNZB-01 Wireless Switch (button) #170

wafliron opened this issue Nov 4, 2020 · 8 comments
Assignees
Labels
new-device New device

Comments

@wafliron
Copy link

wafliron commented Nov 4, 2020

Feature Request

Is your feature request related to a problem?

No

Describe the solution / feature you'd like

I've been experimenting with the new(-ish) range of Sonoff ZigBee devices using Home Assistant and ZHA. So far my results have been very positive - they look like a great alternative to Xiaomi devices if you need a cheap motion sensor / contact sensor / temp sensor / button.

I already use ControllerX extensively with a variety of Ikea and Xiaomi buttons/remotes (and thank-you for providing such a great add-on!) - it would be great if it supported the SNZB-01 Wireless Switch. This device is just a basic button, similar to the Xiaomi Aqara WXKG01LM

Describe alternatives you've considered

Not really applicable, but using HA automations / NodeRed instead of ControllerX with this button type.

Additional context

Nothing at this point, but please let me know if any other information may be helpful if you decide to add support for the SNZB-01.

@wafliron wafliron added the enhancement New feature or request label Nov 4, 2020
@wafliron
Copy link
Author

wafliron commented Nov 4, 2020

Sorry, I accidentally set this as a feature request rather than a request for new device support!

@wafliron wafliron changed the title [FEATURE REQUEST] Support for Sonoff SNZB-01 Wireless Switch (button) [NEW DEVICE] Support for Sonoff SNZB-01 Wireless Switch (button) Nov 4, 2020
@xaviml xaviml added new-device New device and removed enhancement New feature or request labels Nov 7, 2020
@xaviml
Copy link
Owner

xaviml commented Nov 7, 2020

Hi @wafliron,

Could you add in here the ZHA events that this controller fire and specify which actions were done (press, hold, release, etc)?

Thank you :)
Xavi M.

@wafliron
Copy link
Author

wafliron commented Nov 9, 2020

Will do - I think I know what you need / where to get it (haven't made a request by this before). Bear with me a couple of days though, need to find a few spare moments to gather the info!

Thanks.

@wafliron
Copy link
Author

Hi @xaviml,

Here's what I've gathered - let me know if I've done anything wrong / you need any more info.

Device Signature:

{
  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=0, maximum_outgoing_transfer_size=160, descriptor_capability_field=0)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0000",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003"
      ],
      "out_clusters": [
        "0x0003",
        "0x0006"
      ]
    }
  },
  "manufacturer": "eWeLink",
  "model": "WB01",
  "class": "zigpy.device.Device"
}

Single Click Event:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:12:4b:00:22:29:2b:f0",
        "unique_id": "00:12:4b:00:22:29:2b:f0:1:0x0006",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-11-11T12:32:48.263249+00:00",
    "context": {
        "id": "01c90421241a11eb8068dd9af8c2811c",
        "parent_id": null,
        "user_id": null
    }
}

Double Click Event:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:12:4b:00:22:29:2b:f0",
        "unique_id": "00:12:4b:00:22:29:2b:f0:1:0x0006",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-11-11T12:33:22.071050+00:00",
    "context": {
        "id": "15efae3f241a11eba51b63a4301e818c",
        "parent_id": null,
        "user_id": null
    }
}

Hold Event (fires once after holding for about two seconds - no further events fired after this, tested with hold time up to about 30 seconds):

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:12:4b:00:22:29:2b:f0",
        "unique_id": "00:12:4b:00:22:29:2b:f0:1:0x0006",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "off",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-11-11T12:31:46.982169+00:00",
    "context": {
        "id": "dd4245e6241911eb99f371b75865f24b",
        "parent_id": null,
        "user_id": null
    }
}

There doesn't appear to be an event for release.

There also doesn't appear to be specific events for any more than double click - 3+ clicks just results in a combination of the "on" and "toggle" events firing. e.g. 3 clicks is 1 x "on" followed by 1 x "toggle", 4 clicks is 2 x "on", 5 clicks is 2 x "on" followed by 1 x "toggle", etc).

Thanks for looking at this!

@xaviml
Copy link
Owner

xaviml commented Nov 11, 2020

Hi @wafliron,

Thanks for the details. I will be adding this controller for the next release :)

Regards,
Xavi M.

@wafliron
Copy link
Author

Thanks very much. I'll keep an eye out for the release and give it a test.

xaviml added a commit that referenced this issue Nov 27, 2020
@xaviml
Copy link
Owner

xaviml commented Nov 28, 2020

This controller has been added to ControllerX v4.2.0.

@xaviml xaviml closed this as completed Nov 28, 2020
@wafliron
Copy link
Author

I've finally had a chance to test this (sorry it took so long) and thought I should report back: all appears to be working fine, just a pity the button itself isn't capable of more (like the Xiaomi buttons are). Thanks very much for adding support, appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-device New device
Projects
None yet
Development

No branches or pull requests

2 participants