ControllerX. Bring full functionality to light and media player controllers

Trying to do a merge mapping but it won’t work

switch_controller_on:
  module: controllerx
  class: E1766CoverController
  controller: tradfri_open_close_remote_action
  integration: deconz
  switch: switch.on_off_plug_in_unit_12
  merge_mapping:
    1002:
      - service: switch.turn_on

any ides?
Debug says ; switch.on_off_plug_in_unit_12 is not recognized as a template

Hi @Fifthy ,

You are using E1766CoverController, if you want to use a switch, you should use E1766SwitchController.

Hope that solves the issue.

Regards,
Xavi M.

same issue :frowning:

Could you please share the AppDaemon logs (including initialization)?

Thanks,

Is this enough? Which switch should be turned on here?

The one stated above
switch: switch.on_off_plug_in_unit_12

Hi @Fifthy ,

@carsten_h made me see something I missed at first from the configuration. You are using a Service call, so the entity should be passed together with a data attribute. So, it could be solved with:

switch_controller_on:
  module: controllerx
  class: E1766SwitchController
  controller: tradfri_open_close_remote_action
  integration: deconz
  switch: switch.on_off_plug_in_unit_12
  merge_mapping:
    1002:
      - service: switch.turn_on
        data:
          entity_id: switch.on_off_plug_in_unit_12

However, you can omit the data and pass the entity directly:

switch_controller_on:
  module: controllerx
  class: E1766SwitchController
  controller: tradfri_open_close_remote_action
  integration: deconz
  switch: switch.on_off_plug_in_unit_12
  merge_mapping:
    1002:
      - service: switch.turn_on
        entity_id: switch.on_off_plug_in_unit_12

In addition, this could be improved by using a predifined action that does already this, the on action.

switch_controller_on:
  module: controllerx
  class: E1766SwitchController
  controller: tradfri_open_close_remote_action
  integration: deconz
  switch: switch.on_off_plug_in_unit_12
  merge_mapping:
    1002: "on"

Finally, this action is already part of E1766SwitchController, so the merge_mapping is not needed.

switch_controller_on:
  module: controllerx
  class: E1766SwitchController
  controller: tradfri_open_close_remote_action
  integration: deconz
  switch: switch.on_off_plug_in_unit_12

Note that the 4 configurations I share should all do the same, but the most efficient one would be the last one since no customization is needed to the default mapping.

Thanks @carsten_h for spotting this out.

Regards,
Xavi M.

Thanks guys!

1 Like

You are welcome. Sometimes you can look 1000 times at something and you don‘t see the problem. Another one sees it at the first time. The next time it will be the other way round. :slight_smile:

1 Like

Hi all.

New to HASS here, but I’ve been following the guides on this and tried installing everything to try to control my lights with the Hue Dimmer controls I’ve had for a while.

They have paired fine and I can see their battery sensors showing up nicely on Home assistant, so they’re there.

When I try to use this with appdaemon, however, nothing happens.

Upon checking the logs for appdaemon, here’s what I’m presented with. Any ideas on what may be the issue?
Thanks!


2021-06-02 22:45:16.090074 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/tuya.py
2021-06-02 22:45:16.090243 WARNING AppDaemon: No app description found for: tuya - ignoring
2021-06-02 22:45:16.090747 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/muller_licht.py
2021-06-02 22:45:16.090923 WARNING AppDaemon: No app description found for: muller_licht - ignoring
2021-06-02 22:45:16.091508 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/ikea.py
2021-06-02 22:45:16.091686 WARNING AppDaemon: No app description found for: ikea - ignoring
2021-06-02 22:45:16.092193 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/phillips.py
2021-06-02 22:45:16.092373 WARNING AppDaemon: No app description found for: phillips - ignoring
2021-06-02 22:45:16.093015 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/sonoff.py
2021-06-02 22:45:16.093192 WARNING AppDaemon: No app description found for: sonoff - ignoring
2021-06-02 22:45:16.093764 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/lutron.py
2021-06-02 22:45:16.093945 WARNING AppDaemon: No app description found for: lutron - ignoring
2021-06-02 22:45:16.094508 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/osram.py
2021-06-02 22:45:16.094694 WARNING AppDaemon: No app description found for: osram - ignoring
2021-06-02 22:45:16.095258 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/aurora.py
2021-06-02 22:45:16.095433 WARNING AppDaemon: No app description found for: aurora - ignoring
2021-06-02 22:45:16.096098 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/terncy.py
2021-06-02 22:45:16.096281 WARNING AppDaemon: No app description found for: terncy - ignoring
2021-06-02 22:45:16.096847 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/smartthings.py
2021-06-02 22:45:16.097017 WARNING AppDaemon: No app description found for: smartthings - ignoring
2021-06-02 22:45:16.097620 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/livarno.py
2021-06-02 22:45:16.097811 WARNING AppDaemon: No app description found for: livarno - ignoring
2021-06-02 22:45:16.098365 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/__init__.py
2021-06-02 22:45:16.098561 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.099133 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/legrand.py
2021-06-02 22:45:16.099315 WARNING AppDaemon: No app description found for: legrand - ignoring
2021-06-02 22:45:16.099838 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_devices/aqara.py
2021-06-02 22:45:16.100035 WARNING AppDaemon: No app description found for: aqara - ignoring
2021-06-02 22:45:16.100557 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/color_helper.py
2021-06-02 22:45:16.100736 WARNING AppDaemon: No app description found for: color_helper - ignoring
2021-06-02 22:45:16.101253 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/release_hold_controller.py
2021-06-02 22:45:16.101452 WARNING AppDaemon: No app description found for: release_hold_controller - ignoring
2021-06-02 22:45:16.102013 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/custom_controller.py
2021-06-02 22:45:16.102195 WARNING AppDaemon: No app description found for: custom_controller - ignoring
2021-06-02 22:45:16.102752 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/__init__.py
2021-06-02 22:45:16.102933 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.103533 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type_controller.py
2021-06-02 22:45:16.103723 WARNING AppDaemon: No app description found for: type_controller - ignoring
2021-06-02 22:45:16.104326 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/controller.py
2021-06-02 22:45:16.104516 WARNING AppDaemon: No app description found for: controller - ignoring
2021-06-02 22:45:16.105073 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/stepper/minmax_stepper.py
2021-06-02 22:45:16.105350 WARNING AppDaemon: No app description found for: minmax_stepper - ignoring
2021-06-02 22:45:16.105918 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/stepper/circular_stepper.py
2021-06-02 22:45:16.106127 WARNING AppDaemon: No app description found for: circular_stepper - ignoring
2021-06-02 22:45:16.106700 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/stepper/__init__.py
2021-06-02 22:45:16.106888 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.107436 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type/cover_controller.py
2021-06-02 22:45:16.107629 WARNING AppDaemon: No app description found for: cover_controller - ignoring
2021-06-02 22:45:16.108210 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py
2021-06-02 22:45:16.108389 WARNING AppDaemon: No app description found for: media_player_controller - ignoring
2021-06-02 22:45:16.108943 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py
2021-06-02 22:45:16.109135 WARNING AppDaemon: No app description found for: switch_controller - ignoring
2021-06-02 22:45:16.109671 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type/light_controller.py
2021-06-02 22:45:16.109888 WARNING AppDaemon: No app description found for: light_controller - ignoring
2021-06-02 22:45:16.110384 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/type/__init__.py
2021-06-02 22:45:16.110572 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.111103 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/state.py
2021-06-02 22:45:16.111284 WARNING AppDaemon: No app description found for: state - ignoring
2021-06-02 22:45:16.111779 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/z2m.py
2021-06-02 22:45:16.111970 WARNING AppDaemon: No app description found for: z2m - ignoring
2021-06-02 22:45:16.112498 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/zha.py
2021-06-02 22:45:16.112678 WARNING AppDaemon: No app description found for: zha - ignoring
2021-06-02 22:45:16.113167 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/lutron_caseta.py
2021-06-02 22:45:16.113357 WARNING AppDaemon: No app description found for: lutron_caseta - ignoring
2021-06-02 22:45:16.113870 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/mqtt.py
2021-06-02 22:45:16.114032 WARNING AppDaemon: No app description found for: mqtt - ignoring
2021-06-02 22:45:16.114509 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/__init__.py
2021-06-02 22:45:16.114697 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.115213 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/integration/deconz.py
2021-06-02 22:45:16.115377 WARNING AppDaemon: No app description found for: deconz - ignoring
2021-06-02 22:45:16.115916 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/feature_support/media_player.py
2021-06-02 22:45:16.116107 WARNING AppDaemon: No app description found for: media_player - ignoring
2021-06-02 22:45:16.116607 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/feature_support/light.py
2021-06-02 22:45:16.116760 WARNING AppDaemon: No app description found for: light - ignoring
2021-06-02 22:45:16.117252 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/feature_support/cover.py
2021-06-02 22:45:16.117440 WARNING AppDaemon: No app description found for: cover - ignoring
2021-06-02 22:45:16.118068 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py
2021-06-02 22:45:16.118224 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.118939 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/delay_action_type.py
2021-06-02 22:45:16.119137 WARNING AppDaemon: No app description found for: delay_action_type - ignoring
2021-06-02 22:45:16.119651 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/scene_action_type.py
2021-06-02 22:45:16.119822 WARNING AppDaemon: No app description found for: scene_action_type - ignoring
2021-06-02 22:45:16.120393 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py
2021-06-02 22:45:16.120605 WARNING AppDaemon: No app description found for: predefined_action_type - ignoring
2021-06-02 22:45:16.121137 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/base.py
2021-06-02 22:45:16.121298 WARNING AppDaemon: No app description found for: base - ignoring
2021-06-02 22:45:16.121829 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/__init__.py
2021-06-02 22:45:16.122022 WARNING AppDaemon: No app description found for: __init__ - ignoring
2021-06-02 22:45:16.122602 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/controllerx/cx_core/action_type/call_service_action_type.py
2021-06-02 22:45:16.122767 WARNING AppDaemon: No app description found for: call_service_action_type - ignoring

