ControllerX. Bring full functionality to light and media player controllers

gang:
  module: controllerx
  class: E1812LightController
  controller: tradfri_shortcut_1
  integration: deconz
  light: light.gang_bei_kuche_1
  merge_mapping:
    1002:
      action: toggle
      attributes:
        brightness: 200
  - entity_id: light.gang_bei_kuche_1
2021-08-29 22:12:29.702283 INFO gang: 🎮 Button event triggered: `1002`
2021-08-29 22:12:29.713400 INFO gang: 🏃 Running `Predefined (toggle)` now
2021-08-29 22:12:29.727263 INFO gang: 
🤖 Service: light.toggle
  - entity_id: light.gang_bei_kuche_1
2021-08-29 22:12:31.964376 INFO gang: 🎮 Button event triggered: `1002`
2021-08-29 22:12:31.974184 INFO gang: 🏃 Running `Predefined (toggle)` now
2021-08-29 22:12:31.993204 INFO gang: 
🤖 Service: light.toggle
  - entity_id: light.gang_bei_kuche_1

The brightness goes up to about 10 %. I tried it with a single lightsource instead of the grouped. Same result.

It seems like it only toggles on and off.

When restarting AppDaemon, which ControllerX version you see in the logs?

A question about Hue Dimmer in deCONZ.

apps.yaml

dimmer_bryggers_X1:
  module: controllerx
  class: HueDimmerController
  controller: bryggers_switch_01
  integration: deconz
  light: light.extended_color_light_3_2
  mapping:
    1002:
      service:  scene.turn_on
      data:
        scene: fitness_fuldtlys
    1004:
      service:  scene.turn_on
      data:
        scene: fitness_lavtlys
    1005:
      service:  scene.turn_on
      data:
        scene: fitness_rødtlys
    4000:
      "off"

Is the above in some way possible with the HUE Dimmer ?

Scenes defined in configuration.yaml like this:

input_select:
  bryggersscener:
    name: Scener for Bryggers Lys
    options:
      - scene.bryggers_fuldtlys
      - scene.bryggers_halvtlys
      - scene.bryggers_lavtlys
      - scene.bryggers_natlys
  fitnessscener:
    name: Scener for Fitness Lys
    options:
      - fitness_blåhvidtlys
      - fitness_blåtlys
      - fitness_fuldtlys
      - fitness_grøntlys
      - fitness_gultlys
      - fitness_halvtlys
      - fitness_lavtlys
      - fitness_natlys
      - fitness_rødtlys

Been trying out different combinations to get to some way of getting the HUE Dimmer to turn on the light on and for x number of clicks on the ON button switch between predefined scenes.

Logfile of Appdaemon:

2021-08-30 16:16:46.460668 INFO dimmer_bryggers_X1: 🎮 Button event triggered: `1003`
2021-08-30 16:16:46.467608 INFO dimmer_bryggers_X1: 🏃 Running `Service (scene.turn_on)` now
2021-08-30 16:16:46.473601 INFO dimmer_bryggers_X1: 
🤖 Service: scene.turn_on
  - scene: scene.fitness_fuldtlys
2021-08-30 16:16:46.501421 WARNING HASS: Error calling Home Assistant service default/scene/turn_on
2021-08-30 16:16:46.502879 WARNING HASS: Code: 400, error: 400: Bad Request

Another thing: Seems like a page is missing on the site.
https://xaviml.github.io/controllerx/others/custom-controllers reports 404.

Running latest version of everything,
no errors in HA,
all lights/scenes tested manually as working OK :slight_smile:
Best regards and thanks for the great work you do!

2021-08-30 17:48:29.227386 INFO AppDaemon: AppDaemon Version 4.1.0 starting
2021-08-30 17:48:29.229277 INFO AppDaemon: Python version is 3.9.5
2021-08-30 17:48:29.230972 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2021-08-30 17:48:29.232488 INFO AppDaemon: Added log: AppDaemon
2021-08-30 17:48:29.234250 INFO AppDaemon: Added log: Error
2021-08-30 17:48:29.236214 INFO AppDaemon: Added log: Access
2021-08-30 17:48:29.236579 INFO AppDaemon: Added log: Diag
2021-08-30 17:48:29.281142 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2021-08-30 17:48:29.376234 INFO HASS: HASS Plugin Initializing
2021-08-30 17:48:29.377986 INFO HASS: HASS Plugin initialization complete
2021-08-30 17:48:29.380204 INFO AppDaemon: Initializing HTTP
2021-08-30 17:48:29.382670 INFO AppDaemon: Using 'ws' for event stream
2021-08-30 17:48:29.391002 INFO AppDaemon: Starting API
2021-08-30 17:48:29.399268 INFO AppDaemon: Starting Old Admin Interface
2021-08-30 17:48:29.401656 INFO AppDaemon: Starting Dashboards
2021-08-30 17:48:29.451967 INFO HASS: Connected to Home Assistant 2021.8.8
2021-08-30 17:48:29.569082 INFO AppDaemon: App 'tradfri_wohnzimmer' added
2021-08-30 17:48:29.580167 INFO AppDaemon: App 'tradfri_kueche' added
2021-08-30 17:48:29.589074 INFO AppDaemon: App 'symfonisk_wohnzimmer' added
2021-08-30 17:48:29.597391 INFO AppDaemon: App 'symfonisk_kueche' added
2021-08-30 17:48:29.602599 INFO AppDaemon: App 'gang' added
2021-08-30 17:48:29.608130 INFO AppDaemon: Found 5 total apps
2021-08-30 17:48:29.611859 INFO AppDaemon: Starting Apps with 5 workers and 5 pins
2021-08-30 17:48:29.624447 INFO AppDaemon: Running on port 5050
2021-08-30 17:48:29.694084 INFO HASS: Evaluating startup conditions
2021-08-30 17:48:29.742165 INFO HASS: Startup condition met: hass state=RUNNING
2021-08-30 17:48:29.744537 INFO HASS: All startup conditions met
2021-08-30 17:48:29.816522 INFO AppDaemon: Got initial state from namespace default
2021-08-30 17:48:31.711911 INFO AppDaemon: Scheduler running in realtime
2021-08-30 17:48:31.723902 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2021-08-30 17:48:31.726437 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2021-08-30 17:48:31.728441 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core to module import path
2021-08-30 17:48:31.730560 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/type to module import path
2021-08-30 17:48:31.732958 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/feature_support to module import path
2021-08-30 17:48:31.735144 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/action_type to module import path
2021-08-30 17:48:31.737131 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/integration to module import path
2021-08-30 17:48:31.739136 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/stepper to module import path
2021-08-30 17:48:31.743930 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_devices to module import path
2021-08-30 17:48:31.839156 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2021-08-30 17:48:31.845066 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2021-08-30 17:48:31.946107 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_const.py - ignoring
2021-08-30 17:48:31.949884 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_version.py - ignoring
2021-08-30 17:48:31.952963 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/controller.py - ignoring
2021-08-30 17:48:31.956335 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type_controller.py - ignoring
2021-08-30 17:48:31.960004 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/release_hold_controller.py - ignoring
2021-08-30 17:48:31.964042 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/__init__.py - ignoring
2021-08-30 17:48:31.967834 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/custom_controller.py - ignoring
2021-08-30 17:48:31.971040 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/color_helper.py - ignoring
2021-08-30 17:48:31.974153 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/light_controller.py - ignoring
2021-08-30 17:48:31.977392 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py - ignoring
2021-08-30 17:48:31.981286 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py - ignoring
2021-08-30 17:48:31.984446 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/__init__.py - ignoring
2021-08-30 17:48:31.987976 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/cover_controller.py - ignoring
2021-08-30 17:48:31.991070 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/light.py - ignoring
2021-08-30 17:48:31.994188 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/media_player.py - ignoring
2021-08-30 17:48:31.997449 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/cover.py - ignoring
2021-08-30 17:48:32.005160 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py - ignoring
2021-08-30 17:48:32.011502 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/delay_action_type.py - ignoring
2021-08-30 17:48:32.027840 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/scene_action_type.py - ignoring
2021-08-30 17:48:32.043129 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py - ignoring
2021-08-30 17:48:32.045471 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/base.py - ignoring
2021-08-30 17:48:32.051631 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/call_service_action_type.py - ignoring
2021-08-30 17:48:32.056605 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/__init__.py - ignoring
2021-08-30 17:48:32.062969 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/state.py - ignoring
2021-08-30 17:48:32.067735 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/zha.py - ignoring
2021-08-30 17:48:32.072407 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/deconz.py - ignoring
2021-08-30 17:48:32.095523 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/z2m.py - ignoring
2021-08-30 17:48:32.106837 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/__init__.py - ignoring
2021-08-30 17:48:32.113634 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/lutron_caseta.py - ignoring
2021-08-30 17:48:32.122610 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/mqtt.py - ignoring
2021-08-30 17:48:32.132084 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/minmax_stepper.py - ignoring
2021-08-30 17:48:32.135077 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/circular_stepper.py - ignoring
2021-08-30 17:48:32.142919 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/__init__.py - ignoring
2021-08-30 17:48:32.146373 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/legrand.py - ignoring
2021-08-30 17:48:32.149623 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/trust.py - ignoring
2021-08-30 17:48:32.152651 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/osram.py - ignoring
2021-08-30 17:48:32.156047 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aurora.py - ignoring
2021-08-30 17:48:32.159912 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/ikea.py - ignoring
2021-08-30 17:48:32.163817 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/terncy.py - ignoring
2021-08-30 17:48:32.167383 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/rgb_genie.py - ignoring
2021-08-30 17:48:32.170664 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/lutron.py - ignoring
2021-08-30 17:48:32.173742 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aqara.py - ignoring
2021-08-30 17:48:32.177208 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/muller_licht.py - ignoring
2021-08-30 17:48:32.180708 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/sonoff.py - ignoring
2021-08-30 17:48:32.184697 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/phillips.py - ignoring
2021-08-30 17:48:32.188079 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/__init__.py - ignoring
2021-08-30 17:48:32.192238 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/tuya.py - ignoring
2021-08-30 17:48:32.195810 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/livarno.py - ignoring
2021-08-30 17:48:32.199054 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/smartthings.py - ignoring
2021-08-30 17:48:32.202079 INFO AppDaemon: Initializing app tradfri_wohnzimmer using class E1810MediaPlayerController from module controllerx
2021-08-30 17:48:32.207719 INFO AppDaemon: Initializing app tradfri_kueche using class E1810MediaPlayerController from module controllerx
2021-08-30 17:48:32.213542 INFO AppDaemon: Initializing app symfonisk_wohnzimmer using class E1744MediaPlayerController from module controllerx
2021-08-30 17:48:32.219101 INFO AppDaemon: Initializing app symfonisk_kueche using class E1744MediaPlayerController from module controllerx
2021-08-30 17:48:32.224348 INFO AppDaemon: Initializing app gang using class E1812LightController from module controllerx
2021-08-30 17:48:32.469394 INFO tradfri_wohnzimmer: 🎮 ControllerX v4.12.0
2021-08-30 17:48:32.530633 INFO tradfri_kueche: 🎮 ControllerX v4.12.0
2021-08-30 17:48:32.614239 INFO symfonisk_wohnzimmer: 🎮 ControllerX v4.12.0
2021-08-30 17:48:32.701252 INFO symfonisk_kueche: 🎮 ControllerX v4.12.0
2021-08-30 17:48:32.787082 INFO gang: 🎮 ControllerX v4.12.0
2021-08-30 17:48:32.843354 INFO AppDaemon: App initialization complete

Thank you, I selected the first option to try with the Hue Dimmer, a little bit of fiddling and teaching myself a bit more about input_select and hey presto - it works.

I’d love to do it with multiple clicks, how would you implement that using the HueDimmerController class? I don’t quite understand the instructions in the link you shared. Thanks again, J

Hi @Jano1959,

The problem with your configuration is that you are passing the wrong data to the service. You can check in Home Assistant > Developer Tools > Services the attributes for scene.turn_on. The scene should be passed as entity_id, and not scene. Also, you should pass the whole entity ID, so scene.bryggers_fuldtlys for example. So your configuration should look like:

dimmer_bryggers_X1:
  module: controllerx
  class: HueDimmerController
  controller: bryggers_switch_01
  integration: deconz
  light: light.extended_color_light_3_2
  mapping:
    1002:
      service:  scene.turn_on
      data:
        entity_id: scene.fitness_fuldtlys
    1004:
      service:  scene.turn_on
      data:
        entity_id: scene.fitness_lavtlys
    1005:
      service:  scene.turn_on
      data:
        entity_id: scene.fitness_rødtlys
    4000:
      "off"

Also, you can use the scene action from ControllerX and reduce to configuration to:

dimmer_bryggers_X1:
  module: controllerx
  class: HueDimmerController
  controller: bryggers_switch_01
  integration: deconz
  light: light.extended_color_light_3_2
  mapping:
    1002:
      scene:  scene.your_scene_1
    1004:
      scene:  scene.your_scene_2
    1005:
      scene:  scene.your_scene_3
    4000:
      "off"

Normally this error “Code: 400, error: 400: Bad Request” means that the request to HA has not been processed correctly. In this case is because the parameters was not passed properly or the scene does not exists in HA.

