ControllerX. Bring full functionality to light and media player controllers

Hi, same issue here, no _action entity available. Before going to the direct MQTT way, is there already some idea how this can be -officially- solved? Or should this be raised as an issue to Koen (from Z2M)?

Thanks.

This is the debug log from the Z2m integration, for this controller:

      {
        "id": "924390e981654557b1403ee35def983a",
        "name": "IKEA E1810 Cube",
        "name_by_user": null,
        "disabled": false,
        "disabled_by": null,
        "entities": [
          {
            "device_class": null,
            "disabled_by": null,
            "disabled": false,
            "entity_category": "diagnostic",
            "entity_id": "sensor.ikea_e1810_cube_battery",
            "icon": null,
            "original_device_class": "battery",
            "original_icon": null,
            "state": {
              "entity_id": "sensor.ikea_e1810_cube_battery",
              "state": "34",
              "attributes": {
                "state_class": "measurement",
                "unit_of_measurement": "%",
                "device_class": "battery",
                "friendly_name": "IKEA E1810 Cube battery"
              },
              "last_changed": "2022-12-21T17:17:38.749555+00:00",
              "last_updated": "2022-12-21T17:17:38.749555+00:00"
            },
            "unit_of_measurement": "%"
          },
          {
            "device_class": null,
            "disabled_by": "integration",
            "disabled": true,
            "entity_category": "diagnostic",
            "entity_id": "sensor.ikea_e1810_cube_linkquality",
            "icon": null,
            "original_device_class": null,
            "original_icon": "mdi:signal",
            "state": null,
            "unit_of_measurement": "lqi"
          },
          {
            "device_class": null,
            "disabled_by": "integration",
            "disabled": true,
            "entity_category": "diagnostic",
            "entity_id": "sensor.ikea_e1810_cube_last_seen",
            "icon": null,
            "original_device_class": "timestamp",
            "original_icon": "mdi:clock",
            "state": null,
            "unit_of_measurement": null
          },
          {
            "device_class": null,
            "disabled_by": "integration",
            "disabled": true,
            "entity_category": "diagnostic",
            "entity_id": "sensor.ikea_e1810_cube_update_state",
            "icon": null,
            "original_device_class": null,
            "original_icon": "mdi:update",
            "state": null,
            "unit_of_measurement": null
          },
          {
            "device_class": null,
            "disabled_by": "integration",
            "disabled": true,
            "entity_category": "diagnostic",
            "entity_id": "binary_sensor.ikea_e1810_cube_update_available",
            "icon": null,
            "original_device_class": "update",
            "original_icon": null,
            "state": null,
            "unit_of_measurement": null
          },
          {
            "device_class": null,
            "disabled_by": null,
            "disabled": false,
            "entity_category": null,
            "entity_id": "update.ikea_e1810_cube",
            "icon": null,
            "original_device_class": "firmware",
            "original_icon": null,
            "state": {
              "entity_id": "update.ikea_e1810_cube",
              "state": "off",
              "attributes": {
                "auto_update": false,
                "installed_version": "2.3.080",
                "in_progress": false,
                "latest_version": "2.3.080",
                "release_summary": null,
                "release_url": null,
                "skipped_version": null,
                "title": null,
                "device_class": "firmware",
                "entity_picture": "https://github.com/Koenkk/zigbee2mqtt/raw/master/images/logo.png",
                "friendly_name": "IKEA E1810 Cube",
                "supported_features": 1
              },
              "last_changed": "2022-12-21T17:17:38.746881+00:00",
              "last_updated": "2022-12-21T17:17:38.746881+00:00"
            },
            "unit_of_measurement": null
          }
        ]
      }
    ],

This is some extra debug info from within HA:


Thanks guys. Solved it.

Cheers

1 Like

Can you tell us how you did it?

Hi all,

Would it be possible to use a binary_sensor and implement a double or even triple click event?

I am using the Aqara Windows and Door sensors behind by wall switch and using the on/off state (which is actually open/closed) event to trigger the light to toggle.

It would be nice to detect a double or triple click to trigger other lights or devices. I got it working for the ‘open’ event, just the single ‘click’

living_room_wall_switch_remote:
  module: controllerx
  class: LightController
  integration: state
  controller: binary_sensor.door_sensor_contact
  light: light.lamp_hal
  mapping:
    "on": "toggle"

The device is not supported, I tried with on$1, on$2 etc… but this is not working.

Any idea?

ps. got it working with a blueprint/automation but somehow the delay is to much… was hoping ControlerX is able to do it faster.

hi @xaviml this is a remote , not a light. it exponses actions : https://www.zigbee2mqtt.io/devices/5412748727388.html#prolight-5412748727388

made the request in you’re git

1 Like

Hi @netweaver ,

How did you integrate the E1810 controller to Zigbee2MQTT and home assistant. Did you configure it manually? Theorically, the “_action” comes on those sensors, but for some reason it was not added in your setup. It seems a problem from either Zigbee2MQTT or the MQTT integration. Do you see the /action topic in the Zigbee2MQTT logs?

These are the generic steps I recommend you:

  • Remove device from Zigbee2MQTT and pair it again.
  • Use the MQTT integration if /action topic is present in the Zigbee2MQTT logs. Integrations - ControllerX

Regards,
Xavi M.

Hi @bvduijv ,

This feature is supported by ControllerX. Multiple clicks - ControllerX

First of all, note that “on” and “on$1” is the same. However, if you want to register a double click, you need to specify it like “on$2” (as you pointed out).

Second, note that if you want to trigger the double click, it means that you need to open and close the window/door sensor quickly to register it as a double click. What you are probably experiencing is that the open and close actions are not as quick as ControllerX is expecting to (500ms) between the 2 events. This is why, I recommend you tweak multiple_click_delay attribute, so you have time to trigger the “on” action twice.

I just tried the following in my setup:

example_test:
  module: controllerx
  class: LightController
  integration: state
  controller: binary_sensor.entrance_detector_contact
  light: light.livingroom_lamp
  multiple_click_delay: 1000
  mapping:
    on$2: toggle

And it triggered the toggle after opening and closing my entrance door twice (I bet the neighbors thought I am crazy XD). I have to say that if I remove the multiple_click_delay: 1000, the automation does not work since the default is 500 (time in milliseconds). You can read more about multiple click functionality here: Multiple clicks - ControllerX

Regards,
Xavi M.

1 Like

Hello!

It seems that the new Ikea controller is the replacement for the older round Symfonisk controller to turn and press.
It is available now: https://stadt-bremerhaven.de/ikea-neue-symfonisk-fernbedienung-kostet-1599-euro
Attention, this is German!
Here at Ikea: https://www.ikea.com/de/de/p/symfonisk-fernbedienung-fuer-soundsystem-generation-2-90524607/

Here in English on the Netherlands Ikea site: https://www.ikea.com/nl/en/p/symfonisk-sound-remote-gen-2-90524607/

That is sad, as I really love the round controller to control the volume.

1 Like

Hi @Canaletto and @TheCosmicGate ,

I have added the support for your requesyed devices. They are now available in ControllerX v4.25.0.

Regards,
Xavi M.

Great ! Thnx :+1:

Thanks and happy new year !

I tested it but it doesn’t work. The controller registers well but does not show any action in the log…

Hi @Canaletto ,

Happy New Year :slight_smile: Could ypu please provide configuration as well as AppDaemon logs?

Thanks!

Hi! Just installed ControllerX and am trying to get MLI404002 working.
The only thing that works (Intermittently) is clicking the top button (on/off) and holding the second button.
Clicking the second button, clicking or holding third and fourth does nothing. The AppDaemon logs also don’t register any of these.
Here the apps.yaml:

hall_remote:
  module: controllerx
  class: MLI404002LightController
  integration: zha
  controller: cc:cc:cc:ff:fe:a3:2d:f6
  light: light.hall_light

I also tried this (same result):

hall_remote:
  module: controllerx
  class: MLI404002LightController
  integration: zha
  controller: cc:cc:cc:ff:fe:a3:2d:f6
  light: light.hall_light
  actions:
  - "on"
  - "off"
  - step_up
  - step_down
  - move_up
  - move-down
  - stop
  - recall

Here are the AppDaemon logs:

2023-01-15 00:02:02.414313 INFO hall_remote: 🏃 Running `Predefined (release)` now
2023-01-15 00:02:02.397882 INFO hall_remote: 🎮 Button event triggered: `stop`
2023-01-15 00:01:44.490083 INFO hall_remote: 🤖 Service: e[1mlight.togglee[0m - entity_id: light.hall_light
2023-01-15 00:01:44.473225 INFO hall_remote: 🏃 Running `Predefined (toggle)` now
2023-01-15 00:01:44.461502 INFO hall_remote: 🎮 Button event triggered: `on`
2023-01-15 00:01:41.124212 INFO hall_remote: 🤖 Service: e[1mlight.togglee[0m - entity_id: light.hall_light
2023-01-15 00:01:41.106526 INFO hall_remote: 🏃 Running `Predefined (toggle)` now
2023-01-15 00:01:41.091139 INFO hall_remote: 🎮 Button event triggered: `off`

I double checked that HA sees all the button presses by listening to the zha_event.

Thank you.

@xaviml Just wanted to say a huge thank you for providing this brilliant app! I’ve never used AppDaemon before but came across ControllerX while searching for a way of controlling one of my lights with a WXKG11LM smart switch. I followed instructions and setup the AppDaemon addon in my HA OS, installed the ControllerX app through HACS and configured it with a merge_mapping for one of the functions, and everything worked perfectly! Probably a first for me with HA :slight_smile:

1 Like

Hi @Maksim-us ,

Could you please share the zha_evebt for each of the press or hold action? The mapping might be outdated.

Do the step and move action work? I do not see that in the logs. Could you provide the full logs when interacting with all actions?

Thanks!

ControllerX seemed to have stopped working with my installation since I updated to the latest release of Home Assistant. I’m getting the following error:

🤖 Service: homeassistant.turn_off
  - entity_id: switch.0x7cb94c6193550000
2023-01-17 13:04:45.775016 WARNING bedroom_room_desk_lamp: ------------------------------------------------------------
2023-01-17 13:04:45.775103 WARNING bedroom_room_desk_lamp: Unexpected error in worker for App bedroom_room_desk_lamp:
2023-01-17 13:04:45.775185 WARNING bedroom_room_desk_lamp: Worker Ags: {'id': '6e5d177eda304b26b26cafdd41d2e152', 'name': 'bedroom_room_desk_lamp', 'objectid': '41855859feed4738ad7d767ac2408fe0', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method Z2MIntegration.event_callback of <cx_core.integration.z2m.Z2MIntegration object at 0x7fcaef470a30>>, 'data': {'topic': 'zigbee2mqtt/bedroom Room Desk Lamp Switch', 'wildcard': '#', 'payload': '{"action":"off","battery":87,"last_seen":"2023-01-17T18:04:45.733Z","linkquality":109,"update":{"installed_version":587699761,"latest_version":587699761,"state":"idle"},"update_available":null}'}, 'pin_app': True, 'pin_thread': 2, 'kwargs': {'topic': 'zigbee2mqtt/bedroom Room Desk Lamp Switch', '__thread_id': 'MainThread'}}
2023-01-17 13:04:45.775243 WARNING bedroom_room_desk_lamp: ------------------------------------------------------------
2023-01-17 13:04:45.775402 WARNING bedroom_room_desk_lamp: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 855, 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/z2m.py", line 61, in event_callback
    await self.controller.handle_action(payload[action_key], extra=payload)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 400, in handle_action
    previous_call_time = self.action_times[action_key]
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 474, in call_action
    self.action_timer_callback, delay, action_key=action_key, extra=extra
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 512, in action_timer_callback
    action_types = self.actions_mapping[action_key]
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 528, in call_action_types
    f"🏃 Running `{action_type}` now",
  File "/config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py", line 118, in run
    await action(*positional, **action_args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 62, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py", line 46, in off
    await self.call_service("homeassistant/turn_off", entity_id=self.entity.name)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 359, in call_service
    if isinstance(value, float):
  File "/usr/lib/python3.10/site-packages/appdaemon/adapi.py", line 1748, in call_service
    return await self.AD.services.call_service(namespace, d, s, kwargs)
  File "/usr/lib/python3.10/site-packages/appdaemon/services.py", line 155, in call_service
    raise DomainException("Unknown domain (%s/%s) in call_service from %s", namespace, domain, name)
appdaemon.exceptions.DomainException: ('Unknown domain (%s/%s) in call_service from %s', 'default', 'homeassistant', 'bedroom_room_desk_lamp')
2023-01-17 13:04:45.775480 WARNING bedroom_room_desk_lamp: ------------------------------------------------------------

Here is my configuration:

bed_room_desk_lamp:
  module: controllerx
  class: E1743SwitchController
  integration:
    name: z2m
    listen_to: mqtt
  controller: Bed Room Desk Lamp Switch
  switch: switch.0x7cb94c6193550000

Is anyone else seeing this?

I just moved from HueBrige + Home Assistant OS to Home Assistant OS with a Zigbee Stick + MQTT. I just discovered Controllerx last night. It’s really cool so far how it just “works” with one of my remotes.

One setup that I had was when I would press the “on” button on the hue switch multiple times in a row, it would change the color temperature/brightness of the lights in my living room. Anyway to set this up with ControllerX?

Summary

This text will be hidden

Hi!
for AppDaemon, those were the full logs. the other buttons did not trigger anything in AppDaemon.

The zha-event is slightly different on each press.
Here are most of the possibilities for each button:

Top Button:

event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0006
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 6
  command: "on"
  args: []
  params: {}
origin: LOCAL
time_fired: "2023-01-18T20:17:44.333977+00:00"
context:
  id: 01GQ38FGWDJ1B721YQ5WYC5GD9
  parent_id: null
  user_id: null
or
event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0006
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 6
  command: "off"
  args: []
  params: {}
origin: LOCAL
time_fired: "2023-01-18T20:18:40.493162+00:00"
context:
  id: 01GQ38H7QDVFFQEE2ZDE4TGPW3
  parent_id: null
  user_id: null

2nd button:
event_type: zha_event

  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0008
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 8
  command: move_to_level
  args:
    - 191
    - 3
    - 0
    - 0
  params:
    level: 191
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:19:28.862449+00:00"
context:
  id: 01GQ38JPYYS9CTJDVGTNPWZ3PD
  parent_id: null
  user_id: null
or
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0008
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 8
  command: move_to_level
  args:
    - 127
    - 3
    - 0
    - 0
  params:
    level: 127
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:20:12.244533+00:00"
context:
  id: 01GQ38M1AMA4R0H07KFAEMZSY6
  parent_id: null
  user_id: null
or
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0008
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 8
  command: move_to_level
  args:
    - 64
    - 3
    - 0
    - 0
  params:
    level: 64
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:20:30.222188+00:00"
context:
  id: 01GQ38MJWEEM5BKKBSMAGA2JNB
  parent_id: null
  user_id: null
or
event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0008
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 8
  command: move_to_level
  args:
    - 13
    - 3
    - 0
    - 0
  params:
    level: 13
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:20:58.518640+00:00"
context:
  id: 01GQ38NEGP0T4RXCZZSXNYQYF3
  parent_id: null
  user_id: null

3rd button:

event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0300
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 768
  command: move_to_color_temp
  args:
    - 222
    - 3
    - 0
    - 0
  params:
    color_temp_mireds: 222
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:21:40.745763+00:00"
context:
  id: 01GQ38PQR96PM0AGRQBSKM166N
  parent_id: null
  user_id: null
or
event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0300
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 768
  command: move_to_color_temp
  args:
    - 181
    - 3
    - 0
    - 0
  params:
    color_temp_mireds: 181
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:22:08.047968+00:00"
context:
  id: 01GQ38QJDFC6XZ9CNJHMASJWZF
  parent_id: null
  user_id: null
or
event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0300
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 768
  command: move_to_color_temp
  args:
    - 153
    - 3
    - 0
    - 0
  params:
    color_temp_mireds: 153
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:22:24.233213+00:00"
context:
  id: 01GQ38R2799ECVSG6VJBWGVRE7
  parent_id: null
  user_id: null

etc. with the first arg changing to some other numbers.

The 4th button generates two events (usually) one for itself, and one related to the 3rd button.
For example, these are two events that fire when pressing the 4th button:

event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0008
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 8
  command: move_to_level_with_on_off
  args:
    - 254
    - 0
  params:
    level: 254
    transition_time: 0
origin: LOCAL
time_fired: "2023-01-18T20:24:07.203613+00:00"
context:
  id: 01GQ38V6S3QM5AYXH6AFZZRG6R
  parent_id: null
  user_id: null

and

event_type: zha_event
data:
  device_ieee: cc:cc:cc:ff:fe:a3:2d:f6
  unique_id: cc:cc:cc:ff:fe:a3:2d:f6:1:0x0300
  device_id: cd069fba8bdd70244147b8cf1c5ab3ec
  endpoint_id: 1
  cluster_id: 768
  command: move_to_color_temp
  args:
    - 222
    - 3
    - 0
    - 0
  params:
    color_temp_mireds: 222
    transition_time: 3
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2023-01-18T20:24:07.234171+00:00"
context:
  id: 01GQ38V6T2AV9YNH3PPFYXTVP6
  parent_id: null
  user_id: null

Hi @xaviml !

I have an alarm remote control (Heiman or same others models) that under ZHA sends the same event 4 times… (per button)
image

Under ZHA it is seen as an AlarmControlPanel while under Z2M it works normally. But I have to do this with ZHA.

In short, would you know how to process only one of the 4 events?

Merci !

event_type: zha_event
data:
  device_ieee: a4:c1:38:96:0b:cz:c9:66
  unique_id: a4:c1:38:96:0b:cz:c9:66:1:0x0501
  device_id: 5a4b1548c7ac148312de79c671276233
  endpoint_id: 1
  cluster_id: 1281
  command: arm
  args:
    arm_mode: 0
    arm_mode_description: Disarm
    code: ""
    zone_id: 0
  params: {}

Hi @coolspot18 ,

First time I see this error, and the configuration looks fine to me. Could you please do the following:

  • Restart the AppDaemon addon, and Home Assistant.
  • Try again, and see if the error persists.

If the error still persists, I have some questions:

  • Are there any other configurations not working?
  • Could you please share the full log of AppDaemon (after restart + error shown in here).
  • Have you changed anything from appdaemon.yaml? Could you share that file. Make sure to remove sensitive information such as latitude and longitude.

Regards,
Xavi M.