ControllerX. Bring full functionality to light and media player controllers

@xaviml, @Doublet I’ve also had to reinstall in HACS after most of the beta releases.
Wasn’t sure if it was just me.
Guess it’s time to collect some logs…

1 Like

Same here, guys.

Several times through all the beta’s up to v2.3.0 I had to reinstall several times to actually load new version. Even though HACS indicated that new version actually WAS loaded ??

Hi, I’ve just bought a Trust ZYCT-202 controller which I’m playing around with, I’m talking to zigbee with a ZHA+Conbee II setup does the feature release in 2.30 below mean it’s only supported in z2m currently or am I just being thick and that is a config setting?

Cheers

Mark

@hainesy - correct, it is only supported for zigbee2mqtt currently.

If you can send the zha_events from the button presses, support can easily be added.

To do so, go to developer tools -> events and under listen to events, type in zha_event and hit start listening.

Then post here or gitthub the zha events for the controller. You should get an event for each press of “on”, “up”, “down” “off” and one that happens with every release of any button.

Each remote and the integrations that are currently supported are always listed here on the ControllerX docs.

EDIT: Is this device currently supported on zha? If not, it will need a quirk before it can be supported in ControllerX.

1 Like

@sreknob Hey, thanks for replying. I’m brand new to HA so just bought a few bits and pieces to start playing before building out a fuller system - I think I might have jumped the gun a bit on these remotes :-(.

I’ve got it working in homeassistant using ZHA, but it only registers as a generic ‘EndDevice’, it doesn’t have a specific quirk like my Xiaomi sensors do. This means it just recognizes the On & Off button but none of the others. I think i’m a bit stuck as my Conbee II stick doesn’t work with z2m and I’ve had more luck pairing devices with ZHA than with Deconz so don’t really want to move off it again just yet. Oh well…

@hainesy - no problem!
Just because there isn’t a quirk for zha, doesn’t mean one can’t be made, it just requires some work.
Check in on the zha devices thread. I know that there has been mention of that controller some time ago but nothing recent.
If you are so inclined, information about making a quirk can be found in the device handlers repo under contributing.md.
Good luck!

Thanks for the pointer - will have a read and see whether it’s beyond my level of geekery at this point!

Cheers

Hi xaviml, great work indeed. I’ve just started with home assistant and I was really struggling to find a “clean” solutions for remote.

I have a 2 buttons ikea controlling 3 color GU10 spots using the ZHA protocol.
The default setting (E1743Controller) works like a charm (on/off dimm). However I wanted to expand the functionality using the CustomLightController with sometimg like this:

bedroom_lights2:
  module: controllerx
  class: CustomLightController
  controller: cc:cc:cc:ff:fe:58:yy:xx
  integration: zha
  light: light.hue_color_gu10_2
  mapping:
    on: toggle
    move_with_on_off_0_83: hold_brightness_toggle
    stop: release

but it doesn’t work. Instead, if I make a new class like:

class E1743TEMPController(LightController):
    # Different states reported from the controller:
    # on, off, brightness_up, brightness_down, brightness_stop

    def get_zha_actions_mapping(self):
        return {
            "on": Light.TOGGLE,
            "off": Light.SET_HALF_COLOR_TEMP,
            "move_with_on_off_0_83": Light.HOLD_COLOR_TEMP_TOGGLE,
            "move_1_83": Light.HOLD_BRIGHTNESS_TOGGLE,
            "stop": Light.RELEASE,
        }

It does what I want. is the ZHA protocol able to use the CustomLightController, or do I need some additional configuration?

Thanks for the great work!!

@ffavero - for zha I believe you need to wrap the mapping in quotes, like:

  mapping:
    "toggle": "toggle"

Try that with your custom controller and see if it solves the issue.

EDIT: Looking further at your class that works, this should give you the desired effect. The mappings of what you want should directly be the functions you desire. With custom controllers you need to map every function you desire, it won’t take the defaults of the controller.

bedroom_lights2:
  module: controllerx
  class: CustomLightController
  controller: cc:cc:cc:ff:fe:58:yy:xx
  integration: zha
  light: light.hue_color_gu10_2
  mapping:
    "on": toggle
    "off": set_half_color_temp
    "move_with_on_off_0_83": hold_colortemp_toggle
    "move_1_83": hold_brightness_toggle
    "stop": release
1 Like

Hi @ffavero,

@sreknob is right. The problem that “on” and “off” are mapped as boolean variable (true and false). So they need to be mapped between the quotes. As far as I knowz the rest do not need to be wrapped between quotes, but doing it so makes sure the mapping is a string variable.

Thanks @sreknob and @xaviml, it was just silly of me not to try that in the first place :-).

That’s really awesome, it really offer almost full cutomization in a very logical and tidy way. I find it not really intuitive that by default the switches need to be implemented as automations… And that the native implementation doesn’t offer at least an user friendly (I mean do it in few lines and not 50 lines of code) dimm as you hold feature…

