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

W2049 ZHA #372

Closed
patrezp opened this issue Oct 11, 2021 · 3 comments
Closed

W2049 ZHA #372

patrezp opened this issue Oct 11, 2021 · 3 comments
Assignees
Labels
new-device New device

Comments

@patrezp
Copy link
Contributor

patrezp commented Oct 11, 2021

New Device Support

Device Information

  • Device Model: W2049
  • Device Description: W2049 Light Controller (Light)
  • Device Manufacturer: IKEA

Integrations

Integration: zha

Actions

  • click <: Sent when button < is pressed
    { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "press", "args": [ 257, 13, 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:05:37.775434+00:00", "context": { "id": "1b127161ff927e6bfefff79597fe0ba3", "parent_id": null, "user_id": null } }

  • hold <: Sent when button < is held
    Event 23 fired 3:10 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:10:30.553537+00:00", "context": { "id": "28088535ee664358bf0adcf33fc415a5", "parent_id": null, "user_id": null } } Event 22 fired 3:10 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:10:30.520263+00:00", "context": { "id": "45588c534799bd032e816e2725192bc8", "parent_id": null, "user_id": null } } Event 21 fired 3:10 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:10:30.489717+00:00", "context": { "id": "d71b058ba34d10149a5d951cd4760e22", "parent_id": null, "user_id": null } } Event 20 fired 3:10 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:10:30.457322+00:00", "context": { "id": "9db9ba65d1b9251253b1c44249230f99", "parent_id": null, "user_id": null } }

  • click >: Sent when button > is pressed
    { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "press", "args": [ 256, 13, 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:14:02.057074+00:00", "context": { "id": "db483825e20b3c319afdaeeae544fc65", "parent_id": null, "user_id": null } }

  • hold >: Sent when button > is held
    Event 30 fired 3:15 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:15:23.760827+00:00", "context": { "id": "0f22cb4fd9f24e6802ada6814a14dea2", "parent_id": null, "user_id": null } } Event 29 fired 3:15 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:15:23.729663+00:00", "context": { "id": "699d62ef3cb64520e93d033f9750c837", "parent_id": null, "user_id": null } } Event 28 fired 3:15 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0005", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 5, "command": "release", "args": [ 0 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:15:23.697025+00:00", "context": { "id": "ce6a7c110017034ffef4f073f7e9982d", "parent_id": null, "user_id": null } }

  • click 🔆Bright : Sent when button 🔆 is pressed
    { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0006", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 6, "command": "on", "args": [] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:22:02.721522+00:00", "context": { "id": "5b8ae35db96339c0df9107bbf8957ec7", "parent_id": null, "user_id": null } }

  • hold🔆Bright : Sent when button 🔆 is held
    Event 21 fired 3:22 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move_with_on_off", "args": [ 0, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:22:55.797816+00:00", "context": { "id": "6ef44ca99925163b547b591a4468f6e4", "parent_id": null, "user_id": null } } Event 20 fired 3:22 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move_with_on_off", "args": [ 0, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:22:55.765988+00:00", "context": { "id": "f19a2f9c340e04f4206c5f80f4c803c7", "parent_id": null, "user_id": null } } Event 19 fired 3:22 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move_with_on_off", "args": [ 0, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:22:55.717658+00:00", "context": { "id": "b2d0113bb3f5ef552492de3e2282ce77", "parent_id": null, "user_id": null } }

  • click 🔅Dim : Sent when button 🔅 is pressed
    { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0006", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 6, "command": "off", "args": [] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:20:18.202255+00:00", "context": { "id": "0e7d9087655b0a24fbe686225ad1aab0", "parent_id": null, "user_id": null } }

  • hold🔅Dim : Sent when button 🔅 is held
    Event 6 fired 3:20 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move", "args": [ 1, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:20:51.260522+00:00", "context": { "id": "ec3937795ba567531b84aa56302a7c37", "parent_id": null, "user_id": null } } Event 5 fired 3:20 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move", "args": [ 1, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:20:51.229024+00:00", "context": { "id": "e7a15304a2c322a704dfc14bdf54fc6d", "parent_id": null, "user_id": null } } Event 4 fired 3:20 PM: { "event_type": "zha_event", "data": { "device_ieee": "cc:86:ec:ff:fe:30:c5:be", "unique_id": "cc:86:ec:ff:fe:30:c5:be:1:0x0008", "device_id": "4127e20b5d7bfde6a8aef80e36517ec6", "endpoint_id": 1, "cluster_id": 8, "command": "move", "args": [ 1, 83 ] }, "origin": "LOCAL", "time_fired": "2021-10-12T13:20:51.197479+00:00", "context": { "id": "25843f4491eece725da58b7cbcff3d40", "parent_id": null, "user_id": null } }

