ControllerX. Bring full functionality to light and media player controllers

Hi everyone,

I am happy to announce the addition of a new feature coming for next release, the Zigbee2MQTT Light Controller. For those using Zigbee2MQTT to integrate their lights, you will now be able to use a new controller type to change brightness and color temperature much more smoother than the regular Light Controller. You can read more about it here.

I just released ControllerX v4.21.0b0 (beta version) with this new feature. I would appreciate for those interested to try it out and let me know you encounter any problems with your controller or light. I have given support for this new controller type Z2MLightController for most of the controllers that were supporting Zigbee2MQTT. You will need to check if your controller allows it before trying it out as well as checking the name of the class (list of supported controllers here from beta-released documentation).

For example, the E1810 IKEA device now supports E1810Z2MLightController (Z2M Light Controller) as well as the standard E1810Controller (Light Controller).

Cheers,
Xavi M.

1 Like

Hi. It’s been awhile since I update my controllers since it has been working. This new features sounds great and will be trying it when I get some free time.

I forgot how to update controllerX. Is it just a matter of replacing what is currently inside the controllerx folder with the beta? It will not break my existing configuring?

Hi @duceduc ,

Thank you for willing to try new feature. I should probably prepare a how-to page on how to try beta versions.

What you are saying is one way, but if you are not 100% sure about it, I would not suggest you doing it.

If you installed ControllerX through HACS (recommended way), you will nees to go to Austomations where Controllerax is present. Then, you can click on the 3 dots from ControllerX card and select “Redownload”. Finally you can enable “Show beta versions” and select the latest version, and restart AppDaemon addon/server.

In case the beta version breaks anything, all you need to do is go to “Redownload” again and select the previous working version, and restart AppDaemon.

Regards,
Xavi M.

Oh. I think I just added the controllerx from the beginning in the appdaemon folder. I don’t see anything in automation tab in HACS. eeeks. Maybe at the time, controllerx wasn’t available in HACS???

Hi @duceduc ,

You can do that, it is not a problem, it is just more manual work and HACS just automates that process for you.

You probably do not see ControllerX in the Automation tab because you will need to add it. Also, you might need to enable AppDaemon from HACS configuration (I believe is disabled at first).

You can read more about it here.

Regards,
Xavi M.

Hi @xaviml, first of all… thanks for the great work!

With the code below I try to achieve to open the cover with 2 left clicks and close with 2 right clicks but it doesn’t work.
2 click up, light turn on however does work.
Do you have any suggestions? (I’m sure you have … :grinning:)

remote_control_e2002:
  module: controllerx
  class: W2049LightController
  controller: styrbar
  integration: deconz
  light: light.sk_1
  multiple_click_delay: 1000
  merge_mapping:
    1002$2:
      service: light.turn_on
      data:
        brightness: 255
        color_temp: 362
    3002$2:
      service: cover.open_cover
      data: {}
      target:
        entity_id: cover.rolluik
    4002$2:
      service: cover.close_cover
      data: {}
      target:
        entity_id: cover.rolluik


Hi @erik7 ,

The problem is that target is not needed, you just need “entity_id” at the same level as “service”, and “data” can be ignored if no data is needed.

Sorry, I am in the phone and it is difficult to give you the full example, but if it does not work for you, I will give the example code.

Regards,
Xavi M.

No problem at all, it’s working now the way you mentioned.
Thanks!

1 Like

I have converted a set of lights to zigbee2mqtt network. I see the 2 devices (sr_1 and sr_2). How to combine them to act as one?

The below works to control one of the two.

shower_room:
  module: controllerx
  class: E1743Z2MLightController
  controller: shower_room
  integration:
    name: z2m
    listen_to: mqtt
  light:
    name: sr_1
    mode: mqtt

Update:
Ok. I’ve figured it out. I needed to create a group for these lights. The fade in/out works with these controller and also the E1810.

1 Like

I cannot seem to get this to work whatsoever. I installed and started AppDaemon first, then installed ControllerX from HACS and edited the /config/appdaemon/apps/apps.yaml as follows:

---
hello_world:
  module: hello
  class: HelloWorld

LR remote:
  module: controllerx
  class: E1810Controller
  controller: 04:cd:15:ff:fe:87:41:ea
  integration: zha
  light: light.living_room_zha_group_0x0002
  delay: 500
  automatic_steps: 6
  actions:
    - toggle
    - step_with_on_off_0_43_5
    - step_1_43_5_0_0
    - stop_with_on_off, release
    - press_2_0_0
    
den remote:
    module: controllerx
    class: E1810Controller
    controller: 2c:11:65:ff:fe:c4:4f:0d
    integration: zha
    light: light.bedroom_zha_group_0x0003
    actions:
        - toggle
        - step_with_on_off_0_43_5
        - step_1_43_5_0_0
        - stop_with_on_off, release
        - press_2_0_0

The AppDaemon logs show that 3 apps were found, and making changes in apps.yaml causes the logs to indicate that the app was terminated and re-initialized, but neither remote that I have setup will do anything at all. I’ve also tried changing the lights being controlled, also to no effect.

One thing I’m not super clear on from the documentation - if I want to use all of the default mappings, do I just leave off the actions: lines? I initially did not have any actions listed since they weren’t shown in the docs as required but I tried adding them just to be sure that not including them was not why my controllers weren’t working.

Hi @zack4200,

Are the ZHA events firing up? You can check this in the developer tools page and then go to Events. Then, in the “Listen to events” section you can listen for: “zha_event”, then you can start interacting with your E1810 controller and check if events are popping up in there.

Correct, the actions is not required, so if you like the default mapping, you can just leave it out. This actions attribute can be used to specify which event you would like to use in that configuration. For example if you just specify “toggle”, then only “toggle” event will be working, the rest will be ignored.

Regards,
Xavi M.

I have this Ikea dimmer that is setup like this. Short press On button, turns on 1 light. Long press On button, turns on 2 lights. Off button will turn off both lights. Could this be use with the MLightController???

master_dimmer:
  module: controllerx
  class: E1743Controller
  controller: sensor.master_dimmer_click
  integration: z2m
  light: light.m_1
  merge_mapping:
    brightness_stop:
      service: light.turn_on
      data:
        entity_id: light.master
    "off":
      service: light.turn_off
      data:
        entity_id:
         - light.master

Hi @duceduc ,

I assume that by MLightController you meant Z2MLightController. In that case, yes, it can be used, but unfortunately, it would need to be split in 2 configurations. Right now you are using the service action type and if you want to use Z2MLightController with no interaction with HA (or at least, just the mqtt service), then you can do the following assuming that m_1 and master are the friendly names in zigbee2mqtt:

m1_dimmer:
  module: controllerx
  class: Z2MLightE1743Controller
  controller: sensor.master_dimmer_click
  integration: z2m
  light: m_1  # This is the light friendly name
  excluded_actions: ["brightness_stop", "off"]

master_dimmer:
  module: controllerx
  class: Z2MLightE1743Controller
  controller: sensor.master_dimmer_click
  integration: z2m
  light: master  # This is the light friendly name
  actions: ["brightness_stop", "off"]
  mapping:
    brightness_stop: "on"

This should do the same as your configuration, but everything by mqtt payloads. If you want to fully use mqtt, then you will need to enable the MQTT plugin, and use a configuration like:

m1_dimmer:
  module: controllerx
  class: Z2MLightE1743Controller
  controller: master_dimmer # this is the controller friendly name
  integration:
    name: z2m
    listen_to: mqtt
  light:
    name: m_1  # This is the light friendly name
    mode: mqtt
  excluded_actions: ["brightness_stop", "off"]

master_dimmer:
  module: controllerx
  class: Z2MLightE1743Controller
  controller: master_dimmer  # This is the controller friendly name
  integration:
    name: z2m
    listen_to: mqtt
  light:
    name: master  # This is the light friendly name
    mode: mqtt
  actions: ["brightness_stop", "off"]
  mapping:
    brightness_stop: "on"

