ControllerX. Bring full functionality to light and media player controllers

{"linkquality":49,"battery":60,"action":""} is this the only log you see when pressing a button? It normally comes with the action it sends, something like:

zigbee2mqtt:info  2020-02-13 12:36:22: MQTT publish: topic 'zigbee2mqtt/bedroomjx_controller', payload '{"linkquality":33,"action":"toggle"}'
zigbee2mqtt:info  2020-02-13 12:36:22: MQTT publish: topic 'zigbee2mqtt/bedroomjx_controller', payload '{"linkquality":33,"action":""}'

Can you also send your appdaemon logs?

Hi @htvekov, thanks for the appreciation and I am glad that it saved you some time, which is probably the time I have spent on this already :stuck_out_tongue: . I have heard before of someone complaining about this with the Sonos as well. When I did this, I used a Google Home mini and it works perfectly on it, but there might be something different for the Sonos. What ControllerX does when pressing the button is to call the service media_player.volume_up. Can you answer these questions for me, so I can find a more generic solution?

  • When you go to Developer Tools > States and search for your Sonos, you can see the attribute volume_level, right?
  • If so, can you tell me what is the minimum and maximum value that can take?
  • And also, can you tell me how much it changes when media_player.volume_up is called (from service tab on Developer Tools as well).

If you answer these questions, I might be able to help you out. I would do it myself, but I do not possess a Sonos speaker. In fact, I would appreciate it if you open an issue on Github answering those question and describing what is the behavior now.

Thank you very much :slight_smile:

Hi’ Xavi. Sure, I only have a couple of minutes at the moment, but can make a ‘proper’ issue on Github later :slight_smile: Quick response for now. Sonos volume is from 0.00 to 1.00 (with 2 decimals). Your app (single tap button) and service call from HA both changes volume up/down with 0.02 intervals. If botton is kept pressed down, you app fires 7-8 times 0.02 interval changes and then stops. Eg. from 0.16 to 0.30

1 Like

Okay, I think I know how I can fix this. I would appreciate anyway if you open an issue later on about it. Thanks for your answer @htvekov

Sure, where can I find the appdaemon logs?

Depending how you have the appdaemon set up, but if you installed the addon from the “Supervisor” page using Home Assistant (fka hassio), you can access to the AppDaemon addon and from there, at the bottom, you can find the logs.

[18:33:46] INFO: Starting AppDaemon...
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 384, in main
    admain.main()
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 211, in main
    with open(config_file_yaml, 'r') as yamlfd:
FileNotFoundError: [Errno 2] No such file or directory: '/config/appdaemon/appdaemon.yaml'
[18:33:47] INFO: Starting AppDaemon...
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 384, in main
    admain.main()
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 211, in main
    with open(config_file_yaml, 'r') as yamlfd:
FileNotFoundError: [Errno 2] No such file or directory: '/config/appdaemon/appdaemon.yaml'
[18:33:49] INFO: Starting AppDaemon...
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 384, in main
    admain.main()
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 211, in main
    with open(config_file_yaml, 'r') as yamlfd:
FileNotFoundError: [Errno 2] No such file or directory: '/config/appdaemon/appdaemon.yaml'

It seems like you have a problem with your AppDaemon setup. I would recommend you to:

  • Copy your apps.yaml somewhere
  • Stop AppDaemon addon
  • Remove /config/appdaemon folder
  • Run AppDaemon addon
  • Your appdaemon.yaml should look like this:
---
secrets: /config/secrets.yaml
appdaemon:
  latitude: 52.379189
  longitude: 4.899431
  elevation: 2
  time_zone: Europe/Amsterdam
  plugins:
    HASS:
      type: hass
http:
  url: http://127.0.0.1:5050
hadashboard:
admin:
api:
  • Reinstall ControllerX
  • Past back the content of your apps.yaml
  • Restart AppDaemon addon.
  • Everything should work now.
1 Like

:pray: Thanks, you are fabulous!

1 Like

v2.2.1 is now released :partying_face:

This patch does not contain breaking changes

:hammer: Fixes

  • Fix Volume up/down - steps to small with Sonos speakers
  • Fix issues with smooth power on
  • Fix: Smooth power on when holding kept brightening up

