ControllerX. Bring full functionality to light and media player controllers

Update I’ve copied the whole directory ControllerX into the apps folders and now it works! Thanks so much!

Still the questions how updates will be handled in the future?

OK, so when I updated to the latest version from an older version of AppDaemon, I ‘think’ all of those folders must have moved, as I still have the same appdaemon folder as you in my config folder, but that appdaemon folder in that location is empty.

It might be worth taking a backup of your appdaemon and controllerx files and settings, and then uninstalling both, and reinstalling, to see if they install with the correct folder structure, rather than just manually moving them, so as to avoid potential issues with further updates.

I actually did that but the files were installed in the old location unfortunately.
I’il give it another try though

I have E1810 on z2m, I only want to use the brightness up/down buttons to dim the light. The other buttons I have assigned for different switches:

tvroom_licht:
  module: controllerx
  class:  E1810Controller     
  integration: z2m
  controller: sensor.0x000d6ffffe343d9c_action 
  light: light.0x680ae2fffe3f7f03_light 
  actions:
    - brightness_up_click
    - brightness_down_click

But there is no brightness high/low action. Any suggestions?

I’ve also bought an Aqara E1 aka WXKG17LM which seems not officially supported (yet).

Did you make any progress?

For ZHA the events…

@Doublet I think you’re best off using the mapping or merge_mapping functions to do this and take only the functions that you want to assign.

Edit: after re-reading your post, it looks like you want the up/down to also control on/off for the light? In that case, I would replace the hold actions on_full_brightness and "off" and also use smooth_power_on: true so that the first up click turns on at minimum brightness.

Something like:

tvroom_licht:
  module: controllerx
  class:  E1810Controller
  integration: z2m
  controller: sensor.0x000d6ffffe343d9c_action
  light: light.0x680ae2fffe3f7f03_light
  smooth_power_on: true
  mapping:
    2001: on_full_brightness
    2002: click_brightness_up
    3001: "off"
    3002: click_brightness_down

Thanks, still no luck, will keep on trying

Have you tried removing your other configurations? Use only one config for a given controller at a time and then add them back in to see what works and what doesn’t.

Hello all,
I was trying to use ControllerX instead of manually programming each button… but now I have spent WAY more time trying to get it to work than actually setting up an integration for each button press.
However I have sent so much time that I don’t want to uninstall, I am stubborn.

I have apps.yaml (inside a0d7b954_addons) as

---
hello_world:
  module: hello
  class: HelloWorld

coffeestation_controller:
  module: controllerx
  class: E1810Controller
  controller: sensor.coffee_remote_action
  integration: z2m
  light: light.coffee_station

AppDaemon log looks ok:

2023-12-27 14:41:58.413882 INFO AppDaemon: App 'hello_world' added
2023-12-27 14:41:58.418869 INFO AppDaemon: App 'coffeestation_controller' added
2023-12-27 14:41:58.421630 INFO AppDaemon: Found 2 active apps
2023-12-27 14:41:58.422670 INFO AppDaemon: Found 0 inactive apps
2023-12-27 14:41:58.424147 INFO AppDaemon: Found 0 global libraries
2023-12-27 14:41:58.425360 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2023-12-27 14:41:58.429949 INFO AppDaemon: Running on port 5050
2023-12-27 14:41:58.558536 INFO HASS: Evaluating startup conditions
2023-12-27 14:41:58.586447 INFO HASS: Startup condition met: hass state=RUNNING
2023-12-27 14:41:58.587260 INFO HASS: All startup conditions met
2023-12-27 14:41:58.660180 INFO AppDaemon: Got initial state from namespace default
2023-12-27 14:42:00.441267 INFO AppDaemon: Scheduler running in realtime
2023-12-27 14:42:00.447235 INFO AppDaemon: Adding /config/apps to module import path
2023-12-27 14:42:00.450721 INFO AppDaemon: Loading App Module: /config/apps/hello.py
2023-12-27 14:42:00.540523 INFO AppDaemon: Loading app hello_world using class HelloWorld from module hello
2023-12-27 14:42:00.544854 INFO AppDaemon: Calling initialize() for hello_world
2023-12-27 14:42:00.733881 INFO hello_world: Hello from AppDaemon
2023-12-27 14:42:00.738053 INFO hello_world: You are now ready to run Apps!
2023-12-27 14:42:00.741358 INFO AppDaemon: App initialization complete
2023-12-27 14:42:01.692925 INFO AppDaemon: New client Admin Client connected