Hopefully this gives you an overview of the potential of this new controller type. I would personally use it for better smooth transitions, otherwise, no much difference will be noticed I believe.

Regards,
Xavi M.

Hi everyone,

Most of you would have seen that there is a new AppDaemon addon version in Home Assistant. This new version now uses Python 3.10.4, and I just wanted to confirm that you all can safely update it since AppDaemon and ControllerX work fine in Python 3.10. However, I would highly recommend taking a backup (there is a check for that) before upgrading just in case.

I have updated mine and I did not see any error in the logs and everything is working fine. But I am sure most of you have much more complex configurations than I do… :sweat_smile: :joy:

Regards,
Xavi M.

1 Like

I would personally use it for better smooth transitions, otherwise, no much difference will be noticed I believe.

I understand. I was hoping to setup a smooth transitions with my current old setup using the new Z2MLightController.

To further explain the setup. It is a room that has 2 lights (m_1 and m_2). For the most part, I only turn on 1 light most of the time. If need, I turn on both lights. Since I have converted those lights over to zigbee2mqtt network, I have also created a group called (master), which controls both lights. It doesn’t seem I would be able to setup a smooth transitions since I am using the long press to turn on the second light??

I did not see any events popping up in the “listen to events” section when I was trying a couple nights ago before posting. I just started trying again and both remotes had gone offline and wouldn’t come back, so I reset abd added them through zha again - one connected and now the events show up and it works as expected.I’m not really sure what changed but hey I’ll take it I guess.

Now I just need to figure out why the 2nd remote will not reconnect but I’m sure that’s not related to ControllerX

Edit - the 2nd remote still will not pair, but I added a couple more remotes. #1 and #3 both work perfectly, but #4 does not work and events for it don’t show up when listening to zha_events.
Edit 2 - reset/re-paired #4 and now it works too, so I guess my problems mostly worked themselves out.

1 Like

Hi @duceduc ,

Yes, you can setup the smooth transition with the new controller. Knowing you have a E1743 controller and 2 lights (but one of them is the primary one), I would suggest the following setup:

  • 1 Click “I”: turn on m_1
  • 1 Click “O”: turn off master (which will turn off m_1 if on)
  • hold “I”: bright up m_1
  • hold “O”: dim down m_1
  • 2 Clicks “I”: turn on master (which will turn on m_2 if m_1 is already on)

This would be my suggestion knowing your use case, but you can modify for your specific needs. Assuming that you have the mqtt plugin enable in AppDaemon, and you have the following devices in Zigbee2MQTT:

  • master_dimmer (This is the E1743 friendly name in Zigbee2MQTT)
  • master (This is a group created on Zigbee2MQTT that connects m_1 and m_2
  • m_1
  • m_2

Then, you could have the following configuration for the suggested mapping I mentioned above:

m1_dimmer:
  module: controllerx
  class: E1743Z2MLightController
  controller: master_dimmer
  integration:
    name: z2m
    listen_to: mqtt
  light:
    name: m_1
    mode: mqtt
  excluded_actions: ["off"]

master_light:
  module: controllerx
  class: E1743Z2MLightController
  controller: master_dimmer
  integration:
    name: z2m
    listen_to: mqtt
  light:
    name: master
    mode: mqtt
  mapping:
    "off": "off"
    "on$2": "on"

Note that this will work just with Zigbee2MQTT and MQTT broker, Home assistant will not interact with this configuration. This means that even if Home Assistant is restarting, this configuration will keep working.

Regards,
Xavi M.

1 Like

Hi @zack4200 ,

I am glad you figured it out. ControllerX works with the ZHA event messages, so if no messages are shown on that page, there is not much ControllerX can do.

Regards,
Xavi M.

Just tested and it works as described. Thank you for taking the time to help out.
Is it possible to have both lights fade in and out when either one or both are on?

Hi @duceduc ,

Yes, you just need to make the hold action available to the “master_light” app instead of “m1_dimmer”. I can sketch the configuration for you if you need.

Regards,
Xavi M.