I hope that with an actual useful implementation of zigbee groups in zha I’ll also be able to reduce duplications in the app.yaml, but for now it’s just perfect. Cheers

1 Like

@xaviml
Before all, please, have my appologies for late reply. I haven’t noticed I’ve been logged out and did not received note on Your reply ther in git-hub.

Here, this is content of my /config/appdaemon/apps/apps.yaml file, (it is HASSIO platform on RPI3)

> Dnevni_controller: (Dnevni stands for "livingroom" in my language=
>   module: controllerx
>   class: E1810Controller
>   controller: 90:fd:9f:ff:fe:53:1d:c8
>   integration: zha
>   light: light.dne1 (this is light mapped from ZHA just for this purpose) 

Other than this, here is my configuration.yaml

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Uncomment this if you are using SSL/TLS, running in Docker container, etc.

http:

base_url: example.duckdns.org:8123

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

climate:

  • platform: generic_thermostat
    name: dnevni
    heater: switch.ikea_of_sweden_tradfri_control_outlet_802a20fe_on_off
    target_sensor: sensor.lumi_lumi_weather_08f82203_temperature
    min_temp: 15
    max_temp: 30
    ac_mode: false
    target_temp: 17
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    away_temp: 18
    initial_hvac_mode: “off”
    precision: 0.1
  • platform: generic_thermostat
    name: spavaca
    heater: switch.ikea_of_sweden_tradfri_control_outlet_80d4f6fe_on_off
    target_sensor: sensor.lumi_lumi_weather_32ee4c03_temperature
    min_temp: 15
    max_temp: 30
    ac_mode: false
    target_temp: 17
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    away_temp: 18
    initial_hvac_mode: “off”
    precision: 0.1 `

Besides this, I don’t know if appdaemon is running at all and have no idea how to get log from

@branitelj91 won’t be able to get very far until you’ve verified appdaemon is up and running.
How are you installing it and what platform are you using? You can find the doc on the installing it here.
If using HASS.IO, it’s pretty straightforward and you can see here for details.
Once you an confirm it’s up and running, then more troubleshooting can be done!

Thank You. Today I stumbled, (following links from this thread), upon appdaemon4, where I have installed, (funny, but I tought it was the one), “some kind of appdaemon”, and had no clue how to make it work.
Now, in this very momment, I am installing appdaemon4. Thank You for the notification, though.

I will give it a try and, after I have it up and running, will go on further.

2 Likes

I can’t get deconz and the Hue Dimmer to work with this at all. This is an example of the deconz_event:

{
    "event_type": "deconz_event",
    "data": {
        "id": "dimmer_switch",
        "unique_id": "00:17:88:01:10:5f:0c:4f",
        "event": 1000
    },
    "origin": "LOCAL",
    "time_fired": "2020-03-10T13:41:34.846224+00:00",
    "context": {
        "id": "7dd4b4b9c7a04a24bd2d7a1a3e6ed3fe",
        "parent_id": null,
        "user_id": null
    }
}

Here is my controllerx config for this, the light is a Hue color spot.

master_bath_dimmer:
  module: controllerx
  class: HueDimmerController
  controller: 00:17:88:01:10:5f:0c:4f
  integration: deconz
  light: light.master_bathroom_bath_overhead

Any ideas?

Hi @pashdown

I see that you put the device IEEE on the controller attribute. However, for the deconz integration you need the device id, so:

master_bath_dimmer:
  module: controllerx
  class: HueDimmerController
  controller: dimmer_switch
  integration: deconz
  light: light.master_bathroom_bath_overhead

Let me know if this was the problem. If this did not solve the problem, could you share the AppDaemon logs with us?

Thank you :slight_smile:

Thank you @xaviml. That did the trick!

What button will cycle the color?

Hi @pashdown

The color cycle with that controller works with holding the “I” and “O”, one to go to one direction and the other to the other one.

I am glad it worked :slight_smile:

v2.4.0 is now released :partying_face:

This minor change does not contain breaking changes.

:pencil2: Features

  • Add new predefined action (sync) to set light(s) in default mode. For the moment it sets the light into full brightness. This action is called when the center button of E1810 controller is held.

:hammer: Fixes

  • Invert E1744LightController deCONZ rotations. Rotate left is to dim and rotate right is to brighten.
  • Support for ZHA args ZigBee 3.0 firmware for E1810 (#45)

:video_game: New devices

  • Support for PJ2-2B Lutron Caseta Pro (state) @sreknob
  • Support for PJ2-2BRL Lutron Caseta Pro (state) @sreknob
  • Support for PJ2-3BRL Lutron Caseta Pro (state) @sreknob
  • Support for PJ2-4B Lutron Caseta Pro (state) @sreknob
  • Support for WXKG11LML Aqara switch (z2m) @crserran
1 Like

Can you please add deCONZ mapping for WXKG11LM?

  • 1002 – 1 click
  • 1004 – 2 clicks
  • 1001 – Hold the button
  • 1003 – Release the button
1 Like