Notes

updated with actions

@patrezp patrezp added the new-device New device label Oct 11, 2021
@xaviml
Copy link
Owner

xaviml commented Oct 12, 2021

Hi @patrezp,

Thank you for opening this ticket and the detailed answer. I see that the hold < and hold > only include release commands. Normally, the hold events have a hold event and a release one. The same goes for the brightness hold, they are missing the release command.

Could you double-check there are no missing actions in there?

Regards,
Xavi M.

@patrezp
Copy link
Contributor Author

patrezp commented Oct 12, 2021

You are right @xaviml , I went to debug log to dig deeper:

Actions

  • click <: Sent when button < is pressed
    2021-10-12 15:02:19 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=press, args=[257, 13, 0]>

  • hold < for 5 seconds: Sent when button < is held for 5 seconds
    2021-10-12 14:50:25 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=hold, args=[3329, 0]> 2021-10-12 14:50:28 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=release, args=[3536]>

  • click >: Sent when button > is pressed
    2021-10-12 14:52:21 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=press, args=[256, 13, 0]>

  • hold > for 5 seconds: Sent when button > is held for 5 seconds
    2021-10-12 17:06:40 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=hold, args=[3328, 0]> 2021-10-12 17:06:43 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0005, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=5, command=release, args=[-16085]>

  • click 🔆Bright : Sent when button 🔆 is pressed
    2021-10-12 17:06:38 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0006, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=6, command=on, args=[]>

  • hold🔆Bright : Sent when button 🔆 is held
    2021-10-12 17:02:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0008, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=8, command=move_with_on_off, args=[0, 83]> 2021-10-12 17:02:52 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0008, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=8, command=stop, args=[]>

  • click 🔅Dim : Sent when button 🔅 is pressed
    2021-10-12 17:07:06 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0006, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=6, command=off, args=[]>

  • hold🔅Dim : Sent when button 🔅 is held
    2021-10-12 17:02:43 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0008, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=8, command=move, args=[1, 83]> 2021-10-12 17:02:45 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:86:ec:ff:fe:30:c5:be, unique_id=cc:86:ec:ff:fe:30:c5:be:1:0x0008, device_id=4127e20b5d7bfde6a8aef80e36517ec6, endpoint_id=1, cluster_id=8, command=stop, args=[]>

I was successful in testing following addition of ikea.py class W2049LightController(LightController)
def get_zha_actions_mapping(self) -> DefaultActionsMapping: return { "on": Light.ON, "off": Light.OFF, "press_257_13_0": Light.CLICK_COLOR_DOWN, "press_256_13_0": Light.CLICK_COLOR_UP, "move_with_on_off_0_83": Light.HOLD_BRIGHTNESS_UP, "move_1_83": Light.HOLD_BRIGHTNESS_DOWN, "hold_3329_0": Light.HOLD_COLOR_DOWN, "hold_3328_0": Light.HOLD_COLOR_UP, "stop": Light.RELEASE, "release": Light.RELEASE, }

patrezp added a commit to patrezp/controllerx that referenced this issue Oct 12, 2021
xaviml pushed a commit that referenced this issue Oct 12, 2021
@patrezp
Copy link
Contributor Author

patrezp commented Oct 14, 2021

I think we can close this since you've merged my patch and it works fine with ZHA now

@patrezp patrezp closed this as completed Oct 14, 2021
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