ControllerX. Bring full functionality to light and media player controllers

Hi @Botap -

The ZHA frontend still needs some work for groups as it’s not very intuitive. It’s a WIP.

The workflow is, create a group with the lights you want to control under Config -> ZHA -> Groups.

Once you’ve created the group with the lights you want to control (and the Zigbee radio if you want to use ControllerX by getting zha_events to show) then you need to go to your controller config and bind the clusters to the group that you want to control (on/off and lightlevel usually).

Make sure you wake your remote when you’re binding the clusters.

You’ll need to go to Config -> ZHA -> YOUR REMOTE -> Group Binding -> Select the “Bindable Group” and the clusters you want to bind with the check-marks -> Bind Group at the bottom while waking the remote.

Let me know if it works! If not, might want to check the ZHA thread or discord.

Hi Blake, thanks for the explanation and I managed to bind the clusters to the group as explained above:
2020-05-11 08:38:01 DEBUG (MainThread) [zigpy.zdo] [0x4b2e:zdo] 0x4b2e: Bind_req 08:6b:d7:ff:fe:21:b7:c9, ep: 1, cluster: 4 to group: 0x0001 completed: [<Status.SUCCESS: 0>]

2020-05-11 08:38:01 DEBUG (MainThread) [zigpy.zdo] [0x4b2e:zdo] 0x4b2e: Bind_req 08:6b:d7:ff:fe:21:b7:c9, ep: 1, cluster: 8 to group: 0x0001 completed: [<Status.SUCCESS: 0>]

2020-05-11 08:38:01 DEBUG (MainThread) [zigpy.zdo] [0x4b2e:zdo] 0x4b2e: Bind_req 08:6b:d7:ff:fe:21:b7:c9, ep: 1, cluster: 6 to group: 0x0001 completed: [<Status.SUCCESS: 0>]

But unfortunately this doesn’t solve the issue. I am still not getting any zha_event for the Ikea E1743 remote. When pressing the up/down button on the remote I am getting the following in the log:
2020-05-11 08:38:42 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] ZCL request 0x0001: []

2020-05-11 08:38:42 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] No handler for cluster command 1

2020-05-11 08:38:47 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=5 command_id=0>

2020-05-11 08:38:47 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] ZCL request 0x0000: []

2020-05-11 08:38:47 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] No handler for cluster command 0

2020-05-11 08:39:14 DEBUG (MainThread) [zigpy.zcl] [0x4b2e:1:0x0102] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=6 command_id=0>

May be this means something to you?

v2.7.1 is now released :partying_face:

This patch change does not contain breaking changes.

