ControllerX. Bring full functionality to light and media player controllers

I can see the dimming function inside z2m

@xaviml any ideas on the above? thanks

Totally new to ControllerX and AppDaemon here

The user and password that need to go into appdaemon.yaml, I don’t know what user this is supposed to be. I’ve checked my mqtt broker and I havent created any specific users and inly rely on the HA users. Do I have to create a new user (here), and are there any unforseen consequences of doing this?

Hi @xaviml ,
I finally found some time to test this. Unfortunately the default mapping is not working. Only the “on” and “off” is working.
When i hold the buttom down i see the event in de AppDeamon log but comes with a lot of errors and nothing happend after that.
I have a led strip with the Wled integration.
Here is my Config:

LedstripLogeerkamer:
  module: controllerx
  class: E2002LightController
  integration: deconz
  controller: led_strip
  light: light.led_logeerkamer

Here is the outcome when i hold the button_down:

2023-03-02 16:40:01.764582 INFO LedstripLogeerkamer: 🎼 Button event triggered: `2001`
2023-03-02 16:40:01.766958 INFO LedstripLogeerkamer: 🏃 Running `Predefined (hold_brightness_down)` now
2023-03-02 16:40:01.770620 WARNING LedstripLogeerkamer: ------------------------------------------------------------
2023-03-02 16:40:01.770920 WARNING LedstripLogeerkamer: Unexpected error in worker for App LedstripLogeerkamer:
2023-03-02 16:40:01.771178 WARNING LedstripLogeerkamer: Worker Ags: {'id': '6644abbb7c6e48f2931bd844ad6b8e3b', 'name': 'LedstripLogeerkamer', 'objectid': 'd3118ec227b748aeb14cf3d667b47c5a', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.event_callback of <cx_core.integration.deconz.DeCONZIntegration object at 0x7fce6d206b90>>, 'data': {'id': 'led_strip', 'unique_id': '94:de:b8:ff:fe:07:92:45', 'event': 2001, 'device_id': 'd36115c4a9ac0c87a4c309494f5a823a', 'metadata': {'origin': 'LOCAL', 'time_fired': '2023-03-02T15:40:01.760732+00:00', 'context': {'id': '01GTHFNXV0RW0W0RG22Y1STZDQ', 'parent_id': None, 'user_id': None}}}, 'pin_app': True, 'pin_thread': 2, 'kwargs': {'id': 'led_strip', '__thread_id': 'MainThread'}}
2023-03-02 16:40:01.771433 WARNING LedstripLogeerkamer: ------------------------------------------------------------
2023-03-02 16:40:01.771844 WARNING LedstripLogeerkamer: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 855, in async_worker
    await funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/controllerx/cx_core/integration/deconz.py", line 34, in event_callback
    await self.controller.handle_action(data[type_], extra=data)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 404, in handle_action
    await self.call_action(action_key, extra=extra)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 478, in call_action
    await self.action_timer_callback({"action_key": action_key, "extra": extra})
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 516, in action_timer_callback
    await task
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 532, in call_action_types
    await action_type.run(extra=extra)
  File "/config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py", line 118, in run
    await action(*positional, **action_args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 60, in _action_impl
    continue_call = await controller.before_action(method.__name__, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/light_controller.py", line 799, in before_action
    self.remove_transition_check = await self.check_remove_transition(
  File "/config/appdaemon/apps/controllerx/cx_core/type/light_controller.py", line 438, in check_remove_transition
    or await self.feature_support.not_supported(LightSupport.TRANSITION)
  File "/config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py", line 41, in not_supported
    return not await self.is_supported(feature)
  File "/config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py", line 38, in is_supported
    return feature & await self.supported_features != 0
  File "/config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py", line 32, in supported_features
    raise ValueError(
ValueError: `supported_features` could not be read from `light.led_logeerkamer`. Entity might not be available.
2023-03-02 16:40:01.772110 WARNING LedstripLogeerkamer: ------------------------------------------------------------
2023-03-02 16:40:03.349568 INFO LedstripLogeerkamer: 🎼 Button event triggered: `2003`
2023-03-02 16:40:03.352588 INFO LedstripLogeerkamer: 🏃 Running `Predefined (release)` now

Can you tell me what i’m doing wrong?

EDIT: for some reason after the WLED was Powerd off for some time and offline. After 1 dat i put It back on and looks like Its working now.

Still have to test the FX part.

Has anyone here successfully setup ControllerX with the Tuya Smart Knob?

https://xaviml.github.io/controllerx/controllers/TuYaERS10TZBVKAA/

It seems to connect and I can see the state changes however I get the following error in Zigbee2MQTT:

entity

However if I use the same entity with the Ikea E1744 Smart Knob in ControllerX, it works just fine. I’m pulling my hair out here! Any help you be GREATLY appreciated! Below is my apps.yaml config:

office_dimmer:
  module: controllerx
  class: TuYaERS10TZBVKAAZ2MLightController
  integration:
    name: z2m
    listen_to: mqtt
  controller: SmartKnob
  light: light.switch_office

and here is what’s in the Z2M config for the Tuya:

'0x003c84fffeb13c00':
  friendly_name: SmartKnob

Since Appdaemon was updated to v4.4.0, the templates just stop working.

Going back to v4.2.3 makes it work again, so looks like there’s some breaking change on Appdaemon, I read the changelog and there’s nothing mentioning it, but the true is that is doesn’t work


Hi @mama_mia ,

Could you open a bug in the ControllerX GitHub issues and provide:

  • appdaemon.yml (exclude sensitive data).
  • failing app configuration (from apps.yaml).
  • the logs.
  • Steps to reproduce the bug.

Thank you,
Xavi M.

Sorry everyone, I have been busy with my personal work and I have not had much time to look to all your messages. I will start look at them soon and reply to all of you.

Thank you for your patience.

Hi @deadphill ,

Color looping is not supported by Z2M Light Controller.

https://xaviml.github.io/controllerx/others/zigbee2mqtt-light-controller/

If you want color looping, you will need to use the regular Light Controller with E2002LightController.

Regards,
Xavi M.

Hi @AlexZuiderwijk ,

It seems there is something wrong in the configuration by what the logs shows. If you provide app configuration, it will help me to know what the issue might be.

Thanks,
Xavi M.

Hi @sebpro,

MQTT broker (Mosquitto) documentations says:
“”"

Option: logins (optional)

A list of local users that will be created with username and password. You don’t need to do this because you can use Home Assistant users too, without any configuration. If a local user is specifically desired:

logins:
  - username: user
    password: passwd

“”""

So, if you specified a user and password, you csn use those, otherwise, you can use any Home Assistant user. In case you are using Zigbee2MQTT, you can use the same user you have configured in its configuration.

Regards,
Xavi M.

Hi @Denman2103 ,

I recommend you adding the supported_features flag to your configuration: Controller types - ControllerX

It seems your light does not provide this attribute and it is a mandatory field from HA side. So you will need to provide it through configuration.

Regards,
Xavi M.

Hi @xaviml,

I think I might know what the problem is.
I’ll make some tests later today before opening a bug in ControllerX.
If I can fix it, I’ll open a PR, if not, a but it is


Hi @mama_mia ,

Apparently, this is an issue with AppDaemon:

PR is now merged, but we do not know when AppDaemon will release the fix. In the meantime, I am working on patching this fix as part of ControllerX temporarily until AppDaemon releases this fix officially.

I will keep you updated.

Regards,
Xavi M.

Hi @mama_mia ,

I just released fix into ControllerX v4.26.0. I have added a patch as a workaround, you can read more about it in:

EDIT:
I am having problems to use the patch with the AppDaemon addon, I will need to keep looking for a better solution.

Regards,
Xavi M.

Hi @mama_mia again,

I just released ControllerX v4.26.1 with a fix for AppDaemon addon.

Let me know if it works for you.

Regards,
Xavi M.

1 Like

Hi,

Just tested it, and it’s working.
Awesome!!

Thank’s!!

1 Like

Hi @xaviml New Ikea Remote !

ZHA Events

  endpoint_id: 1
  cluster_id: 6
  command: toggle
------------------------------------------
  command: move_with_on_off
  args:
    - 0
    - 255
  params:
    move_mode: 0
    rate: 255
------------------------------------------
  command: move
  args:
    - 0
    - 255
    - 0
    - 0
------------------------------------------
  command: move_with_on_off
  args:
    - 1
    - 255
  params:
    move_mode: 1
    rate: 255
------------------------------------------
  command: move
  args:
    - 1
    - 255
    - 0
    - 0
------------------------------------------
  command: step
  args:
    - 1
    - 1
    - 0
    - 0
    - 0
  params:
    step_mode: 1
    step_size: 1
    transition_time: 0
    options_mask: 0
    options_override: 0
------------------------------------------
  command: step
  args:
    - 0
    - 1
    - 0
    - 0
    - 0
  params:
    step_mode: 0
    step_size: 1
    transition_time: 0
    options_mask: 0
    options_override: 0
------------------------------------------
  command: shortcut_v1_events
  args:
    - 1
    - 1
  params:
    shortcut_button: 1
    shortcut_event: 1
------------------------------------------
  command: shortcut_v1_events
  args:
    - 2
    - 1
  params:
    shortcut_button: 2
    shortcut_event: 1


1 Like

Thank you @Canaletto , I will look into it when I have time.

New AppDaemon version got release today with the fix for the template rendering. I will remove my patch when I have some more time again.

In case latest version is not working, v4.25.0 can be used since it does not contain the patch, and should work with latest AppDaemon version.

Regards,
Xavi M.