When going on the webUI of AppDaemon v4.4.2 I can see

My remote and my lights are working (zigbee2mqtt and showing as devices in mqtt integration, I can turn them on/off with toggle)

Now what’s the next step? Clicking the remote buttons don’t change anything on the lights. I tried adding this to the config but still nothing.

  actions:
    - "on"
    - "off"

Any help really appreciated

Hi,

I use a remote to control my light.
Now I want to change the way how lights are switched on/ off. I want to use the same button (button_1_press_release) to switch lights on and off, based on the condition that the lights are currently on resp. off.

As far as I could see, I need Callback Constraints, but I´m not sure how (and where) exactly I have to implement it.

Right now I use the following:

WZ_Deckenleuchten:
  module: controllerx
  class: PhilipsRDM002LightController
  integration: z2m
  controller: sensor.dimmschalter_action
  light: light.deckenspots
  mapping:
    button_1_press_release:
      - service: light.turn_on
    button_1_hold:
      - service: light.turn_off
    dial_rotate_left_step:
      - service: light.turn_on
        data:
          brightness_step_pct: -20
        target:
          entity_id: light.deckenspots
    dial_rotate_left_slow:
      - service: light.turn_on
        data:
          brightness_step_pct: -20
        target:
          entity_id: light.deckenspots
    dial_rotate_left_fast:
      - service: light.turn_on
        data:
          brightness_step_pct: -20
        target:
          entity_id: light.deckenspots
    dial_rotate_right_step:
      - service: light.turn_on
        data:
          brightness_step_pct: 20
        target:
          entity_id: light.deckenspots
    dial_rotate_right_slow:
      - service: light.turn_on
        data:
          brightness_step_pct: 20
        target:
          entity_id: light.deckenspots
    dial_rotate_right_fast:
      - service: light.turn_on
        data:
          brightness_step_pct: 20
        target:
          entity_id: light.deckenspots

Thank you for any help!

I need a little help getting a new Styrbar controller (the square 4-way one without the centre button) working via Deconz. I can see it in HA as a device, and if I look in the logbook for it I can see keypresses being registered, such as:

Remote Control N2 'Long release' event for 'Dim up' was fired
10:11:11 - 1 minute ago

Remote Control N2 'Long press' event for 'Dim up' was fired
10:11:11 - 1 minute ago

Remote Control N2 'Short release' event for 'Left' was fired
10:06:27 - 6 minutes ago

But I can’t get ControllerX to see it or do anything with it.

Currently I have this in my apps.yaml file:

n2_controller:
  module: controllerx
  class: E2002MediaPlayerController
  controller: remote_control_n2
  integration: deconz
  media_player: media_player.radiopizero
  merge_mapping:
    1003: # brightness up release
      service: script.reset_rp0
    2003: # brightness up release
      service: script.toggle_rp0
    3003: # brightness up release
      service: script.reset_rp0
    4003: # brightness down release
      service: script.toggle_rp0
    1002: # brightness up release
      service: script.reset_rp0
    2002: # brightness up release
      service: script.toggle_rp0
    3002: # brightness up release
      service: script.reset_rp0
    4002: # brightness up release
      service: script.toggle_rp0
    1001: # brightness up release
      service: script.reset_rp0
    2001: # brightness up release
      service: script.toggle_rp0
    3001: # brightness up release
      service: script.reset_rp0
    4001: # brightness up release
      service: script.toggle_rp0

study_controller:
  module: controllerx
  class: E1810MediaPlayerController
  controller: study_remote
  integration: deconz
  media_player: media_player.radiopizero
  merge_mapping:
    4002: # left <
      service: script.reset_rp0
    1002: # main click
      service: script.toggle_rp0

where n2_controller is the Styrbar (the set-up is to check every option listed in the devices page of the ControllerX doc) and study_controller is another controller which is working fine (I have 5 controllers and switches set up this way, the others all work fine).

Can anyone see anything obvious here, or is there any known issue with this controller (aside from being much inferior to the old round one with the centre button)?

Editted to add - got this resolved. My ControllerX set-up was too old to include the Styrbar, and as it was a manual install I hadn’t got anything flagging to say newer versions were available.

So fixed that up (finally got it working under HACS) and now all is well.

I’ve added this definiton to aqara.py

