ControllerX. Bring full functionality to light and media player controllers

Can someone explain me how this is working? Where do you get the info where you are?

So Iā€™ve got my round ikea controllers working perfectly with some Tradfri lights (z2m). But now I can no longer control the colour or colour temperature in lovelace or when programming scenes. Did I do something wrong or is this normal behaviour?

Installed Controllerx and seems to be working. In the log, I see these warnings. Ok to ignore?

2020-07-11 09:03:36.133215 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_devices to module import path
2020-07-11 09:03:36.223080 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_version.py - ignoring
2020-07-11 09:03:36.227305 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2020-07-11 09:03:38.668215 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_const.py - ignoring
2020-07-11 09:03:38.672391 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/color_helper.py - ignoring
2020-07-11 09:03:38.676352 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/__init__.py - ignoring
2020-07-11 09:03:38.680167 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/controller.py - ignoring
2020-07-11 09:03:38.684138 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/custom_controller.py - ignoring
2020-07-11 09:03:38.688013 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py - ignoring
2020-07-11 09:03:38.691822 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/cover_controller.py - ignoring
2020-07-11 09:03:38.695727 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/light_controller.py - ignoring
2020-07-11 09:03:38.699969 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/__init__.py - ignoring
2020-07-11 09:03:38.704256 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py - ignoring
2020-07-11 09:03:38.708461 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/circular_stepper.py - ignoring
2020-07-11 09:03:38.712618 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/__init__.py - ignoring
2020-07-11 09:03:38.716886 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/minmax_stepper.py - ignoring
2020-07-11 09:03:38.721325 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/z2m.py - ignoring
2020-07-11 09:03:38.725733 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/zha.py - ignoring
2020-07-11 09:03:38.730229 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/deconz.py - ignoring
2020-07-11 09:03:38.734481 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/state.py - ignoring
2020-07-11 09:03:38.738585 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/__init__.py - ignoring
2020-07-11 09:03:38.742592 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/mqtt.py - ignoring
2020-07-11 09:03:38.746432 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/cover.py - ignoring
2020-07-11 09:03:38.750447 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/media_player.py - ignoring
2020-07-11 09:03:38.754352 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/light.py - ignoring
2020-07-11 09:03:38.758499 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py - ignoring
2020-07-11 09:03:38.762351 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/smartthings.py - ignoring
2020-07-11 09:03:38.766410 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/trust.py - ignoring
2020-07-11 09:03:38.770207 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/__init__.py - ignoring
2020-07-11 09:03:38.774167 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/ikea.py - ignoring
2020-07-11 09:03:38.778029 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/philips.py - ignoring
2020-07-11 09:03:38.782425 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/lutron.py - ignoring
2020-07-11 09:03:38.786298 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aqara.py - ignoring
2020-07-11 09:03:38.789876 INFO AppDaemon: Initializing app computer_room using class E1810Controller from module controllerx
2020-07-11 09:03:38.795141 INFO AppDaemon: Initializing app living_room using class E1810Controller from module controllerx
2020-07-11 09:03:38.800291 INFO AppDaemon: Initializing app shion_room using class E1810Controller from module controllerx
2020-07-11 09:03:41.444204 INFO computer_room: šŸŽ® ControllerX v3.1.0
2020-07-11 09:03:41.472841 INFO living_room: šŸŽ® ControllerX v3.1.0
2020-07-11 09:03:41.487445 INFO shion_room: šŸŽ® ControllerX v3.1.0
2020-07-11 09:03:41.503054 INFO AppDaemon: App initialization complete

Very promising and works great! Iā€™ve never used AppDaemon before, but itā€™s starting to make sense now and got this working. One question though: is it possible to add conditions? For instance, I want to use a controller for multiple devices, depending on which one is turned on (media player). I have multiple Google Cast groups, but only one is active at a time. This way I have one remote to control ā€˜music audio of my homeā€™ instead of a specific media player.

Right now I have that working with automations. Works great, but Iā€™d rather use this instead of multiple automations.

Hi @romero_124,

This looks like a great idea. We will probably need to play around with constrain callbacks to do this. I have the E1810 and 2 lights, I will see what I am capable to do and let you now with my results :slight_smile:

Hi @carsten_h,

The example is to show what ControllerX is capable of, it assumes you have a sensor indicating in which room you are in. This is something not easy to solve, which I have not set up in my house, but I know of the following project, Room Assistant, and I might give it a try one day.

Hi @liselotte111,

ControllerX calls HA services, the same you can do on ā€œDeveloper Tools > Servicesā€, so it should not interfere with Lovelace. If you shutdown the AppDaemon addon, you are still not able to use lovelace to control your lights?

Hi @duceduc,

Yes, this is totally fine. AppDaemon is meant to be use with small files where you place automation in them. However, if a python file does not contain an automation, then AppDaemon will throw this warning. ControllerX needs to work with several files in order to easily expand functionality, otherwise it would be very hard to maintain.

Documentation says the following about appdaemon.yaml configuration:

missing_app_warnings (optional) - by default, AppDaemon will log a warning if it finds a python file that has no associated configuration in an apps.yaml file. If this parameter is set to 1 the warning will be suppressed. This allows non-appdaemon python files to be distributed along with apps.

Iā€™ve done something similar and Iā€™ve used a group where I fill in the entity thatā€™s playing ControllerX. Bring full functionality to light and media player controllers

1 Like

Hi @ASNNetworks,

So if I understand well, you already have a group entity that automatically changes with the media player is playing? This is exactly what I have with my TV and my google home mini, the ControllerX (needed >= v3.1.0) configuration looks like the following:

