ControllerX. Bring full functionality to light and media player controllers

Hi @xaviml

Thanks for replying…
i’ve got it working now with the integration: z2m :slight_smile:
only thing what is not working but maybe not suppported?

1 remote the type E1524 from ikea is working only on / off no brightness or color changing?
config i use is image

the other remote the type E2002 from ikea is working on / off and different colors… only no brightness
config i use here is image

hope this can be fixed don’t now if the controllers are fully supported??
Thanks again for the help!

Hi @rhannink,

Apparently, there has been a change in HA and z2m that I was not aware of. ControllerX is not reacting because is reading the action: null that appear in your logs. I would need to investigate further with my E1744 Controller and keep you updated with a fix for this.

As a workaround I recommend you change to the mqtt integration, so your configuration could look like this:

Volume_keuken_app:
  module: controllerx
  class: E1744MediaPlayerController
  controller: zigbee2mqtt/Volume1/action
  integration: mqtt
  volume_steps: 50
  media_player: media_player.keuken_speaker

You will need to change the /config/appdaemon/appdaemon.yaml file. I recommend you reading the Zigbee2MQTT (and MQTT) section of this page.

Regards,
Xavi M.

Hi @lars86,

The E1810 is fully supported, so all the actions should work with that configuration. Could you share you AppDaemon logs with me (in private to not overload it in here) when you try to use brightness, color temp, etc. Could you also share the Zigbee2MQTT logs so I can see the triggered events?

Finally, could you please tell me the versions of the following components:

  • ControllerX
  • Zigbee2MQTT
  • Home Assistant

Regards,
Xavi M.

@xaviml ,

Thanks for the fast respons. I have it up and running again with MQTT now. I experience a bit bit more lag, but its working. Thanks.

Ik will keep my eye on this forum topic to monitor when its fixed with HA.

Hi @rhannink,

Interesting that you have more lag with MQTT than with HA. It should be the other way around. When set with MQTT, the controller communicates like the following:

controller > Zigbee2MQTT > MQTT > AppDaemon > ControllerX

However, the schema looks the following when setup with the sensor as you had:

controller > Zigbee2MQTT > MQTT > HA > AppDaemon > ControllerX

As you can see the HA adds an overhead, this is why I added the mqtt integration.

I will keep you updated once I investigte with my Symfonisk controller.

Regards,
Xavi M.

I was wondering if it is possible to define steps in a light controller, like one does for media_player.

The case I’m working through, I’m trying to use a terncey dial as a media controller.
I have it working my using merge_mapping, but each dial moves the volume by 3 on my media player. (below is the config).

Is there any way to have it shift the volume by 1, rather than 3?
(and is there any other way to do this that I am missing?)

and also, automapic_steps or manual_steos do not seem to alter the steps within the voume player.

terncey:
  module: controllerx
  class: TerncySD01LightController
  controller: 00:0d:6f:00:16:73:c8:9a
  integration: zha
  light: light.main
  manual_steps: 1
  automatic_steps: 1
  merge_mapping: 
     rotate_right: 
       service: media_player.volume_up
       data:
         entity_id: media_player.m33_5063
     rotate_left: 
      service: media_player.volume_down
      data:
        entity_id: media_player.m33_5063

Thanks!

Hi,

I have one thing I cannot figure out how to solve in ControllerX:
I have a few light groups that I’m controlling using Phillips Dimmer Switches and ControllerX. That works just perfectly! What I’m trying to solve is the following: I have Phillips motion sensors that I want to use for turing on night light. What I would prefere is if the group is set to a list of specific scenes or off, if motion is registrerd, the motions sensor would set a specific scene for that group for a set time, and then revert back to the original scene or state.
How do I do this?

  • JT -

Hello,

I can’t use my Ikea remote control with Zigate gateway (neiher in ZHA nor in Z2M)

What is your zigbee gateway that works ?

Hi @xaviml,

Thank you for your excellent application. I am just wondering what the best way to support the Aqara Smart Knob would be with Z2M. A simple rotation looks like this:

Info MQTT publish: topic 'zigbee2mqtt/smart_knob', payload '{"action":"start_rotating","action_rotation_angle":96,"action_rotation_angle_speed":96,"action_rotation_percent":26.66666603088379,"action_rotation_percent_speed":26.66666603088379,"action_rotation_time":200,"battery":100,"linkquality":99,"operation_mode":"event","voltage":3100}'
Info MQTT publish: topic 'zigbee2mqtt/smart_knob', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"linkquality":99,"operation_mode":"event","voltage":3100}'
Info MQTT publish: topic 'zigbee2mqtt/smart_knob/action', payload 'start_rotating'
Info MQTT publish: topic 'zigbee2mqtt/smart_knob', payload '{"action":"stop_rotating","action_rotation_angle":96,"action_rotation_angle_speed":0,"action_rotation_percent":26.66666603088379,"action_rotation_percent_speed":0,"action_rotation_time":500,"battery":100,"linkquality":99,"operation_mode":"event","voltage":3100}'
Info MQTT publish: topic 'zigbee2mqtt/smart_knob', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"linkquality":99,"operation_mode":"event","voltage":3100}'
Info MQTT publish: topic 'zigbee2mqtt/smart_knob/action', payload 'stop_rotating'

As far as I am aware, I cannot determine the direction of rotation from within controllerx as I do not see any way to access the raw mqtt payload. Is this possible from within controllerx? Do you have a suggestion on how to get this to work? Is this just the result of a poor z2m compatibility with this device?

Thanks,
snalty

Hi @egarner,