This is my current configuration for the light in my bathroom attached to a sensor and controlled via ControllerX with Callback constraints from AppDaemon. You can see how I use the scene action in here.

bathroom_day:
  module: controllerx
  class: LightController
  controller: binary_sensor.bathroom_sensor_occupancy
  integration: state
  light: light.bathroom_wled
  mapping:
    "on":
      scene: scene.bathroom_light_day
    "off": "off"
  constrain_start_time: "07:30:00"
  constrain_end_time: "23:00:00"

bathroom_night:
  module: controllerx
  class: LightController
  controller: binary_sensor.bathroom_sensor_occupancy
  integration: state
  light: light.bathroom_wled
  mapping:
    "on":
      scene: scene.bathroom_light_night
    "off": "off"
  constrain_start_time: "23:00:00"
  constrain_end_time: "07:30:00"

Not sure where you got the link from, but this page was moved to the advanced section. You can find it here: https://xaviml.github.io/controllerx/advanced/custom-controllers Sorry for the inconvenience.

Regards,
Xavi M.

1 Like

Hi @flirtysanchez,

This configuration is valid from ControllerX v4.14.0. You are currently using v4.12.0. If you update ControllerX and restart AppDaemon, you will get your problem fixed. However, if you don’t to upgrade, here you have another way to achieve the same:

gang:
  module: controllerx
  class: E1812LightController
  controller: tradfri_shortcut_1
  integration: deconz
  light: light.gang_bei_kuche_1
  merge_mapping:
    1002:
      service: light.toogle
      data:
        brightness: 200

Regards,
Xavi M.

Hi @jastan1971,

This would be an example of achieving the same with double click on the “on” button:

example_app:
  module: controllerx
  class: HueDimmerController
  controller: sensor.my_controller_action
  integration: z2m
  light: light.my_light
  merge_mapping:
    on-press$2:
      - service: input_select.select_next
        data:
          entity_id: input_select.scenes
      - scene: "{{ states('input_select.scenes') }}"

It’s as easy as adding $ and the number of clicks you want. Additionally, you might need to add multiple_click_delay to the configuration if the double click does not work properly.

Also, in case of working with z2m and wanting to use the multiclick functionality, then you need to make sure to remove from the device-specific (devices.yaml) the multiple_press_timeout option in Zigbee2MQTT configuration. Not sure if this is still needed, but I have this in the documentation.

I have a similar configuration for my Hue Dimmer switch from the bedroom with deCONZ to turn off the livingroom lamp with a double click:

bedroom:
  module: controllerx
  class: HueDimmerController
  controller: bedroom_controller
  integration: deconz
  light: light.bedroom
  merge_mapping:
    1002$2:
      service: light.toggle
      entity_id: light.livingroom_lamp

Also, I recommend you now to read the multi-click documentation I shared earlier since it explains better how it works and you can see some examples in there with explanations.

Regards,
Xavi M.

Thanks alot for the great answers!

Got it almost working now, but maybe the HUE Dimmer does not support multiple clicks,
I can’t seem to get it to report with 1004,1005… when trying multiple clicks on it,
Only 1000-1003, seems to work (when looking inside appdaemon log) same for the other buttons on the HUE Dimmer I got.
I used your code above with my scenes.

Tried something like this as well without succes’.

  merge_mapping:
    toggle$2:
      service: light.toggle
      data:
        entity_id: light.livingroom_fairylights
    toggle$3:
      service: light.toggle
      data:
        entity_id: light.bedroom

Your work is NO inconvenience, I am grateful for good folks like you :raised_hands:

Btw. thanks for the tip for the bathroom ligthing, fits right in here in my move away from Philips HUE bridge over to deCONZ only.

Oh it does support multiple clicks, that is what I am using it for.

Can you post the code you tried? I am assuming you are using Deconz?

This is mine, using ZHA:

hall_controller:
  module: controllerx
  class: HueDimmerController
  controller: 00:17:88:01:04:e5:33:4a
  integration: zha
  light: light.hall_pendant
  manual_steps: 5
  mapping:
    on_short_release: toggle_full_brightness
    on_short_release$2: set_half_brightness
    off_short_release: "off"
    up_short_release: click_brightness_up
    down_short_release: click_brightness_down
    up_hold: hold_brightness_up
    down_hold: hold_brightness_down
1 Like

Hi @Jano1959,

The multiple click functionality is something from ControllerX. It virtually recognizes multiple clicks even if the device does not support them. You can read more about it here.

If you are using deCONZ, you should use the deCONZ events (1002, 1001, etc…) and not toggle as you are trying to use in the configuration you pasted:

merge_mapping:
  1002$2:
    service: light.toggle
    data:
      entity_id: light.livingroom_fairylights
  1002$3:
    service: light.toggle
    data:
      entity_id: light.bedroom

You can check the deCONZ mapping in the deCONZ section of the controller in the documentation: https://xaviml.github.io/controllerx/controllers/324131092621

If 3 clicks is too much and it does not respond properly, you can use double click for the off button (4002$2). Basically, you need to put the event first, then $, and finally the number of clicks. The rest will be handled by ControllerX to check if it was 2, 3, 4, 10, or 20 clicks in a row.

Finally, you can change multiple_click_delay (default is 500ms) to define when to detect multiple clicks. So if you have problems detecting the multiple clicks, you will need to make that delay higher (700 or 1000 for example). However, if you use a high number, for example, 4000ms, it will take 4 seconds to execute the command you want because ControllerX will wait for 4s every click to know if there is another click coming.

As I showed to @jastan1971, this is my configuration for my HUE dimmer with deCONZ (like your setup):

bedroom:
  module: controllerx
  class: HueDimmerController
  controller: bedroom_controller
  integration: deconz
  light: light.bedroom
  merge_mapping:
    1002$2:
      service: light.toggle
      entity_id: light.livingroom_lamp

This will use the default mapping of this controller and it will add this double click action to my controller to toggle my living room light from my bedroom.

Hope this helps you understand how it works.

Regards,
Xavi M.

Think I finally managed to get my head around it an read your documentation about the “event” codes from the remote I have :wink: There was no 1004,1005… silly me!

So when I got it working with your latest input, I went back to try out the scenes and selectnext.
Could not get it to work, but when I read the log files I figured out there was a missing scene. in the command.
So I now have it working in perfectly order like this, I had to change the cut´n´paste from another post of yours with the added scene. . That solved my challenge with the “400 bad request”
Again my error, could have added scene. to the lines in configuration.yaml.

    1002$2:
      - service: input_select.select_next
        data:
          entity_id: input_select.fitnessscener
      - scene: "**scene.**{{ states('input_select.fitnessscener') }}"

So now it runs through all my scenes, just like I like it the most.

My working configs, for others to reference:

configuration.yaml:

input_select:
  bryggersscener:
    name: Scener for Bryggers Lys
    options:
      - bryggers_fuldtlys
      - bryggers_halvtlys
      - bryggers_lavtlys
      - bryggers_natlys
  fitnessscener:
    name: Scener for Fitness Lys
    options:
      - fitness_blaahvidtlys
      - fitness_blaatlys
      - fitness_fuldtlys
      - fitness_groentlys
      - fitness_gultlys
      - fitness_halvtlys
      - fitness_lavtlys
      - fitness_natlys
      - fitness_roedtlys

apps.yaml

dimmer_bryggers_X1:
  module: controllerx
  class: HueDimmerController
  controller: bryggers_switch_01
  integration: deconz
  light: light.extended_color_light_3_2
  multiple_click_delay: 350
  merge_mapping:
    1002$2:
      - service: input_select.select_next
        data:
          entity_id: input_select.fitnessscener
      - scene: "scene.{{ states('input_select.fitnessscener') }}"

And then create the scenes in the GUI.

I.O.U.1 !
Your work is a life saver, makes things work so much easier.

1 Like

Glad you got it working @Jano1959! Thank you for sharing back your final solution (with screenshots included :open_mouth:)

Only giving back what I can, Can only try to support your great work here.

1 Like

Hi all,

I just released ControllerX v4.16.0 with a new feature for click and hold actions. Now you should be able to configure in a more flexible way how to cycle through different attributes (brightness, color_temp and white_value). Until now, when reaching the min or max the cycle stopped. Now this is the default behaviour (stop), but you can also configure to loop (going from max to min and min to max), and bounce (bouncing back when reaching min or max).

It is not something I see the use case for my setup, but I am sure some of you might need or want something like this. Especially when working with 1-button controllers.

If you are planing to use it, I would love hearing your use case!

Regards,
Xavi M.

2 Likes

I have also added a section in my documentation with links to blog post(s) and video(s) related to ControllerX: ControllerX | Create controller-based automations with ease to control your home devices and scenes.

Thank you @Canaletto , @jones and @fribse.