Edit: Here’s what the deconz event looks like on the developer tab (I’ve changed the IDs on purpose to post here, but they’re correct in the software):

Event 3 fired 10:33 PM:
{
    "event_type": "deconz_event",
    "data": {
        "id": "switch_philipshue_swd1",
        "unique_id": "00:17:88:01:xxxxxxxxx",
        "event": 1002,
        "device_id": "e761639a333fdxxxxxxxxxxxxx"
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-02T1xxxxxxx",
    "context": {
        "id": "d1bc2e9a9afce3xxxxxxxxxxxxxxxxxx",
        "parent_id": null,
        "user_id": null
    }
}

Edit 2:
Here’s the only content on my apps.yaml file:

switch_philipshue_swd1:
module: controllerx
class: HueDimmerController
controller: switch_philipshue_swd1
integration: deconz
light: light.downlight_wh_01

Is that in the correct format you are using? Because this is wrong!
It should look like this:

  wohnzimmer_controller_licht:
    module: controllerx
    class: E1810Controller
    controller: fernbedienung_dachboden
    integration: deconz
    light: light.led_streifen
1 Like

I took it from this page here: Hue Dimmer switch (Philips) | ControllerX

Should I be using a different class for this Philips Hue Dimmer?

EDIT:

I think I found out what you meant. I had to add tabulations to the beginning!
It’s now working!!!
Thank you! :smiley:

It doesn’t seem so. The indentation is missing!

Great!

You are welcome!

2 Likes

Hello!

I have a question regarding controlling (Ikea 1810) the colour of a light (it’s a light group).

I have this configuration:

  julian_controller_licht:
    module: controllerx
    class: E1810Controller
    controller: fernbedienung_julian
    integration: deconz
    light: light.julian_deckenlicht
    multiple_click_delay: 1000
    merge_mapping:
      1002$2:
        service: scene.turn_on
        entity_id: scene.julian_weiss
      4001:
        service: scene.turn_on
        entity_id: scene.julian_weiss
      5001:
        service: switch.toggle
        entity_id: switch.leiste_4

I can switch the lights on and of with the middle button. A double-click is setting them to white. I can chang the brightness with the button on top and bottom.
I can long press the left and right button to execute the switches.

But what it is not working is setting the colour of the lights. This is what I see in the appdaemon log:

2021-06-03 10:16:02.123164 INFO julian_controller_licht: 🎮 Button event triggered: `1002$2`
2021-06-03 10:16:02.133867 INFO julian_controller_licht: 🏃 Running `Service (scene.turn_on)` now
2021-06-03 10:16:02.141663 INFO julian_controller_licht: 
🤖 Service: scene.turn_on
  - entity_id: scene.julian_weiss
2021-06-03 10:16:13.517205 INFO julian_controller_licht: 🎮 Button event triggered: `5002`
2021-06-03 10:16:13.524658 WARNING julian_controller_licht: There is already an action executing for `5002`. If you want a different behaviour change `mode` parameter, the default value is `single`.
2021-06-03 10:16:15.896632 INFO julian_controller_licht: 🎮 Button event triggered: `4002`
2021-06-03 10:16:15.906503 WARNING julian_controller_licht: There is already an action executing for `4002`. If you want a different behaviour change `mode` parameter, the default value is `single`.

I don’t know what is meant with these two warnings. It seems something in the configuration has to be changed.

@xaviml Will ControllerX support the new IKEA Styrbar Remote Control (E2001/E2002) be supported soon? (Or is it perhaps supported already?)

Hi @carsten_h,

Sorry you are experiencing this. Those messages appear when mode is single (which is the default), and the action is already running. So what is happening is that ControllerX detected a running action for 5002 and 4002. Knowing they are click action, it is weird you are seeing those messages. My recommendation is that you restart the AppDaemon server and click right and left arrows to see if those messages appear. If they are still appearing, does this happen with just one light from the light group? Finally, could you double check you are on ControllerX v4.11.2?

Regards,
Xavi M.

Hi @erik7,

ControllerX already supports that controller (see list of supported controllers here). In fact, I have one myself and I made sure it is working properly for zigbee2mqtt. If you are using another integration (deconz or zha), you will need to let me know what actionsare fired from the controller when buttons are pressed and held. This is my configuration for the office light with this controller:

office_light:
  module: controllerx
  class: W2049LightController
  controller: "0x680ae2fffe7803cd"
  integration:
    name: z2m
    listen_to: mqtt
  light: light.office

Regards,
Xavi M.

That is the easiest part:

2021-06-04 08:36:03.845770 INFO julian_controller_licht: 🎮 ControllerX v4.11.2

The other things I am doing now.

The messages are still coming for the group. I will change to one light.
Oh, that is strange. I still got the messages, only one time I got this:

2021-06-04 22:13:11.276795 INFO julian_controller_licht: 🎮 Button event triggered: `4002`
2021-06-04 22:13:11.285436 INFO julian_controller_licht: 🏃 Running `Predefined (click_color_down)` now
2021-06-04 22:13:11.294639 WARNING julian_controller_licht: ------------------------------------------------------------
2021-06-04 22:13:11.295612 WARNING julian_controller_licht: Unexpected error in worker for App julian_controller_licht:
2021-06-04 22:13:11.296614 WARNING julian_controller_licht: Worker Ags: {'id': '4cea892155f94ec195d37dbbab7cd9a2', 'name': 'julian_controller_licht', 'objectid': '7b9ecabf08ff4a4ab9e94ff2862eaf23', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.event_callback of <cx_core.integration.deconz.DeCONZIntegration object at 0x7f96674bb0>>, 'data': {'id': 'fernbedienung_julian', 'unique_id': '00:0d:6f:ff:fe:1c:fc:36', 'event': 4002, 'device_id': '86e0fdf475eb4131881f4f8ace79df64', 'metadata': {'origin': 'LOCAL', 'time_fired': '2021-06-04T20:13:11.257665+00:00', 'context': {'id': '2299256b16f8ec1e1c7f777b50152a22', 'parent_id': None, 'user_id': None}}}, 'pin_app': True, 'pin_thread': 2, 'kwargs': {'id': 'fernbedienung_julian', '__thread_id': 'MainThread'}}
2021-06-04 22:13:11.297408 WARNING julian_controller_licht: ------------------------------------------------------------
2021-06-04 22:13:11.299127 WARNING julian_controller_licht: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 841, in async_worker
    await funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/controllerx/cx_core/integration/deconz.py", line 23, in event_callback
    await self.controller.handle_action(data[type_], extra=data)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 335, in handle_action
    await self.call_action(action_key, extra=extra)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 409, in call_action
    await self.action_timer_callback({"action_key": action_key, "extra": extra})
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 447, in action_timer_callback
    await task
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 465, in call_action_types
    await action_type.run(extra=extra)
  File "/config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py", line 56, in run
    await action(*args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 63, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/light_controller.py", line 585, in click
    attribute = await self.get_attribute(attribute)
  File "/config/appdaemon/apps/controllerx/cx_core/type/light_controller.py", line 517, in get_attribute
    raise ValueError(
ValueError: This light does not support xy_color or color_temp
2021-06-04 22:13:11.300085 WARNING julian_controller_licht: ------------------------------------------------------------

It is a tasmota light which is not longer handled via MQTT direct, but through the tasmota integration, because otherwise the colour-wheel of Home Assistant is not working correctly since 2021.5 because of a change in Home Asssitant.

1 Like

So this has exactly the same functions as the E1810? No change, only another look?
If I find the time and Ikea is open I will look for one at the end of the month.

Hi @carsten_h,

Probably afer that error if you keep pressing the arrow left and right, you get the messages you first reported. That is my bad, I should control this much better on ControllerX and let it throw the error everytime, but this is not the problem you are having anyway.

Regarding your problem, the light does not support xy_color or color_temp. This measn that the supported_features attribute from the light does not indicate properly what the light can support. Could you show me the supported_features for the group light and the inidividual ones? You can take an screenshoot of the attributes for each entity in “Developer Tools > States”. Also, can you change color through Home Assistant UI and from call services?

Regards,
Xavi M.