:hammer: Fixes

  • add add_transition_turn_toggle to fix [ #79 ]

Hey @bdb1,

You can now replace add_transition for add_transition_turn_toggle to fix the problem you had when lights were not turning on to the previous brightness. This new attribute removes the transition attribute to just calls related to turning on/off and toggling the light. You can read more about it in FAQ #6.

Hi, I was really looking forward to using the app with the Xiaomi buttons I use, but was not able to get it to work yet, and I’m not sure what’s wrong.

I’m running v2.7.1 on HACS 024.5 on HassOS 3.13 on RPI 3B+

this is what I have in /config/appdaemon/apps/apps.yaml

SlaapkamerButton:
module: controllerx
  class: WXKG01LMLightController
  controller: sensor.button_slaapkamer_click
  integration: z2m
  light: light.spot_hoek_bank

Nothing really special going on here, right? Tested button and light seperately and together in an automation. All fine.
So what’s missing?

Hi @hendriku,

I do not see anything weird on the configuration you shared with us, except the “module” should be tabbed to the right together with controller, class, etc.

Dis you check AppDaemon logs? Can you shared them in here?

Hi’ @hendriku

As Xavi said, indentation is incorrect and will result in a appdeamon parser error like below.
Check your appdeamon logs :wink:

2020-05-17 21:25:11.450088 INFO AppDaemon: Reading config
2020-05-17 21:25:11.617379 WARNING AppDaemon: Error loading configuration
2020-05-17 21:25:11.619002 WARNING AppDaemon: parser says
2020-05-17 21:25:11.620724 WARNING AppDaemon:   in "<unicode string>", line 131, column 8:
      class: WXKG01LMLightController

My working configuration for same Xiaomi button/switch is:

office4_controller:
  module: controllerx
  class: WXKG01LMLightController
  controller: sensor.0x00158d00035a660f_click #Xiaomi round remote
  integration: z2m
  smooth_power_on: true
  light: light.0xec1bbdfffed45c3b_light

Ciao !

thanks! The indention was a copy/paste error. It is correct in apps.yaml. I’m confused about the logging. I’ve set appdaemon logging to warning under logger in configuration.yaml but not getting any error or warnings. Am I looking in the wrong place for appdaemon logs?

Hi @hendriku,

How did you install AppDaemon? (Via addon?) Is AppDaemon up and running?

If installed through hass addon, you can see the logs by clicking in the addon and the logs tab. No need to change anything on configuration.yaml

Through HACS, v2.7.1. So, no log tab

Hi @hendriku,

I think you are mixing concepts.

  • AppDaemon: It allows to run HA automations with Python code rather than YAML.
  • ControllerX: It is an AppDaemon automation (commonly called app) written in Python that allows you to bind controllers with lights and media players. In order for ControllerX to work, it needs and AppDaemon server or addon installed.
  • HACS: It is the Home Assistant Community Store, where you can install different integrations, plugins, themes or AppDameon apps. You can install ControllerX through HACS, but not AppDaemon.

Therefore, you will need to install AppDaemon. According to your setup, the easiest is to go to “Supervisor” tab and then “Add-on store”. In there you can look for “AppDaemon 4”. You can install and run. This will create the folder structure on /config/appdaemon and it will also create a hello world AppDaemon app for you to start. You can ignore that and then paste the config you had before in the apps.yaml. If this does not work, you might need to reinstall ControllerX through HACS. To check the logs I mentioned earlier, you will need to go to “Supervisor” and then to the installed addon"AppDaemon 4" and then to the “Logs” tab.

If you have any questions on these steps, just let me know :slight_smile:

thanks @xaviml! :flushed: that explains. I honestly thought it was installed alongside HACS. Sorry for for the inconvenience and thanks for the support.

1 Like

everything works after installing appdaemon (duh) now. Many thanks again, great app!

1 Like

Great, @hendriku :blush:

Xavi has an ability to ‘read between the lines’ and spot errors we users tend to forget or never had grasped actually was an error :wink::grin:

Ciao !

1 Like

HI All,

It’s been a while since I was on here and trying to get things to work, But I’m at it again and looking for some help.

I have the following set up

robins_controller:
  module: controllerx
  class: E1743Controller
  controller: robins_dimmer
  integration: deconz
  light: light.bedside_1
  excluded_actions:
    - 1002
    - 2002

robins_controller_1:
  module: controllerx
  class: E1743Controller
  controller: robins_dimmer
  integration: deconz
  light: switch.guest_room_light_switch
  actions:
    - 1002
    - 2002

( Edit: Robins_Controller_1 should be 1002 = turn light on, 2002 = turn light off
Robins_Controller should be dimming up and down, I’ve also seen in here that it’s possible to turn the light on at the last brightness setting “add_transition_turn_toggle” but I’m unsure how to use it in my set up… End of Edit)

the Dimming function of the light did work (just stopped when I last updated HA) but the switch part has never worked, I did do a work around by creating an automation to run when the button was pressed but it was supposed to be a temp fix not a solution.

any help on where I am going wrong? and how to correct it?

thanks in advance for any help I greatly appretiate your time and kindness.

Robin

Hi @Rdoull,

Regarding the dimming that stopped working, what are the logs about it? It is weird that all of a sudden it stopped working because of a HA upgrade.

Regarding the configuration, the robins_controller seems correct to me, however, robins_controller_1 is wrong. If you check the logs, you will see that it will be complaining about the second one, saying that switch is not from the domain of light. This is because you are using E1743Controller (which is a light controller) as a switch controller, so here is the correction for that one:

robins_controller_1:
  module: controllerx
  class: E1743SwitchController
  controller: robins_dimmer
  integration: deconz
  switch: switch.guest_room_light_switch

Also, the add_transition_turn_toggle attribute is meant to be used to fix the problem of the light not coming back to the previous brightness, but the default is to go back to the previous brightness. So if it is working properly, there is no need of changing this.

You can read more about this controller (E1743) in here.

Let me know about the logs for the first configuration to help you out further. :slight_smile:

Thanks for coming through on that Xavi.

1 Like

hi Xaviml,

I agree it was very weird, I dont remember doing anything else other than the upgrade,

here are the logs

[22:42:37] INFO: Starting AppDaemon...
2020-05-19 22:42:46.726917 INFO AppDaemon: AppDaemon Version 4.0.3 starting
2020-05-19 22:42:46.728579 INFO AppDaemon: Python version is 3.8.2
2020-05-19 22:42:46.730312 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-05-19 22:42:46.732601 INFO AppDaemon: Added log: AppDaemon
2020-05-19 22:42:46.734593 INFO AppDaemon: Added log: Error
2020-05-19 22:42:46.736266 INFO AppDaemon: Added log: Access
2020-05-19 22:42:46.737986 INFO AppDaemon: Added log: Diag
2020-05-19 22:42:46.926845 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-05-19 22:42:47.126521 INFO HASS: HASS Plugin Initializing
2020-05-19 22:42:47.129034 INFO HASS: HASS Plugin initialization complete
2020-05-19 22:42:47.134118 INFO AppDaemon: Initializing HTTP
2020-05-19 22:42:47.138377 INFO AppDaemon: Using 'ws' for event stream
2020-05-19 22:42:47.256636 INFO AppDaemon: Starting API
2020-05-19 22:42:47.297424 INFO AppDaemon: Starting Admin Interface
2020-05-19 22:42:47.301306 INFO AppDaemon: Starting Dashboards
2020-05-19 22:42:47.409371 INFO HASS: Connected to Home Assistant 0.109.6
2020-05-19 22:42:47.605850 INFO AppDaemon: App 'elsbeths_controller' added
2020-05-19 22:42:47.610140 INFO AppDaemon: App 'robins_controller' added
2020-05-19 22:42:47.613739 INFO AppDaemon: App 'robins_controller_1' added
2020-05-19 22:42:47.620847 INFO AppDaemon: Found 3 total apps
2020-05-19 22:42:47.625060 INFO AppDaemon: Starting Apps with 3 workers and 3 pins
2020-05-19 22:42:47.638814 INFO AppDaemon: Running on port 5050
2020-05-19 22:42:47.697320 INFO HASS: Evaluating startup conditions
2020-05-19 22:42:47.872985 INFO AppDaemon: Got initial state from namespace default
2020-05-19 22:42:49.800572 INFO AppDaemon: Scheduler running in realtime
2020-05-19 22:42:49.820992 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-05-19 22:42:49.824987 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2020-05-19 22:42:49.828549 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/devices to module import path
2020-05-19 22:42:49.832739 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core to module import path
2020-05-19 22:42:49.836399 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/stepper to module import path
2020-05-19 22:42:49.840299 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/feature_support to module import path
2020-05-19 22:42:49.843835 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/type to module import path
2020-05-19 22:42:49.847734 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/integration to module import path
2020-05-19 22:42:50.020446 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/const.py - ignoring
2020-05-19 22:42:50.030211 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2020-05-19 22:42:50.529921 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/version.py - ignoring
2020-05-19 22:42:50.538058 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/ikea.py - ignoring
2020-05-19 22:42:50.545108 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/aqara.py - ignoring
2020-05-19 22:42:50.552030 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/__init__.py - ignoring
2020-05-19 22:42:50.558844 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/lutron.py - ignoring
2020-05-19 22:42:50.565755 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/philips.py - ignoring
2020-05-19 22:42:50.572779 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/smartthings.py - ignoring
2020-05-19 22:42:50.579544 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/trust.py - ignoring
2020-05-19 22:42:50.586496 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/__init__.py - ignoring
2020-05-19 22:42:50.593459 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/controller.py - ignoring
2020-05-19 22:42:50.600409 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/custom_controller.py - ignoring
2020-05-19 22:42:50.607248 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/circular_stepper.py - ignoring
2020-05-19 22:42:50.614739 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/__init__.py - ignoring
2020-05-19 22:42:50.621708 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/minmax_stepper.py - ignoring
2020-05-19 22:42:50.628474 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/feature_support/__init__.py - ignoring
2020-05-19 22:42:50.636104 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/feature_support/light.py - ignoring
2020-05-19 22:42:50.642919 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/feature_support/cover.py - ignoring
2020-05-19 22:42:50.649989 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/cover_controller.py - ignoring
2020-05-19 22:42:50.657744 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/switch_controller.py - ignoring
2020-05-19 22:42:50.665101 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/light_controller.py - ignoring
2020-05-19 22:42:50.672162 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/__init__.py - ignoring
2020-05-19 22:42:50.679144 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/media_player_controller.py - ignoring
2020-05-19 22:42:50.686157 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/deconz.py - ignoring
2020-05-19 22:42:50.693248 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/state.py - ignoring
2020-05-19 22:42:50.700115 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/zha.py - ignoring
2020-05-19 22:42:50.707804 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/z2m.py - ignoring
2020-05-19 22:42:50.714863 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/__init__.py - ignoring
2020-05-19 22:42:50.720977 INFO AppDaemon: Initializing app elsbeths_controller using class E1743Controller from module controllerx
2020-05-19 22:42:50.731631 INFO AppDaemon: Initializing app robins_controller using class E1743Controller from module controllerx
2020-05-19 22:42:50.741746 INFO AppDaemon: Initializing app robins_controller_1 using class E1743Controller from module controllerx
2020-05-19 22:42:51.543844 INFO elsbeths_controller: 🎮 ControllerX v2.7.1
2020-05-19 22:42:51.613744 INFO robins_controller: 🎮 ControllerX v2.7.1
2020-05-19 22:42:51.629666 WARNING robins_controller_1: ------------------------------------------------------------
2020-05-19 22:42:51.632164 WARNING robins_controller_1: Unexpected error running initialize() for robins_controller_1
2020-05-19 22:42:51.634768 WARNING robins_controller_1: ------------------------------------------------------------
2020-05-19 22:42:51.637944 WARNING robins_controller_1: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 143, in initialize_app
    await init()
  File "/config/appdaemon/apps/controllerx/core/type/light_controller.py", line 78, in initialize
    self.light = self.get_light(self.args["light"])
KeyError: 'light'
2020-05-19 22:42:51.641461 WARNING robins_controller_1: ------------------------------------------------------------
2020-05-19 22:42:51.650862 INFO AppDaemon: App initialization complete
2020-05-19 22:45:31.690291 INFO robins_controller: 🎮 Button event triggered: `2001`
2020-05-19 22:45:31.708381 INFO robins_controller: 🏃 Running `hold_brightness_down` now
2020-05-19 22:45:32.183287 INFO robins_controller: 🎮 Button event triggered: `2003`
2020-05-19 22:45:32.198021 INFO robins_controller: 🏃 Running `release` now
2020-05-19 22:45:33.322371 INFO robins_controller: 🎮 Button event triggered: `1001`
2020-05-19 22:45:33.337339 INFO robins_controller: 🏃 Running `hold_brightness_up` now
2020-05-19 22:45:34.059660 INFO robins_controller: 🎮 Button event triggered: `1003`
2020-05-19 22:45:34.075059 INFO robins_controller: 🏃 Running `release` now

As I am sure you can see I have a couple of remotes set up for different lights, neither will work.

I restarted Apdeamon, rebooted HA and reloaded apps.yaml.

have I missed something?

thank you for your help and time

Robin

Got Some Progress…

I uninstalled ControllerX and rebooted HA, then reinstalled ControllerX, loaded the exact same data into the app.yaml file and everything works.

I guess the install got corupted some how but its sorted now :smile:

Thank you

1 Like

I am glad that it got sorted @Rdoull :slight_smile: there is nothing that a reboot cannot fix haha

1 Like