If anyone knows or has a blog post or video related to ControllerX, let me know and I will put it in here.

Regards,
Xavi M.

4 Likes

Hi,

i currently use aqara single button switch with reference: WXKG06LM i don’t find this reference in supported controllers, seems the same as WXKG07LMLightController but with single button.

I want to use this switch to dimmer the light when switch is hold, I tried this config

couloir_aqara_sdb:
  module: controllerx
  class: WXKG07LMLightController
  controller: 00:15:8d:00:05:42:65:6a
  integration: deconz
  light: light.lumiere_couloir

and this config:

couloir_aqara_sdb:
  module: controllerx
  class: LightController
  controller: 00:15:8d:00:05:42:65:6a
  integration: deconz
  light: light.lumiere_couloir
  mapping:
    1001: hold_brightness_up

here deconz event when i hold the switch

{
    "event_type": "deconz_event",
    "data": {
        "id": "interrupteur_couloir_sdb",
        "unique_id": "00:15:8d:00:05:42:65:6a",
        "event": 1001,
        "device_id": "d36642e30f0911ebbfe2252ae31d7efa"
    },
    "origin": "LOCAL",
    "time_fired": "2021-09-10T14:43:15.681443+00:00",
    "context": {
        "id": "0b2c501b8f2beb063cf8dcb1d8699c04",
        "parent_id": null,
        "user_id": null
    }
}

but the brightness don’t change.

cheers

EDIT:

this configuration works for WXKG06LM :

couloir_aqara_sdb:
  module: controllerx
  class: LightController
  controller: interrupteur_couloir_sdb
  integration: deconz
  light: light.lumiere_couloir
  manual_steps: 7
  mapping:
    1001: hold_brightness_toggle

Hi @Elno,

WXKG06LM is not natively supported by ControllerXm, but I just added its support (https://github.com/xaviml/controllerx/commit/975c38bde13e839952b15f8136293a4f47c996a4) and it will be ready for the next release.

The configuration you had should do the work, since you can use LightController and mapping for custom controllers that are not supported like this one.

However, I don’t normally recommend using a hold_* action like hold_brightness_toggle if there is no release action. This controller does not have a release action, so when the button is released, the brightness will continue changing, so probably my suggestion to this controller would be:

  • Click: Toggle light
  • Long: Brightness max
  • Double: Brightness min

Configuration would be like:

couloir_aqara_sdb:
  module: controllerx
  class: LightController
  controller: interrupteur_couloir_sdb
  integration: deconz
  light: light.lumiere_couloir
  mapping:
    1002: toggle
    1001: on_full_brightness
    1004: on_min_brightness 

Regards,
Xavi M.

Hi @xaviml

Im trying to use ControllerX to cycle scenes using this configuration:

buttons_office:
  module: controllerx
  class: HueDimmerController
  controller: test_hue_switch
  integration: deconz
  light: light.lg301_01
  mapping:
    1002:
      - service: input_select.select_next
        data:
          entity_id: input_select.r301_scenes
      - scene: "scene.{{ states('input_select.r301_scenes') }}"
    4002:
      - service: scene.turn_on
        data:
          entity_id: scene.lg301_01_scr301_09
      - service: input_select.select_option
        data:
          option: "{{state_attr('input_select.r301_scenes','options')[0]}}"

What I’m trying to achieve at the end of the configuration is to reset my input select, but no cigar.
this error:

2021-09-23 21:27:44.257629 WARNING HASS: Code: 400, error: 400: Bad Request
2021-09-23 21:27:44.256522 WARNING HASS: Error calling Home Assistant service default/input_select/select_option
2021-09-23 21:27:44.225497 INFO buttons_office: 

🤖 Service: e[1minput_select.select_optione[0m
  - option: lg301_01_scr301_09
2021-09-23 21:27:44.182041 INFO buttons_office: 

🤖 Service: e[1mtemplate.rendere[0m
  - template: {{state_attr('input_select.r301_scenes','options')[0]}}
2021-09-23 21:27:44.176816 INFO buttons_office: 🏃 Running `Service (input_select.select_option)` now
2021-09-23 21:27:44.084335 INFO buttons_office: 

🤖 Service: e[1mscene.turn_one[0m
  - entity_id: scene.lg301_01_scr301_09
2021-09-23 21:27:44.077499 INFO buttons_office: 🏃 Running `Service (scene.turn_on)` now
2021-09-23 21:27:44.069115 INFO buttons_office: 🎮 Button event triggered: `4002`

Any idea how to get around this problem?