class WXKG17LMZ2MLightController(Z2MLightController):
    def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
        return {
            "single_both": Z2MLight.TOGGLE,
            "single_left": Z2MLight.TOGGLE,
            "single_right": Z2MLight.TOGGLE,
            "double_left": Z2MLight.CLICK_BRIGHTNESS_UP,
            "double_right": Z2MLight.CLICK_BRIGHTNESS_UP,
            "hold_left": Z2MLight.CLICK_BRIGHTNESS_DOWN,
            "hold_right": Z2MLight.CLICK_BRIGHTNESS_DOWN,
        }

and those two to apps.yaml

E1_Bastian_Schlafzimmer_Schalter1+2:
  module: controllerx
  class: WXKG17LMZ2MLightController
  integration: z2m
  controller: sensor.aqara_e1_schlafzimmer_nachttisch_bastian_action
  light: light.hue_iris_schlafzimmer
  mapping:
    single_left: toggle
    double_left: hold_brightness_up
    hold_left: hold_brightness_down

E1_Bastian_Schlafzimmer_Schalter3+4:
  module: controllerx
  class: WXKG17LMZ2MLightController
  integration: z2m
  controller: sensor.aqara_e1_schlafzimmer_nachttisch_bastian_action
  light: light.hue_white_and_color_ambiance_schlafzimmer
  mapping:
    single_right: toggle
    double_right: hold_brightness_up
    hold_right: hold_brightness_down

But nothing happend. it is not reacting at all.
In Z2M Log I can see that action is fired e.g. for single_left:

Info 2024-02-16 16:52:09MQTT publish: topic 'zigbee2mqtt/Aqara E1 Schlafzimmer Nachttisch Bastian', payload '{"action":"single_left","battery":45,"click_mode":"multi","device_temperature":25,"elapsed":427894,"linkquality":76,"power_outage_count":0,"voltage":2917}'
Info 2024-02-16 16:52:09MQTT publish: topic 'zigbee2mqtt/Aqara E1 Schlafzimmer Nachttisch Bastian', payload '{"action":"","battery":45,"click_mode":"multi","device_temperature":25,"linkquality":76,"power_outage_count":0,"voltage":2917}'
Info 2024-02-16 16:52:09MQTT publish: topic 'zigbee2mqtt/Aqara E1 Schlafzimmer Nachttisch Bastian/action', payload 'single_left'

No idea anymore what is going wrong.

Hello @xaviml!
First of all, thanks a lot for this project. It’s super useful and works great with all my different zigbee switches.
But I do wonder, is the project dead? There haven’t been a release in almost a year, and I notice a lot of pull requests on github. Do you plan on continuing the project or should someone maybe fork it?

Hi @mortelil ,

I have been busy with work and others. I apologize for leaving the project in this state, but I do intend to come back soon and do the following:

  • Fix issue with ControllerX installation and update.
  • Add support to more controllers as requested.

I hope I did not let no one down.

Regards,
Xavi M.

5 Likes

hi
Thank you for this project its a bi help
I am trying to use the philips dimmer to controll 2 seperate light in my living room

i use this app in the app.yaml

hue_dimmer_living_room:
  module: controllerx
  class: HueDimmerController
  controller: sensor.hue_living_room_dimmer_action
  integration: z2m
  light: light.living_room_side_light
  merge_mapping:
    on_press_release: toggle
    off_press_release:
      service: light.toggle
      target:
        entity_id: light.living_room_light

but the off_press_release is useing the default light insted of the target specified.
any help what do i di worng ?

@Bastian007 - it may be worth checking your install is up to date.

I just fell over that one - see my post just above yours. My install turned out to be not up to date, and doing that fixed my issue (with an Ikea Styrbar in my case).

Great to see a post from @xaviml as well - was beginning to wonder myself if this great addon was going to wither away.

@DarrenHill
How you recognized yours is outdated? My version shown in HACS/Automation is v4.26.2, same as in GitHub Rep.

In my case it wasn’t originally installed via HACS (as I couldn’t get it to work).
In the files there is one which lists the version number (cx_version.py) - from there I could see I was on an older version.

If you’re already on v4.26.2 then your issue isn’t the same as mine, but I thought I’d mention it as the symptoms sounded very similar.

I’ve now got it installed under HACS properly, so hopefully I will get notifications for updates etc properly.

1 Like

No need to apologize @xaviml! My family and I use your addon every day, and we’re really grateful for it. Juggling a full-time job and two kids myself, I totally get how busy life can be. I can imagine that what started as a fun project might start to feel like a bit of a burden with all the comments and pull requests rolling in. Take your time, you don’t owe us anything :slight_smile:

2 Likes