livingroom_speakers:
  module: controllerx
  class: E1744MediaPlayerController
  controller: livingroom_mplayer_controller
  integration: deconz
  media_player: group.livingroom_current_media_player
  update_supported_features: true
  volume_steps: 15
  delay: 150

So basically, you can pass the group entity as a media_player and it is important to have update_supported_features to true, so it can get the supported_features of the device every time it needs them before taking an action. The rest is just specific configuration for my device.

However, if what you want is to have a single controller that depending on the button you press, it will work for one media player or another one, then you will need to create different configurations with different mapping and use CustomMediaPlayerController. You can check the example page to get some ideas.

Let me know if this is what you wanted, otherwise, could you specify what you want you currently have?

Cheers,
Xavi M.

Yes, exactly. I actually took this from you @Sennevds, sorry for not mentioning it, but it works really well for my setup since I have a Symfonisk and I can control my TV and my Google Home mini depending which one is playing. It is a smart solution, I love it!

Do you have the symfonisk remote working? I have them connected to deconz but after a while I donā€™t receive any events in Hass from them.

Hi thanks for responding so quickly! Right now I do not have a group with different entities inside them. I have actual Google Cast groups (which contain different sets of Google Cast speakers). Then I have created multiple automations for individual Google Cast speakers and Cast Groups (which are individual entities inside HA). There I have setup conditions where I work with priorities basically. The volume works for my Sony speaker, ONLY if itā€™s playing AND if a Cast Group is not on where the speaker is part of.

Iā€™ve done that for all my speakers and it works great. The downside is that I have around 15 automations this way for all the different variables.

But Iā€™ll look into the group option you mentioned. @Sennevds mentioned that as well above you I see.

Also one more question: is it possible to change the volume amount? Right now it changes it with 10% which is way too much (which is +5 volume on my receiver). With my automation I use a service call to change it with 0.02 each time (which translates to +1 volume on my receiver), which works great. This is my automation for volume up:

  - data_template:
      volume_level: '{{ states.media_player.multispeakers_cast.attributes.volume_level
        + 0.02 }}'
    entity_id: media_player.multispeakers_cast
    service: media_player.volume_set

Can I change this inside the AppDaemon somewhere?

You can also check callback constraints, it is an AppDaemon feature that allows you to activate an application depending on conditions. For example, this following ControllerX configuration only works if the media player is playing or paused:

example_app:
  module: controllerx
  class: E1810MediaPlayerController
  controller: controller_id
  integration: your integration
  media_player: media_player.your_media_player player
  constrain_input_select: media_player.your_media_player,playing,paused

With this, you can play around and create several configurations with different conditions.

Yes, you can change the volume_steps, this is the configuration I have for my media players:

livingroom_speakers:
  module: controllerx
  class: E1744MediaPlayerController
  controller: livingroom_mplayer_controller
  integration: deconz
  media_player: group.livingroom_current_media_player
  update_supported_features: true
  volume_steps: 15
  delay: 150

This will take 15 steps from minimum to max volume, so the higher the value, the more steps take to go from one end to another. Default is 10.

1 Like

Yes, I have 1 symfonisk and it works flawlessly with deconz. I must say that I donā€™t have too many devices connected to the network and also the remote is near the Conbee stick.

Works great, thanks!

1 Like

After reconnecting for the fourth time it looks like the remote is keeping itā€™s connection. Itā€™s very nice to have a remote hanging everywhere so you can always change the volume or skip a song.

1 Like

Hi @romero_124,

Not sure how good the solution is, but this is what I could come up with with my bedroom and office lights:

.base_code: &base_code
  module: controllerx
  class: E1810Controller
  controller: zigbee2mqtt/livingroom_controller/action
  integration: mqtt
case1:
  <<: *base_code
  light: light.bedroom
  actions: [toggle]
  constrain_input_boolean: light.office,on
  constrain_input_select: light.bedroom,off
case2:
  <<: *base_code
  light: light.office
  actions: [toggle]
  constrain_input_boolean: light.office,on
  constrain_input_select: light.bedroom,on
case3:
  <<: *base_code
  light: light.bedroom
  actions: [toggle]
  constrain_input_boolean: light.office,off
  constrain_input_select: light.bedroom,on
case4:
  <<: *base_code
  light: light.office
  actions: [toggle]
  constrain_input_boolean: light.office,off
  constrain_input_select: light.bedroom,off
light_control_office:
  <<: *base_code
  light: light.office
  constrain_input_boolean: light.office,on
  excluded_actions: [toggle]
light_control_bedroom:
  <<: *base_code
  light: light.bedroom
  constrain_input_boolean: light.bedroom,on
  excluded_actions: [toggle]

This makes use of YAML anchors which is great to not repeat yourself. However, AppDaemon currently is not able to ignore the base configs, but I open a PR for it. This means that you might see an error in the logs when doing it with the base_code app, but it is fine, you can just ignore it. Or you can copy and paste the common code in the application configuration and delete the base_code one.

I have tried this and it does exactly what you asked for, however, it is quite hacky I would say, if you want to add a third light, there is no way to make it work like this since callback constraints do not support multiple conditions AFAIK, this is why I had to use the input_boolean and the input_select one.

1 Like

v3.2.0 is now released :partying_face:

downloads
This minor change does not contain breaking changes.

:pencil2: Features

  • Add specific parser for ZHA device to easily add support to ZHA controllers [ #97 ]

:hammer: Fixes

  • Ikea E1744 fixed for z2m version 1.14.1 [ #96 ]

:video_game: New devices

  • WXKG01LM - add light controller support for ZHA [ #94 ]
  • MFKZQ01LM - add light controller support for ZHA