What you would like is a TerncySD01MediaPlayerController which currently does not exists. Would you like to control a light and the media player with the same controller? If so, you would need the following:

  • An implementation of TerncySD01MediaPlayerController which I can add for the next release for you.
  • 2 configurations: one for the light, another for the media player controller.

In either case, you will need the TerncySD01MediaPlayerController. I open the following GitHub ticket for it (Add `TerncySD01MediaPlayerController` to support Media Player for this controller · Issue #377 · xaviml/controllerx · GitHub).

A workaround would be to use templates in the configuration you had with volume_set service:

terncey:
  module: controllerx
  class: TerncySD01LightController
  controller: 00:0d:6f:00:16:73:c8:9a
  integration: zha
  light: light.main
  merge_mapping: 
     rotate_right: 
       service: media_player.volume_set
       data:
         entity_id: media_player.m33_5063
         volume_level: "{{ state_attr("media_player.m33_5063", "volume_level") + 0.2 }}"
     rotate_left: 
      service: media_player.volume_set
      data:
        entity_id: media_player.m33_5063
        volume_level: "{{ state_attr("media_player.m33_5063", "volume_level") - 0.2 }}"

You can change the steps by changing the 0.2 in the template.

Regards,
Xavi M.

1 Like

Hi @Autoper,

You could definitely to in different ways. I will show you what I have for my bathroom light:

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"

I activate an specific scene when motion is registered and turn off the light when the motion is not registered anymore. You could do something similar but with 2 different scenes:

bathroom_day:
  module: controllerx
  class: LightController
  controller: binary_sensor.xxxxxx
  integration: state
  light: light.your_light
  mapping:
    "on":
      scene: scene.xxx
    "off":
      scene: scene.default

However, if you want to do it time based, then you can use delay:

bathroom_day:
  module: controllerx
  class: LightController
  controller: binary_sensor.xxxxxx
  integration: state
  light: light.your_light
  mapping:
    "on":
      - scene: scene.xxx
      - delay: 60 # in seconds
      - scene: scene.default

Hope this helps.

Regards,
Xavi M.

1 Like

Hi @NilkOne,

Not sure if we will be able to help you much in here since it seems to be a question for Zigbee2MQTT or ZHA, but I have been using CC2531 and LAUNCHXL-CC1352P-2 for about 2 years, and I have never had an issue with them. Both to work with Zigbee2MQTT.

Regards,
Xavi M.

Hi @snalty,

Seems that the knob has a start rotation and a stop rotation action, but how do you know if it turns left or right? Is it through the action_rotation_angle?

Please, fill this form to add a new device to ControllerX.

Regards,
Xavi M.

Hi Xavi,

You can get the left or right rotation from action_rotation_angle or action_rotation_percent. I shall fill in the form.

BW,
snalty

@xaviml , thank you for all your help!

What I’m looking for is a condition based control. Only if a specific scene is in use or the light is tuned off the motion sensor will control the light and preferably reactivate the scene again after a delay or no motion is registrerd.

– Jan-Tore –

Hi @snalty,

The problem is that this controller would only work with the z2m integration using MQTT, and not the states. However, I could integrate it.

Regards,
Xavi M.

Hi @Autoper,

I believe that there is no way if a scene is activated or not since a scene is just a template that changes the state of an entity. However, if you could monitor if a light is in a specific brightness, color, etc and react from there.

Although you could achieve this with ControllerX, I would recommend you doing this with Home Assistant automations since ControllerX is good for controller devices to control lights, media players, etc, but it does not offer anything new when working with motion sensors.

I am happy to help you further with ControllerX configuration if you specify exactly your use case with scene names, and motion sensors.

Regards,
Xavi M.

Thanx :slight_smile:
Yesterday I realised that you are correct, this is a job for HA Automations. I created a few automations to this in my house, and it works great.

And now to what I really miss in HA: One single place to configure specific automation areas like light and heating and one place to connect them together (scenes/automations). Right now it is way too fragmented and too many ways to get a result, but really hard to find a way to get good results. I love that HA is open and flexible and supports almost any thing you can think of, but I know it’s challenging even for a lot of people with good technical insight to do even basic stuff.
Another thing I really miss is frontends for configuring basic stuff like light and heating to lower the threshold and point users in the right direction.
From my perspective ControllerX is a step in the right direction as it is quite easy to do the basic stuff compared to the alternatives I have tested, but it’s hard to find and I guess a lot of potential users have fallen off before they find it.

– JT –

I totally agree with you @Autoper. Whatever you can do with ControllerX, you can also do it with HA automations, but it is very challenging. For this reason, I created ControllerX, so anyone could easily create controller-based automations. Basically, HA automations are generic, and ControllerX is specific.

The same as ControllerX is solution-specific, there is also Schedy but for scheduling (e.g. heating). It works on top of AppDaemon as well, and it allows you to schedule heaters and make sure when different heaters from your house should be on or off. HA automations can turn on/off entities based on time, but if for any reason the automation misses the trigger, it will not change the state of the entity. Whereas Schedy makes sure the entity is on/off based on the schedule configured, as well as having all configuration in one place. Maybe this helps you out with what you need.

Regards,
Xavi M.

As I mentioned as a response for your tip on how to use motion sensors in ControllerX I have moved the motion sensor part to HA Automations. There are two things I cannot figure out how to do:
1 - How to make sure the lights stays on as long as theres motion? I have set a two minute delay before the lights turn off and the lights turns off after two minutes no matter what.
2 - If someone uses a switch and activates a scene within the two minute delay I whant that scene to be active after the two minute delay has run out.

– JT –