Trying really hard to get this setup and I think I have the configuration right.

I am using an IKEA E1743

Everything is connected but it doesn’t seem to turn on/off the light it is connected to.

The below is what I am using in apps.yaml - does it look right, do I need to put any code anywhere else?

livingroom_controller:
  module: controllerx
  class: E1810Controller
  controller: sensor.0xccccccfffe8f7fb9_click
  integration: z2m
  light: light.shelly_shdm_1_d0acac
  actions:
    - on
    - off
    - brightness_up
    - brightness_down
    - brightness_stop

I can see the app is installed in AppDeamon4 and it does list callbacks when I press the button, but the state of the light does not change?

.

Edit: I am a fool! Just changed the configuration to

  class: E1743Controller

and it now works!!!

1 Like

Hi @chrissifer,
I saw you found the typo. On a side note, you don’t need to set the “actions” parameter if you are going to include all the options. This is in case you want the controller to just turn on/off for example, so then you would include the “on” and “off” actions in the list only.

Hi @xaviml

Yep, had another close look, and figured that one out! Serves me right for copying the first example I saw! Better learned on this now and works a treat!

Didn’t know about the options, so good to know if I want to remove certain functions. One question though, is there a way to step the brightness manually, like at the moment it steps up or down in 10% increments, can this be changed to say 5% or something?

I did try it using

manual_steps: 7

but this had no effect (probably not the right way to do it)

You have 2 paremeters to set the steps, the manual and the automatic. The manual has effect on clicks and the automatic for when the buttons are held.

The value they take is how many steps are required to go from min to max. So if the value is 2, it will go from 0% to 50% and 100%. If set to 3, then 0%, 33%, 66% and 100% (so 3 steps to go from 0% to 100%).

Basically, the higher the value, the smaller the steps are.

Hi @xavimi,

Is it possible to control switches (and group of switches) with E1810 E1743 ?

I was trying this:

test_switch:
  module: controllerx
  class: E1810Controller
  controller: sensor.0x000d6ffffe343d9c_action
  integration: z2m
  switch: switch.fibaro_system_fgs223_double_relay_switch_4

to get an on/off action

Indeed, light controller (the one you can pass a light attribute) uses the “homeassistant.turn_on/off” services to turn on/off lights, so it can be used for anything that turns on and off. If you want the E1743 to just turn on and off and not use the hold actions, then you can add “actions” to just use the on/off. It would be like:

test_switch:
  module: controllerx
  class: E1743Controller
  controller: sensor.sensor_action
  integration: z2m
  switch: switch.fibaro_system_fgs223_double_relay_switch_4
  actions:
    - on
    - off
1 Like

i was just wondering if controllerx support’s the new philips hue dimmer the one with off and on instead of the line and circle model via zha and if it will ever be supported

Hi @cooldude204,

Does the new hue dimmer uses different states (for z2m) or event (for deconz and zha) than the old one? If you have z2m or deconz, you can the implementation of the old controller you mention into the new one and check if it works. Let me know if it worked and if not, could you fill in this form to add the integration you have and the states or events fires.

First off great project!

I think I can do this myself based of the existing code, but a thought for a feature request. Custom Integration option?

One of my use cases is I use Lutron Pico remotes using the lutron-caseta-pro custom component, which pushes the pico button presses to sensors. What I was thinking was using automations to fire events based on the sensor changes. I could get press and release events for each button as the sensor. I could fake this by making the events match a current integration in the code, but was wondering if a custom integration method would make more sense. I know dimming from the Lutron Pico’s comes up from time to time on the forums.

Hi @tube0013,

First of all, thanks for the appreciation. If I understand correctly the lutron-caseta-pro maps the button states into sensors. I see that when no button is pressed the state of the sensor is 0, but when is pressed, it follows this mapping and then go back to 0. If this is correct, you will need to listen for states, which is what z2m integration does already. However, I think is a good idea to create a custom integration where you can set if you are listening for state or event and in case of event, what type of event, etc. I will consider this as a feature request, but in the meantime, the z2m integration should do the work.

I just released a beta version v2.3.0b2 with support to custom controllers, so you can map the button states to actions through yaml configuration. You can check the documentation for it in here. If you have any questions or you need help with the configuration, you can just sent a PM :slight_smile: