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

Added ZHA support for the Ikea E2123 media remote #1109

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

harrismck
Copy link
Contributor

I added ZHA support for the Ikea E2123 media remote. Tested with my own remote and homeassistant instance, seems to be working great! It's been a long time since I've written any python, so let me know if there's a better way to go about this (particularly the get_zha_action method).

@harrismck
Copy link
Contributor Author

Not super important as part of this PR, but as noted in this comment #842 (comment), the release functionality doesn't work for holding the plus/minus buttons. I don't know if that's something we can fix though, as it seems no ZHA event is fired when you let go of those buttons...

Even fired when holding the + button (this is fired multiple times while held)

event_type: zha_event
data:
  endpoint_id: 1
  cluster_id: 8
  command: move
  args:
    - 0
    - 255
    - 0
    - 0
  params:
    move_mode: 0
    rate: 255
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2025-01-05T23:27:38.287379+00:00"
context:
  id: 01JGWCQ9SFQ03RAWBG9NQ2YBCC
  parent_id: null
  user_id: null

Eventually, another event that looks like this will fire, but I think it's not useful as the volume will already be at max/min:

event_type: zha_event
data:
  device_ieee: b4:3a:31:ff:fe:30:85:b8
  unique_id: b4:3a:31:ff:fe:30:85:b8:2:0x0008
  device_id: 76ad5991b2f49d0160760495d7f64e7d
  endpoint_id: 2
  cluster_id: 8
  command: move_to_level_with_on_off
  args:
    - 254
    - 150
  params:
    level: 254
    transition_time: 150
origin: LOCAL
time_fired: "2025-01-05T23:28:52.866734+00:00"
context:
  id: 01JGWCSJM24MKZJV5NJWS6YD3G
  parent_id: null
  user_id: null

For now, a workaround can be to use merge-mapping to map some other button to the media_player_release action I guess...

@xaviml xaviml force-pushed the feat/E2123-zha-support branch from 9863a11 to 5c856f2 Compare March 4, 2025 00:06
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 18.75000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 95%. Comparing base (df2825e) to head (5c856f2).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
apps/controllerx/cx_devices/ikea.py 19% 13 Missing ⚠️
Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1109   +/-   ##
====================================
- Coverage    95%     95%   -0%     
====================================
  Files        65      65           
  Lines      2720    2736   +16     
====================================
+ Hits       2589    2592    +3     
- Misses      131     144   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xaviml
Copy link
Owner

xaviml commented Mar 4, 2025

Thank you @harrismck for the work. Changes look good to me, and I trust you on the functionality since I am currently not using ZHA and I do not even have this controller.

I have changed the release notes myself in your PR. I will be releasing this on ControllerX v4.29.0.

Thanks,

@xaviml xaviml merged commit 6783ff4 into xaviml:main Mar 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants