ControllerX. Bring full functionality to light and media player controllers

Thanks a lot! Works like a charm :slight_smile:

1 Like

Is it possible to use conditions, like time conditions in ControllerX. And if so, is it possible to use multiple conditions within one configuration?

Hi @Autoper ,

Yes, that is totally possible with AppDaemon constraints. It is an AppFsemon feature that allows you to customise this type of conditions. Time constraint is the one you might be interested for.

Regards,
Xavi M.

Thanks @xaviml

Brilliant! As you possible understand by now I’m not a coder, so here’s another stupid question: Is it possible to use constrains in the mapping part of the app? What I’m trying to acheive is one app to do different actions based on time of day. I know this is possible to do by making multiple apps, but it’s tidier to have it in one app.

– Jan-Tore –

Is it possible to tie ControllerX actions to specific times of the day?

Ideally, I want to change the lights on brightness to 100% if the time is before 8pm. Otherwise set the light on brightness to 30%. Currently I’m using an IKEA tradfri on/off switch. Works perfectly to turn on and off the light and adjust brightness with a long press. However, this little extra automated control would be a nice to have.

Hi @Autoper ,

Sorry, but it is not possible to do so with just one configuration, you will need one config for each time range.

Regards,
Xavi M.

Hi @Sentur,

Yes, that is possible with the time cosntraint I just recommended to @Autoper 2 comments ago.

You can specify a day range to define what to do. Then you can use merge_mappijg to assign to the toggle button to toggle the light at 30% or 100%.

If you paste in here your current configuration, I can modify it and show how that could be achieved.

Regards,
Xavi M.

Thanks for clarifying ans showing how it applies to my config. Here’s a snippet from my apps.yaml

master_bedroom_light_controller:
  module: controllerx 
  class: E1743Controller 
  controller: “84:fd:27:ff:fe:37:74:c2”
  integration: zha
  light: light.bedroom_bedside_lamp

Hi @sentur ,

The configuration you are looking for is the following:

master_bedroom_light_controller_day:
  module: controllerx 
  class: E1743Controller 
  controller: “84:fd:27:ff:fe:37:74:c2”
  integration: zha
  light: light.bedroom_bedside_lamp
  merge_mapping:
    "on":
      action: "on"
      attributes:
        brightness: 255 # This is the 100% brightness
  constrain_start_time: "07:30:00"
  constrain_end_time: "20:00:00"

master_bedroom_light_controller_night:
  module: controllerx 
  class: E1743Controller 
  controller: “84:fd:27:ff:fe:37:74:c2”
  integration: zha
  light: light.bedroom_bedside_lamp
  merge_mapping:
    "on":
      action: "on"
      attributes:
        brightness: 76 # This is the 30% brightness
  constrain_start_time: "20:00:00"
  constrain_end_time: "07:30:00"

As you can see, you can configure two different apps depending on the time of the day. It is important that they do not overlap with each other. The first will turn on the light always to 100% and the second one to 30%.

Regards,
Xavi M.

1 Like

Thank you for taking the time to explain the confirguration. It’s exactly what I want to achieve.

1 Like

I keep getting compile_error in the AppDeamon console

with this code:

mijn_app:
    module: controllerx
    class: E1810Controller
    controller: 00:0b:57:ff:fe:2b:ce:4f
    integration: zha
    light: light.ikea_of_sweden_tradfri_bulb_e27_cws_opal_600lm_810024fe_level_light_color_on_off

Hi @jurgen2005,

Could you please paste in here the AppDaemon logs? The configuration looks okay to me.

Regards,
Xavi M.

Hi @xaviml
Thanks for the amazing work on this one.
Just curious, is it possible with the E1810 xontroll to have it setup with the following in a zha configuration:

  • Click middle → Toggle (Light)
  • Click :high_brightness: → Open Cover (blind/curtain)
  • Click :low_brightness: → Close Cover (blind/curtain)
  • Click < → Open Cover 2 (blind/curtain)
  • Click > → Close Cover 2 (blind/curtain)

Have been trying different configurations with no luck. Any help would be appreciated.

You should be able to that if you apply custom mappings.

You can find some examples here: Examples | ControllerX

Hello trying to get this to work but remote is not responding to any action?
Got this in my apps.yaml file is this enough to get the ikea remote working with the selected lamp?

image

This is at the end of the logging of app deamon4
INFO AppDaemon: Initializing app tess_light using class E1810Controller from module controllerx
INFO tess_light: :video_game: ControllerX v4.16.0
INFO AppDaemon: App initialization complete

and some z2m logging:
Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess/action', payload 'brightness_up_click'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess', payload '{"action":"arrow_left_click","battery":47,"linkquality":48,"update":{"state":"idle"},"update_available":false}'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess', payload '{"action":"","battery":47,"linkquality":48,"update":{"state":"idle"},"update_available":false}'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess/action', payload 'arrow_left_click'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess', payload '{"action":"brightness_up_click","battery":47,"linkquality":48,"update":{"state":"idle"},"update_available":false}'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess', payload '{"action":"","battery":47,"linkquality":48,"update":{"state":"idle"},"update_available":false}'

Info MQTT publish: topic 'zigbee2mqtt/Remote-Tess/action', payload 'brightness_up_click'
@xaviml :slight_smile:

Hello,

After updating to HA 2021.10 and updating Zigbee2MQTT 1.21.2 My ControllerX - Appdaemon Ikea Symfonisk controllers are not responding anymore.

In Z2M I see all the volume increasing/decreasing from the Ikea E1744 controller coming by.

In the AppDaemon console I have not errors, everything looks ok, there is a connection with HA.

But noting works/responds anymore.

Anyone and idea?

Gr. Remco

Z2M config

permit_join: false
frontend:
  port: 8080
  host: 0.0.0.0
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://192.168.1.101'
serial:
  port: /dev/ttyUSB0
advanced:
  pan_id: 6756
  rtscts: false
  ikea_ota_use_test_url: true
devices:
  '0x680ae2fffe16ccdb':
    friendly_name: Volume1
    legacy: false
    simulated_brightness: true

Apps.yaml

Volume_keuken_app:
  module: controllerx
  class: E1744MediaPlayerController
  controller: sensor.volume1_action
  integration: z2m
  volume_steps: 50
  media_player: media_player.keuken_speaker

Zigbee2MQTT log:

Info MQTT publish: topic 'zigbee2mqtt/Volume1', payload '{"action":"","battery":74,"brightness":255,"linkquality":36,"rate":195,"update":{"state":"idle"},"update_available":false}'
Info MQTT publish: topic 'zigbee2mqtt/Volume1/action', payload 'brightness_move_down'
Info MQTT publish: topic 'zigbee2mqtt/Volume1', payload '{"action":null,"battery":74,"brightness":235,"linkquality":36,"rate":195,"update":{"state":"idle"},"update_available":false}'
Info MQTT publish: topic 'zigbee2mqtt/Volume1', payload '{"action":null,"battery":74,"brightness":215,"linkquality":36,"rate":195,"update":{"state":"idle"},"update_available":false}'
Info MQTT publish: topic 'zigbee2mqtt/Volume1', payload '{"action":"brightness_stop","battery":74,"brightness":215,"linkquality":36,"rate":195,"update":{"state":"idle"},"update_available":false}'
Info MQTT publish: topic 'zigbee2mqtt/Volume1', payload '{"action":"","battery":74,"brightness":215,"linkquality":36,"rate":195,"update":{"state":"idle"},"update_available":false}'
Info MQTT publish: topic 'zigbee2mqtt/Volume1/action', payload 'brightness_stop'

AppDaemon log:

2021-10-12 10:07:26.916048 INFO AppDaemon: App initialization complete
2021-10-12 10:07:26.876061 INFO Volume_keuken_app: 🎮 ControllerX v4.16.0
2021-10-12 10:07:26.791160 INFO AppDaemon: Initializing app Volume_keuken_app using class E1744MediaPlayerController from module controllerx

Now i am using this as code and it is reacting but i can only set it on / off no color change or brightness?? am i missing some options in the config or should this work like this?

tess_light:
module: controllerx
class: E1810Controller
controller: sensor.remote_tess_action
integration: z2m
light: light.lamp_tess

Hi @andrewduma,

Yes, that is totally possible with custom mapping. There are different way of achieving the same, but this is how I would do it:

example_app:
  module: controllerx
  class: Controller
  integration: zha
  mapping:
    toggle:
      service: light.toggle
      entity_id: light.my_light
    step_with_on_off_0_43_5:
      service: cover.open_cover
      entity_id: cover.my_first_cover
    step_1_43_5:
      service: cover.close_cover
      entity_id: cover.my_first_cover
    press_257_13_0:
      service: cover.open_cover
      entity_id: cover.my_second_cover
    press_256_13_0:
      service: cover.close_cover
      entity_id: cover.my_second_cover

This would do exactly what you want, however, you have some events (buttons) that are not being used, so you could use the light controller and override those actions for what you want. Therefore, the rest of the events (hold actions mainly) would interact with the light to change brightness and color of your light:

example_app:
  module: controllerx
  class: E1810Controller
  integration: zha
  light: light.my_light
  merge_mapping:
    step_with_on_off_0_43_5:
      service: cover.open_cover
      entity_id: cover.my_first_cover
    step_1_43_5:
      service: cover.close_cover
      entity_id: cover.my_first_cover
    press_257_13_0:
      service: cover.open_cover
      entity_id: cover.my_second_cover
    press_256_13_0:
      service: cover.close_cover
      entity_id: cover.my_second_cover

As you can see, the toggle is not necessary since that is what the E1810Controller is already doing with the middle button.

Hope this helps you understand how it works.

Regards,
Xavi M.

Hi @lars86,

If you set up Zigbee2MQTT integration to listen to MQTT (listen_to: mqtt), then you need to configure the /config/appdaemon/appdaemon.yaml file. I recommend you reading the Zigbee2MQTT (and MQTT) section of this page.

Let me know if you have any questions.

Regards,
Xavi M.

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!