ControllerX. Bring full functionality to light and media player controllers

Hi @fribse,

You’re correct, it only works for the whole config, so you’d need to create a separate config for that action with a constrain_input_boolean.

Regards,
Xavi M.

1 Like

v4.6.0 is now released :partying_face:

downloads
Note: Remember to restart the AppDaemon addon/server after updating to a new version.

:pencil2: Features

  • Templating support. Read more about it here. [ #108 ]
  • Add mode parameter to define what to do when an action is already executing. Similar to Home Assistant Automation modes. [ #242 ]
  • Add predefined actions: xycolor_from_controller and colortemp_from_controller for light controllers. It allows to get color values from the controller event. [ #236 ]
  • Add color_wheel and color_temp for MLI404011LightController with the new predefined actions xycolor_from_controller and colortemp_from_controller.
  • Add mute predefined action for Media Player controllers [ #238 ]
  • Allow specifying a default value or specific one for each action for action_delay and action_delta

:hammer: Fixes

  • Allow individual action groups rather than just a list of them for z2m integration
  • Fix ZHA parser for WXKG01LMLightController [ #241 ]
  • Fix deCONZ mapping for WXKG01LMLightController [ #245 ]

:video_game: New devices

  • ZB-3009 - add new device ZB-3009 with z2m support [ #237 ]
1 Like

Now the Ikea TRÅDFRI Shortcut button is available online here in Germany: https://www.ikea.com/de/de/p/tradfri-shortcut-button-weiss-40356381/

1 Like

Very nice update! Happy to have templating. Endless customizations. Very good template example too ;]

Thanks for the update @carsten_h. I see that Zigbee2MQTT documentation states that these are the possible values: on , brightness_move_up , brightness_stop. I will add the device for next release.

Thanks! I did add another example in the Examples page. I leave it here for anyone interested on something similar:

The following example shows the potential of templating render. Let’s say we want to execute different predefined actions every time we click a button (E1810 in this case). First, we can create an input select through UI or YAML in HA:

input_select:
  light_state:
    options:
      - on_min_brightness
      - on_full_brightness
      - set_half_brightness

Then we can define the following ControllerX config to change the option of the input_select and apply the predefined action that is selected:

example_app:
  module: controllerx
  class: E1810Controller
  controller: livingroom_controller
  integration: 
    name: z2m
    listen_to: mqtt
  light: light.my_light
  mapping:
    toggle:
      - service: input_select.select_next
        data:
          entity_id: input_select.light_state
      - action: "{{ states('input_select.light_state') }}"
3 Likes

Great use of templates! Is it possible to call different scenes with one template?

My problem is the multiple_click_delay when using multiple clicks normally. The time 500ms is too short for me and my family to find the right scene.But a longer time is not usable because the scene does not appear fast enough.

The way about a template sounds good, but the best way would be to call different scenes with multiple clicks.

1 Like

Hi @herrfelix,

I am not sure if I am following you. Do you want that everytime you click, it changes scene? For this you would not need multiple click, but you could do it with template. If this is what you want, I can quickly show you how. Otherwise, could you specify in much more detail what is that you want to achieve or what your problem is?

Thanks,
Xavi M.

Yes, each click a new scene.
Sorry for my ambiguity! I appreciate a tip with the templates.

Hi @herrfelix,

If I were to do this, I would first create an input_select like the following:

input_select:
  scenes:
    options:
      - scene.my_scene_1
      - scene.my_scene_2
      - scene.my_scene_3

Then I would create the following ControllerX config:

example_app:
  module: controllerx
  class: Controller
  controller: sensor.my_controller_action
  integration: z2m
  mapping:
    toggle:
      - service: input_select.select_next
        data:
          entity_id: input_select.scenes
      - scene: "{{ states('input_select.scenes') }}"

Note that this would only change the scene when pressing the button (the toggle action in this case), if you are interested to change the scene when changing the input_select from Lovelace, then you will need a Home Assistant automation for it.

I did not try this, but it is very similar to the example I posted earlier, but with scenes.

Regards,
Xavi M.

1 Like

Has something changed with the Hue Dimmer integration in the last few updates?

All has been perfect for the several months but now my Hue Dimmers have stopped working with no changes to any config bar a few software updates. They broadcast their events to ZHA as expected but nothing shows in the AppDaemon log other than the following example for each remote when restarting it…

2021-02-14 14:08:07.126706 INFO sams_wall_remote: 🎮 ControllerX v4.6.0

The Lightfy and Xiaomi controllers still work perfectly which implies something has only changed in the Hue function within ControllerX. Example config…

sams_wall_remote:
  module: controllerx
  class: HueDimmerController
  controller: 00:17:88:01:02:d5:c9:65
  integration: zha
  light: light.sams_bedroom
  manual_steps: 5
  color_wheel:
    - [0.701, 0.299]
    - [0.172, 0.747]
    - [0.136, 0.040]
    - [0.477, 0.196]
  merge_mapping:
    on_short_release:
      - service: scene.turn_on
        data:
          entity_id: scene.sam_dim
    on_short_release$2:
      - service: light.turn_on
        data:
          entity_id: light.ice_block
    on_short_release$3:
      - service: light.turn_on
        data:
          entity_id: light.sams_bed
    off_short_release$2:
      - service: light.turn_off
        data:
          entity_id: light.ice_block
    off_short_release$3:
      - service: light.turn_off
        data:
          entity_id: light.sams_bed
    on_short_release$4:
      - service: scene.turn_on
        data:
          entity_id: scene.sam_morning
    off_hold:
      - service: light.turn_off
        data:
          entity_id: light.sams_spots
      - service: light.turn_off
        data:
          entity_id: light.ice_block
      - service: light.turn_off
        data:
          entity_id: light.sams_bed

zha_event from a single press of the ‘on’ button…

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:17:88:01:02:d5:c9:65",
        "unique_id": "00:17:88:01:02:d5:c9:65:1:0x0006",
        "device_id": "a4ccc4e707ed11eb98bbb996b550e78a",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-02-14T15:13:08.041689+00:00",
    "context": {
        "id": "98837b7205cf3c0accb4c0d3db233e76",
        "parent_id": null,
        "user_id": null
    }
}

The IEEE still matches what’s seen in ZHA and no faults show in any log so scratching my head now.

Hi Xavi,
Thank you for the great integration. I had it working with ZHA and now moving to z2m, still working great.
What I am wondering, can I use the controllerx without using HomeAssistant at all?
So I want the controller (to listen to) from zigbee2mqtt and the light receiving the signal from controllerx using mqtt.
This would be nice, because when HA is unavailable (for example due to a restart), the light still work.

Thanks for your reply!

Kind regard,
Daniel

I think the multiple clicks idea is great. Unfortunately, my wife does not get along with it.
We had previously used the Hue dimmer switches and configured the assignment of the buttons via iConnectHue. Since it ran so:

  1. click on ON = Scene A on
  2. click on ON = Scene B on
  3. click on ON = Scene C on

The time between the clicks could be up to ten seconds before it started again from the beginning. This allowed each scene to be viewed before the next one was selected.

In your implementation, I need to know in advance how many times I need to press the ON button to select a particular scene. And that within 500ms.

Do you understand what I mean? Is there any way to implement my desired behavior? That would be fantastic!

Hi @herrfelix

That is not true, in the implementation I showed you last, you can wait as much time as you want between each click. It does not leverage the multiclick feature. So every time you press the button, it will:

  • change input_select to the new scene
  • activate the newly selected scene

Have you tried the configuration? Did you run to any problems? Happy to help further :slight_smile:

Regards,
Xavi M.

Hi @Bobby_Nobble,

Could it be that you changed the firmware of your controller recently? The “on” event does not match with the current mapping for this controller with ZHA.

I would say the problem is that you are running an old firmware for this controller. Someone raised this same concern in GitHub. In that ticket I left a configuration with the old mapping if you are not willing to upgrade the firmware, but as I said in the ticket ControllerX just mantains up-to-date mappings.

Hope this helps, and sorry for the inconvenience :slight_smile:

Regards,
Xavi M.

Yes, I have tried that and it works wonderfully. In practice, however, it is not quite as practical for us. To stay with my example:

  1. click on ON = Scene A on
  2. click on ON = Scene B on
  3. click on ON = Scene C on

In the evening I turn on Scene B with two clicks. Then I turn off the light and turn it on again the next day. Then it starts not with Scene A but with Scene C. This confuses my roommates here :).

Maybe it’s a luxury problem, but my wife is annoyed by it :slight_smile:

Hi @daniel1979,

I am afraid that is yet not possible, but it something in my list to do. Right now ControllerX is able to read from MQTT directly, but the device communication is all done through HA call services.

Related GitHub tickets:

Regards,
Xavi M.

1 Like

Hey @herrfelix,

I see then. You want that next day when you turn on the light, you want scene A to be activated back again, rather than the scene C, correct?

If so, my recommendation would be to solve this with a HA automation that changes the input_select to C after X seconds/minutes of having changed.

I said to Scene C (the last one you put in the list) because when pressing the on button the first thing that the ControllerX config does is to change the input_select to the next option.

I could help you with the HA automation if needed :slight_smile:

Regards,
Xavi M.

1 Like

Hi @xaviml thanks for the quick reply as always.

I haven’t changed the firmware as I don’t have a Hue hub and for the same reason updating is likely to be an issue. ( as it could potentially be for many others as the beauty of zigbee and HA is not having to own multiple hubs :slight_smile: ).

I did see that post on Github but didn’t think it relevant as I hadn’t noticed anything in the changelog. What confuses me about your suggested workaround is where you say…

With the old firmware, it is not possible to hold the on and off buttons as you can see in the mapping.

…which my config shows was working and is rather fundamental to my setup?

Further to my last post, according to Philips there have been plenty of more recent updates to other devices but nothing to the dimmer since 2019…

Hue Dimmer Switch

October 7, 2019

Software version: 6.1.1.28573

  • Improved communication with Hue Bridge
  • Performance and behavioral improvements

Source: Philips Hue Support - Release Notes Accessories | Philips Hue UK