ControllerX. Bring full functionality to light and media player controllers

Tags: #<Tag:0x00007f32822b1748>

Hello!

I managed to get an Ikea E1524 (what is the difference to a E1810?) remote to works as a remote for my Logitech Media Server without any problem.
Thank you very much for this great piece of software!

I used the following configuration:

  dachboden_controller:
    module: controllerx
    class: E1810MediaPlayerController
    controller: tradfri_fernbedienung
    integration: deconz
    media_player: media_player.dachboden
    volume_steps: 40

Is it possible to use also double press or long press actions on some buttons? The volume would stay the same, but e.g. the main button could do some extra thing when I do a long press.

I know I have to use CustomMediaPlayerController, but how to use a short press and a long press for the same button? As you can see I am using the deCONZ integration with a Conbee II stick.

Ok @Sennevds

If devices themselfes don’t deliver a group attribute, then perhaps you should consider making some different groups to match specific playing needs during the day.
But no need to make things more complicated, if you’re happy with a group solution where all active playing devices are added :slightly_smiling_face:

Saw that you’ve made a feature request on Github regarding volume control of your group.
Annoying that not all media-players support volume_set calls :unamused:
But it seems that you’re already done the neccesary coding and patched ControllerX to get a working solution :wink:

Hi @carsten_h,

The E1524 is the old model of E1810, but they look both the same, the documentation is the same for both: https://xaviml.github.io/controllerx/controllers/E1524_E1810

This controller does not support double. You can check the documentation to see the events that the controller fires. The only long press that does not work as expected is the center button since it fires the click event first and then the long click, but the rest you can use click and long press.

I did not understand exactly what is the use case you want to achieve, but I will leave you here a configuration so you understand how ControllerX works more deeply.

dachboden_controller:
  module: controllerx
  class: E1810MediaPlayerController
  controller: tradfri_fernbedienung
  integration: deconz
  media_player: media_player.dachboden
  volume_steps: 40
  excluded_actions:
    - 4001 # Hold left arrow event
    - 5001 # Hold right arrow event

dachboden_controller_light1:
  module: controllerx
  class: CustomLightController
  controller: tradfri_fernbedienung
  integration: deconz
  light: light.light1
  mapping:
    4001: toggle

dachboden_controller_light2:
  module: controllerx
  class: CustomLightController
  controller: tradfri_fernbedienung
  integration: deconz
  light: light.light2
  mapping:
    5001: toggle

So the first config is the same one you sent, but it exclude the left and right arrow hold actions. Then I added two custom light controllers to toggle 2 lights with the events I excluded. I hope this helped you understand the potential of ControllerX and achieve what you want to do. Here for more information of custom controllers.

If you tell me exactly what is what you want to achieve, I will be able to help you with the configuration :slight_smile:

Ah, I see, thank you!

Ok, that is not really good, because that would be the button I want to use. But left/right would be also a solution.

Yes, I didn’t wrote it clearly enough. Mainly I need a toggle for the speakers of the media player I want to control, as the don’t have to be switched on the whole day. So I need to control a switchable socket.

Yes, now the penny dropped. I think I understand now how to handle it.

Thank you very much for the fast help!

1 Like

Nice project,
I Enabled appdaemon in HACS. installed the controllerX automation in HACS, added the config for my IKEA E1743 remove to appdaemon/apps/apps.yaml file. But it doesn’t work and there are no logs on this matter. did i missen something?

Thanks,

@shz I think you haven’t installed AppDaemon the program itself.
Enabling it in HACS just shows appdaemon apps to install.
If you’re running HASS.IO, then you will find it under add-ons
See the AppDaemon docs for installation methods.

Thank you for the Info. i was not sure. As i run homeassistant with docker, i will configure an appdaemon container that runs alongside and connect it to homeassistant

I used now this configuration:

Copy to clipboard

  dachboden_controller:
    module: controllerx
    class: E1810MediaPlayerController
    controller: tradfri_fernbedienung
    integration: deconz
    media_player: media_player.dachboden
    volume_steps: 40
    excluded_actions:
      - 4001 # Hold left arrow event
      - 5001 # Hold right arrow event

  dachboden_controller_speaker:
    module: controllerx
    class: CustomSwitchController
    controller: tradfri_fernbedienung
    integration: deconz
    switch: switch.leiste_2
    mapping:
      5001: toggle

But this want work. A long press to left or right still switches fast to the next/last song. I also restarted HA, but nothing changed.

When I look at the events, I see only 4002/5002 coming when long pressing on left/right.
Up/down are sending 2001/3001 as long as pressed and at the end 2003/3003, a short press is 2002/3002.

I it possible that I have an old firmware, that don’t send hold/release events for the left and right keys?
When I am pressing left/right longer I only get repeatedly 4002/5002. There is no 4001/5001 or 4003/5003 send!

Or do I had something defined wrong?

Hi @carsten_h,

Sorry for the late reply. I think you are experiencing a bug due to the firmware, indeed. I have the same problem as you with deCONZ and the E1810 controller. The brightness buttons work as expected, but not the left and right arrows. So the event id mapping I have in here does not match anymore with what I have.

The version of the firmware I have is 1.2.223, but the latest firmware is 2.3.014. I am currently updating the firmware with z2m via OTA updates. However, I am not sure how to achieve the same with deCONZ.

I will let you know if this fixed the problem or not once is updated (it takes a while…)

Cheers,
Xavi M.

I also found this: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2618#issuecomment-629755495

Apparently is a problem of the remote, maybe by removing the batteries and putting them back as they mention, it will fix the problem.

Oh, I have 1.2.214. I have to look how to make the OTA updates without UI.

You are right! Putting the battery out and back in fixed it. Now I get also 4001/5001 and 4003/5003.
And also the switch is switched now!

THANK YOU VERY MUCH!

1 Like

Good to know… I will try this once it finishes the update (23% now… haha)

Glad it worked then :slight_smile: Does you ControllerX config works then or it is not doing what you expected?

It is doing what I expected. So I can have two additionally switches.
Is it possible to not use switches but to start a script?

Yes, you could do the following:

custom_hue_dimmer_example:
  module: controllerx
  class: CallServiceController
  controller: your_controller
  integration: deconz
  mapping:
    1002:
      - service: script.my_script
      - service: script.my_script2
        data:
          attr1: value

This does a call service (the same as you can do on the developer tools on HA) and it calls those 2 scripts when clicking the center button for example.

Ah, OK. Thank you!

1 Like

Hello!
Thanks a lot for this AppDaemon, it’s very useful for me.
I have only a little problem. I’m using a Xiaomi WXKG01LM button to control IKEA TRÅDFRI LED bulb, but I want to use the old non-smart wall switch to switch on/off the bulb too.
It’s working fine until I restart the Home Assistant. When the analog switch turned off, after the HA restart, the corresponding app gets terminated, and I can only restart it, if I edit the config. I can’t see any good in log…
Is there any way to fix this?

Thanks a lot for your help!

Hello!

Is there any reason why this Xiaomi controller is only working with Zigbee2MQTT and not with deCONZ?
https://xaviml.github.io/controllerx/controllers/WXCJKG13LM

Glad to hear ControllerX is useful for you @expeacer. I will be looking into this that you just mentioned, but correct me if I am wrong, these are the steps you followed:

  • Turn off the dumb switch
  • Restart Home Assistant (the core, not the whole machine)
  • Turn on the dumb switch (otherwise it is normal that it does not work)
  • Your Xiomi controller cannot turn on/off your light anymore

Let me know if these are the steps you followed, otherwise, describe them in here, so I can reproduce it. Thanks! :slight_smile: