ControllerX. Bring full functionality to light and media player controllers

Thanks @xaviml

I have walked about a bit and it seems the controller signal is very weak. I think I may have to invest in one with a stronger signal!

All the best and thanks again! Im so happy this has worked!!

Cheers

Phill

1 Like

Hello, this plugin looks like a nice solution to keep my IKEA controllers in a simple to understand environment. As I have limited controllers on my walls, I would love to use the buttons as extensively as possible. I might be missing something, but I don’t understand how I can configure one of the buttons on the controller to turn on/off a lights with a press, and dim/brighten the same light, if the same button is held down. Is this possible to do? This way I could control at least four lights with one E1524/E1810 controller.

Hi @jacobtc,

Yes, this is possible. ControllerX offers a default mapping for the controllers, but they can be override with mapping or merge_mapping atrributes. You can have a look to custom mapping: Custom mapping | ControllerX

What you need is:

  • pressing: toggle action
  • hold: hold_brightness_toggle
  • release: release

You might need to define different configs for each light.

If you are still confused by this, I can show yu a dummy example similar for what you want.

Regards,
Xavi M.

Okay, so something like this would work, as it uses the same button:

light1_controller:
  module: controllerx
  class: LightController
  controller: e1810_controller
  integration: deconz
  light: light.light1example
  mapping:
    2002: toggle
    2001: hold_brightness_toggle
    2003: release

I’m not currently home at the moment, so I can’t test. I just want to wrap my head around it, before I go and change out my current way of doing it.

Hi @jacobtc,

Correct, that would be for the brightness up button. You can use the same structure for other buttons and lights.

Note that the hold_brightness_toggle will swap directions everytime you hold the button, so you can dim up and down.

Regards,
Xavi M.

Thanks,

So the “mapping” function disables all other buttons, keeping only the defined ones, while “merge_mapping” also keeps the undefined buttons as their default action?

It would be awesome to have something like this:

lights_office:
module: controllerx
class: LightController
controller: e1810_controller_office
integration: deconz
light:
light.light1example
light.light2example
mapping:
light.light1example:
2002: toggle
2001: hold_brightness_toggle
2003: release
light.light2example:
3002: toggle
3001: hold_brightness_toggle
3003: release

Formatting doesn’t seem to work properly, but having the ability to define a series of lights for the same controller, and mapping each light to a button on it.

Right now I have to do the whole:

lights_office:
module: controllerx
class: LightController
controller: e1810_controller_office
integration: deconz

For each light, right?

Hi @xaviml

Another quick question. Should I be able to control one light with two separate ikea remotes? I have configured them separately using the same entity. One works (the original) but the second doesnt. Not sure I have done anything wrong so just checking this should work first.

Cheers
Phill

Another question from me as well! How does this integrate into Home Assistant, if I need to expand the automation… Lets say I want my lights to function at normal brightness levels in the day, but only output 25% brightness in the evening when turned on?

Sorry I’m new to this, so I’m still figuring this stuff out :smiley:

EDIT: I’m guessing that I can set all lamps to 25% after 10PM, and turn them off a second after, this would allow for the lamps to maintain that brightness when I toggle them on again, however this would also turn off all lights. I could create a condition which checks if the light is on, and not turn it off, so I actually have two automations, one for already off lights, and one for lights that are on. Is this the best way of doing this?

Hello,
First of all, what a great job @xaviml did with this automation. Bravo!
I have a problem with setting up E1743 controller with merge_mapping. First I tried to add multiclicking( I don’t know if that’s possible with this controller) so when I failed to do that I tried to assigned merge_mapping to E1743 controller but when I do that, not just merge_mapping commands are not working, but also default commands are not working also.
Here is my work:

bedroom_light:
  module: controllerx
  class: E1743Controller
  controller: 84:fd:27:ff:fe:35:ee:34
  integration: zha
  light: light.bedroom_lights
  merge_mapping:
    move_with_on_off_0_83:
      -service: script.bedroom_led
    move_1_83:
      -service: script.bedroom_led_off

Also I tried multiclicking with this code:

bedroom_light:
  module: controllerx
  class: E1743Controller
  controller: 84:fd:27:ff:fe:35:ee:34
  integration: zha
  light: light.bedroom_lights
  multiple_click_delay: 500
  merge_mapping:
    "on$2":
      -service: light.turn_off
      data:
        entity_id: light.bedroom_led
    "off$2":
      -service: light.turn_off
      data:
        entity_id: light.bedroom_led

Please help!

@Spaka

I’m not sure, but dont you need a space between “-” and “service” so

-service: light.turn_off

becomes

- service: light.turn_off

Tried putting space between but still not working

The “-” shouldn’t be there!

It should look like this:

      4002: 
        service: script.rollladen_on
      3004:
        service: switch.turn_off
        entity_id: switch.dachbodenlicht

Just an update. I made it work so if anyone have same problem maybe this will help.
I took out

multiple_click_delay: 500

and made a scene(you can also make an script) so that my bedroom led lights turn on/off. This is my code now and it works:

bedroom_light:
  module: controllerx
  class: E1743Controller
  controller: 84:fd:27:ff:fe:35:ee:34
  integration: zha
  light: light.bedroom_lights
  merge_mapping:
    "on$2":
      - scene: scene.bedroom_led_on
    "off$2":
      - scene: scene.bedroom_led_off

I didn’t had replace - scene to scene like @carsten_h suggested, but I do appreciate your help.

Does anyone know if I should be able to use more than one controller for a single light?

Cheers

Phill

Sure, shouldn’t be a problem, just change the controller, but keep the same light entity.

I can confirm, I am using two dimmers in the same room.

Hi @jacobtc,

Unfortunately, this is not possible with ControllerX and it will never be. It is in the core the relationship of “1 app → N controllers → 1 entity”. To tackle the problem of copying always this:

lights_office:
  module: controllerx
  class: LightController
  controller: e1810_controller_office
  integration: deconz

You could leverage YAML anchors to reference a block when needed. For example:

.common_config: &common_config
  module: controllerx
  class: LightController
  controller: e1810_controller_office
  integration: deconz

light_livingroom:
  <<: *common_config
  light: light.livingroom
  mapping:
    2002: toggle
    2001: hold_brightness_toggle
    2003: release

light_office:
  <<: *common_config
  light: light.office
  mapping:
    3002: toggle
    3001: hold_brightness_toggle
    3003: release

I hope this can help you out reduce some YAML lines and make it tidier.

Regards,
Xavi M.

1 Like

Hi Phill,

Yes, that is totally possible. As long as the controller is the same and it is integrated with the same integration, you can do the following:

office_controller:
  module: controllerx
  class: E1810Controller
  controller:
  - sensor.remote_switch_for_office_1_action
  - sensor.remote_switch_for_office_2_action
  integration: z2m
  light: light.lukes_room_bulb

However, if the controller is different, then you can just use 2 different apps:

office_controller_1:
  module: controllerx
  class: E1810Controller
  controller: sensor.remote_switch_for_office_1_action
  integration: z2m
  light: light.lukes_room_bulb

office_controller_2:
  module: controllerx
  class: E1810Controller
  controller: sensor.remote_switch_for_office_2_action
  integration: z2m
  light: light.lukes_room_bulb

You should keep in mind that each configuration is an independent app, so one does not know about the other. This means that if you have 2 apps with the same controller and light, but different mapping, you might experience some weird and unwanted behaviour.

Regards,
Xavi M.

2 Likes

Hi @Spaka,

Glad you got it working. The - as you said can be placed or not. I normally recommend not using it if there is only one action. However, if you use more than one you will need the -. ControllerX detects if it’s a list or not for you, this is why it doesn’t matter if you place it.

Regarding the multiple_click_delay, it is 500 by default, so it should be the same as putting multiple_click_delay: 500. Not sure how it started working when you removed it. I normally recommend putting a higher delay when is not working properly (e.g., 1000). Then, you can lower it down and check when it stops working fine. The lower the number the faster the response, but if your network is slow maybe a 500ms delay is not enough to pick up consecutive messages. For example, having MQTT integrated is much faster than using the sensor entity with Zigbee2MQTT, so the multiple_click_delay can be lower in those cases. I have this setup and I have the multiple_click_delay: 300 working flawlessly.

In the case of ZHA, it is normally quite fast, but if the controller is far, the network might be slow and you might need to use a higher number.

Regards,
Xavi M.

Once again @xaviml thanks for your help.

I stupidly copied and pasted from my e1812 amending the model but not the description. I put E1810lightcontroller… Couldnt work out why it didnt work until now.

Its always something stupid! Thanks for confirming for me anyway. Ruled out a limitation of the software.

Cheers

Phill

1 Like