ControllerX. Bring full functionality to light and media player controllers

Hi @Maksim-us ,

It seems that the mapping does not correspond the one from the documentation: HueDimmer - ControllerX

Would you mind confirming that? Could you also check which firmware version you have for this controller? ZHA changes their mappings quite often and we have to change the mappings on those controllers.

In the meantime, you should be able to have a working controller using the mapping attribute and mapping the actions yourself:

example_app:
  module: controllerx
  class: HueDimmerController
  integration: zha
  controller: 00:11:22:33:44:55:66:77:88
  light: light.my_entity_id
  mapping:
    "on": "on"
    move_to_level: click_brightness_up
    move_to_color_temp: click_brightness_down
    move_to_level_with_on_off: "off"

However, I did not see the triggered actions when you hold the buttons, but you can fill in the mapping section with the missing command actions.

Regards,
Xavi M.

Hi @Canaletto,

Is the same event sent when you press the 4 buttons (including the args)?

In any case, you could use the Event integration:

example_app:
  module: controllerx
  class: LightController
  controller: "a4:c1:38:96:0b:cz:c9:66:1:0x0501" # This is the value we listen from `controller_key` defined below.
  light: light.my_light
  integration:
    name: event # This name is necessary
    event_type: zha_event
    controller_key: unique_id
    action_template: "{command}_{args[arm_mode]}_{args[zone_id]}"
  mapping:
    arm_0_0: toggle

This is just an example to show how the Event integration works by listening to zha_event and creating an custom action template with the command, the arm_mode and the zone_id. Then, you can use the mapping using the rule defined above, which in this case toggles a light. If each button has a different attribute (endpoint_id, cluster_id, etc), then you can put on the action_template, and add the action in the mapping.

Hope this answers your question.

Regards,
Xavi M.

I am not sure what you mean by " does not correspond the one from the documentation: HueDimmer - ControllerX", as I am trying to set up the MLI404002.

Thank you.

Hi @Maksim-us ,

Sorry, I misunderstood your controller since in your first message you said “…One setup that I had was when I would press the “on” button on the hue switch …”.

In any case, my question is the same: Could you also check which firmware version you have for this controller? Is it in the latest firmware?.

Also, my recommendation still stands:

example_app:
  module: controllerx
  class: MLI404002LightController
  integration: zha
  controller: 00:11:22:33:44:55:66:77:88
  light: light.my_entity_id
  mapping:
    "on": "on"
    move_to_level: click_brightness_up
    move_to_color_temp: click_brightness_down
    move_to_level_with_on_off: "off"

Regards,
Xavi M.

Hello @xaviml

Yes I had done that and it works, but it generates several ident commands.

The messages are of course different on the 4 buttons.

But for each button pressed we receive several identical events.

My question was rather to find a solution not to treat the following events if they are identical to the first one received (in a short time) …

Thanks for your help :wink:

1 Like

Hello,

I use controllerX for simple Philips hue remote for on/of in- decrease brightness en change colortemp.
Now i’m looking for a setup to control my Wled ledstrip with a Ikea E1810 or E2002. The functions i would use are: On/of, in-decrease brightness, next color, next FX, stop FX. maybe if it possible Previous color and previous FX would be nice.
Is this possible with ControllerX?
If yes what would be the service calls or codes? Hopefully someone can help me.

Thanks a lot for the awesome app.

Hi @Denman2103 ,

By just having the default mapping from E2002, you get everything you listed except the FX options. The FX cycle is a tricky one, it is even something that I have not seen anyone do on Home Assistant. What I have seen and you can configure with ControllerX is to get a random effect. For example, you can have the default mapping + double click right to get a random effect and double click left to “stop” FX (back to solid):

example_app:
  module: controllerx
  class: E2002LightController
  controller: sensor.controller_action
  integration: z2m
  light: light.wled
  merge_mapping:
    arrow_left_click$2:
      action: "on"
      attributes:
        effect: Solid
    arrow_right_click$2:
      action: "on"
      attributes:
        effect: "{{ state_attr('light.bathroom_wled', 'effect_list') | random }}"

If you have a script or a way to cycle through the effects, you can change the merge_mapping part. Note that if you remove the merge_mapping part you will get everything you listed except the FX.

Regards,
Xavi M.

Hi @xaviml
Thank you for the response. That would be awesome and easy to use.
For the FX i think Random would be fine. Another idea i had was to make an input selector with different effects and scroll true the selector, but i don’t know how that will work out.

Hi @Denman2103 ,

Having an input select to choose from a few of the effects will work out. In this new section of the documentation it is explained how to use the input select together with ControllerX.

https://controllerx.netlify.app/controllerx/advanced/stateful-controllers/

I will gove you a configuration example later on how I would do it.

Regards,
Xavi M.

Hi @xaviml ,

Edit: Nevermind! I managed to solve it by using the MQTT action config:

light_kitchen_cupboard_underlight:
  module: controllerx
  class: E1743Z2MLightController
  controller: gf_kitchen_cupboard-underlight_switch
  integration:
    name: z2m
    listen_to: mqtt
    action_key: action
  light: light_gf_kitchen_cupboard-underlight

End Edit

Thanks for reaching out. As I couldn’t get my Gledopto LED controller to work with AppDaemon and it also had issues with fulfilling the ZigBee standard, I switched to a MiBoxer FUT035Z. I tried to configure the AppDaemon App, but again I fail at finding the controller Name/ID.

After pairing Z2M shows me following exposed attributes: battery, action, linkquality
I also see action state switching to: on, off, brightness_move_up, brightness_move_down, brightness_stop
This looks fine to me.

When I follow your instructions and go to Settings → Devices / Services → MQTT → Devices, filter for underlight in the listed devices and open the TRADFRI ON/OFF switch (E1743) / gf_kitchen_cupboard-underlight_switch, I only get following entities listed:

  • gf_kitchen_cupboard-underlight_switch_battery
  • binary_sensor.gf_kitchen_cupboard_underlight_switch_update_available
  • sensor.gf_kitchen_cupboard_underlight_switch_linkquality
  • sensor.gf_kitchen_cupboard_underlight_switch_update_state

But no entity with the postfix: _action

When I try following App config:

light_kitchen_cupboard_underlight:
  module: controllerx
  class: E1743Z2MLightController
  controller: sensor.gf_kitchen_cupboard_underlight_switch_action
  integration: z2m
  light: light_gf_kitchen_cupboard-underlight

I get following error message, confirming the entity doesn’t exist:

2023-02-01 13:54:48.716038 INFO light_kitchen_cupboard_underlight: 🎮 ControllerX v4.23.0
2023-02-01 13:54:48.717191 WARNING light_kitchen_cupboard_underlight: E1743 MQTT setup
2023-02-01 13:54:48.722175 WARNING light_kitchen_cupboard_underlight: light_kitchen_cupboard_underlight: Entity sensor.gf_kitchen_cupboard_underlight_switch_action not found in namespace default

This config:

light_kitchen_cupboard_underlight:
  module: controllerx
  class: E1743Z2MLightController
  controller: gf_kitchen_cupboard-underlight_switch # removed sensor. and _action
  integration: z2m
  light: light_gf_kitchen_cupboard-underlight

givesfollowing output:

2023-02-01 14:00:40.846691 INFO AppDaemon: Initializing app light_kitchen_cupboard_underlight using class E1743Z2MLightController from module controllerx
2023-02-01 14:00:40.848622 INFO light_kitchen_cupboard_underlight: 🎮 ControllerX v4.23.0
2023-02-01 14:00:40.849800 WARNING light_kitchen_cupboard_underlight: E1743 MQTT setup

What is this WARNING for?

But pressing the E1743 buttons doesn’t change the state of the light_gf_kitchen_cupboard-underlight
I also don’t see any log entries in AppDaemon logs. Don’t know, if this is working as intended.

Is there something wrong with my HA setup that causes the _action entity to not show up?

1 Like

Hi @xaviml,
If you’re talking about Zigbee controller, it is on the latest version.
I have tried a different configuration, and can get some of the buttons to respond. As you can see in the logs, the buttons send information beyond the “command” (the args/params). Can those be used in the ControllerX? Like setting a specific brightness or color temp based on the args/params?
The biggest issue is that the last button send two commands at the same time and I am, not sure if taht can be dealt with.

Thank you.

Hi @xaviml,
first of all: great work on Controllerx, using it for some Hue Dimmer switches and working great!

Now I try to add some FoH switches based on the PTM215Z, and added them in the config according to the documentation for Zigbee2MQTT (HA entity).
When restarting AppDeamon I get the following error message, wondering if I made some kind of mistake: “Querying a specific attribute is only possible for a single entity".format(name))”.

Is this a known error and what could I do to solve it (besides RTFM), I did search and read lots of articles but not found solution yet.

Thanks in advance for your support,
Alex

more info from logging which might be helpfull:

  File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 163, in initialize_app
    await init()
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 104, in initialize
    await self.init()
  File "/config/appdaemon/apps/controllerx/cx_core/type/light_controller.py", line 146, in init
    await super().init()
  File "/config/appdaemon/apps/controllerx/cx_core/type_controller.py", line 57, in init
    self.entity = await self._get_entity(self.args[self.entity_arg])
  File "/config/appdaemon/apps/controllerx/cx_core/type_controller.py", line 100, in _get_entity
    entities = await self._get_entities(entity_name) if self.domains else None
  File "/config/appdaemon/apps/controllerx/cx_core/type_controller.py", line 73, in _get_entities
    entities: Optional[Union[str, List[str]]] = await self.get_state(
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 375, in get_state
    return await super().get_state(
  File "/usr/lib/python3.10/site-packages/appdaemon/adapi.py", line 1511, in get_state
    return await self.get_entity_api(namespace, entity_id).get_state(attribute, default, copy, **kwargs)
  File "/usr/lib/python3.10/site-packages/appdaemon/entity.py", line 149, in get_state
    return await self.AD.state.get_state(self.name, namespace, entity_id, attribute, default, copy)
  File "/usr/lib/python3.10/site-packages/appdaemon/state.py", line 500, in get_state
    raise ValueError("{}: Querying a specific attribute is only possible for a single entity".format(name))
ValueError: FoH_Gira_1: Querying a specific attribute is only possible for a single entity

Hi All,

After long time I came back to Home Assistant Project. I am trying to move my Ikea devices from Ikea hub to my Zigbee stick. I have 5 button remote controller E1524 and is not fully working with controllerX.
Config:

living_room_floor_lamp_remote:
  module: controllerx
  class: E1810Controller
  controller: 90:fd:9f:ff:fe:e3:55:84
  integration: zha
  light: light.living_room_floor_lamp

On/off and brightness buttons are working correctly. Left/right button doesn’t work.
I believe E1810 is similar to E1524.
Also if I do not use controllerX but some blueprints instead doesn’t work as well.
Looks like HA is not receiving any data when those buttons are pressed.
I do not know how to even check this.
Any help?

I don’t know ZHA, but as stated on this documentation page for ControllerX. https://xaviml.github.io/controllerx/start/integrations/
ZHA is using “zha_event”.
You simply go to Developer/Events. There you have to input “zha_event” into “Listen to events” (I hope this is the correct name, as I am using German) and press “Start to Listen”.
Then you have to press your buttons and you can see the Events coming in.

1 Like

Thanks.
When I am pressing on/off or brightness up/down I am getting some events. When I am pressing left/right button I am not getting anything :frowning:

Oh, that can be a little problem I had long time ago (must be in this thread).
The solution is really simple: Just take the battery out and in again. Then it should work.

Unfortunately did not help. New battery did not help. Reset and pair did not help as well.

those buttons (left/right) in my case with zha and CC2531 dongle don’t work. When I swap to zigbee2mqtt all working fine.
I do not know why. It should be compatible with zha as well.
Also I have Aqara D1 switch with neutral double rocker and on zha I have only 2 switches available on/off. When I swap to zigbee2mqtt also actions are available and power monitor. Regarding zigbee2mqtt website there should be 3 action available single double and hold. In my case hold is missing.

Hi

I have had a terrible time with a rogue lightbulb that was constantly flashing. Google this time didnt help me and I have had to delete everything after flashing my conbee 2 stick as none of my lights were working. Alas I am starting again but trying to restore my controllerx config.

After almost typing that I couldnt get appdaemon to work with the controllers I finally saw in my config where I was going wrong. I can get the controllers to work now. However, I dont seem to be able to cycle through the different colours which is odd. Toggle on and off work, as does brighness up and down. I have only used the merge mapping as you will see from my config:

office_controller_test:
  module: controllerx
  class: E1810Z2MLightController
  integration: 
    name: z2m
    listen_to: mqtt
  controller: 1st Floor Office Testing Controller
  light: 
    name: 1st Floor Office Light
    mode: mqtt
  merge_mapping:
    toggle$2:
      service: scene.turn_on
      data:
        entity_id: scene.office_warm_white
  
office_controller2:
  module: controllerx
  class: E2002Z2MLightController
  integration: 
    name: z2m
    listen_to: mqtt
  controller: 1st Floor Office Remote  
  light: 
    name: 1st Floor Office Light
    mode: mqtt
  merge_mapping:
    arrow_left_click$2:
      service: scene.turn_on
      data:
        entity_id: scene.office_warm_white

I have seen in zigbee2mqtt I am getting these error messages which I dont really understand. The bulb is a tradfri colour bulb and was fine switching through the colours before:

Debug 2023-02-19 01:59:02Received Zigbee message from '1st Floor Office Testing Controller', type 'commandTradfriArrowSingle', cluster 'genScenes', data '{"value":256,"value2":13}' from endpoint 1 with groupID null
Info 2023-02-19 01:59:02MQTT publish: topic 'zigbee2mqtt/1st Floor Office Testing Controller', payload '{"action":"arrow_right_click","battery":40,"linkquality":255,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"},"update_available":false}'
Info 2023-02-19 01:59:02MQTT publish: topic 'zigbee2mqtt/1st Floor Office Testing Controller', payload '{"action":"","battery":40,"linkquality":255,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"},"update_available":false}'
Info 2023-02-19 01:59:02MQTT publish: topic 'zigbee2mqtt/1st Floor Office Testing Controller/action', payload 'arrow_right_click'
Debug 2023-02-19 01:59:02Received MQTT message on 'zigbee2mqtt/1st Floor Office Light/set' with data '{"color_temp_step": 70, "transition": 0.5}'
Debug 2023-02-19 01:59:02Publishing 'set' 'color_temp_step' to '1st Floor Office Light'
Debug 2023-02-19 01:59:03Received Zigbee message from '1st Floor Office Light', type 'readResponse', cluster 'lightingColorCtrl', data '{}' from endpoint 1 with groupID null
Error 2023-02-19 01:59:03Exception while calling fromZigbee converter: Cannot read properties of undefined (reading 'hasOwnProperty')}
Debug 2023-02-19 01:59:03TypeError: Cannot read properties of undefined (reading 'hasOwnProperty') at Function.fromObject (/app/node_modules/zigbee-herdsman-converters/lib/color.js:218:17) at Function.fromMireds (/app/node_modules/zigbee-herdsman-converters/lib/color.js:231:24) at Object.syncColorState (/app/node_modules/zigbee-herdsman-converters/lib/color.js:761:32) at Object.convert (/app/node_modules/zigbee-herdsman-converters/converters/fromZigbee.js:645:51) at Receive.onDeviceMessage (/app/lib/extension/receive.ts:143:51) at EventEmitter.emit (node:events:525:35) at EventBus.emitDeviceMessage (/app/lib/eventBus.ts:102:22) at Controller.<anonymous> (/app/lib/zigbee.ts:106:27) at Controller.emit (node:events:513:28) at Controller.selfAndDeviceEmit (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:515:14)
Error 2023-02-19 01:59:03Publish 'set' 'color_temp_step' to '1st Floor Office Light' failed: 'Error: Read 0xbc33acfffe83df06/1 lightingColorCtrl(["colorTemperature"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'
Debug 2023-02-19 01:59:03Error: Read 0xbc33acfffe83df06/1 lightingColorCtrl(["colorTemperature"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:317:28) at Endpoint.read (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:480:22) at Object.convertSet (/app/node_modules/zigbee-herdsman-converters/converters/toZigbee.js:731:17) at Publish.onMQTTMessage (/app/lib/extension/publish.ts:246:36)
Info 2023-02-19 01:59:03MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Publish 'set' 'color_temp_step' to '1st Floor Office Light' failed: 'Error: Read 0xbc33acfffe83df06/1 lightingColorCtrl([\"colorTemperature\"], {\"sendWhen\":\"immediate\",\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":null,\"transactionSequenceNumber\":null,\"writeUndiv\":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'","meta":{"friendly_name":"1st Floor Office Light"},"type":"zigbee_publish_error"}'
Debug 2023-02-19 01:59:03Publishing 'set' 'transition' to '1st Floor Office Light'

I can set the colour manually through zigbee2mqtt and I can turn it on, off, set the scene using the configured script. The not being able to scroll through the colours is most bizarre and really annoying!

Im hoping I have done something dumb here but would appreciate any help anyone can give me.

Im using the following versions:

ControllerX: 4.25.0
Zigbee2MQTT: 1.30.1
Mosquito Broker: 6.1.3
Appdaemon: 0.11.0
Home Assistant: 2023.2.5

Cheers

Phill

I have a 1812 controlling my lights group.
It always worked fine, but lately i noticed that dimming isn’t working anymore.
I update z2m to latest version, maybe that caused this?
On and off is working fine

I can see the dimming function inside z2m