ControllerX. Bring full functionality to light and media player controllers

Hi @rodolfo

I do not see in here why it does not work. Could you please show the full log from AppDaemon including when you click the controller?

The apps.yaml seems correct to me.

Zigbee2Mqtt recognized the clicks as shown:

‘{“battery”:100,“voltage”:3035,“illuminance”:39,“linkquality”:63,“occupancy”:true,“illuminance_lux”:39}’
zigbee2mqtt:info 2020-03-15 22:13:39: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:60,“counter”:1,“brightness”:255,“action”:“off-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:13:39: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:60,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:13:40: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:63,“counter”:1,“brightness”:255,“action”:“off-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:13:40: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:63,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:04: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“on-hold”,“duration”:0.83}’
zigbee2mqtt:info 2020-03-15 22:14:04: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:05: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“on-hold-release”,“duration”:1.262}’
zigbee2mqtt:info 2020-03-15 22:14:05: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:06: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:89,“counter”:1,“brightness”:255,“action”:“on-hold”,“duration”:0.8}’
zigbee2mqtt:info 2020-03-15 22:14:06: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:89,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:07: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“on-hold”,“duration”:1.582}’
zigbee2mqtt:info 2020-03-15 22:14:07: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:08: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“on-hold”,“duration”:2.378}’
zigbee2mqtt:info 2020-03-15 22:14:08: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:08: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“on-hold-release”,“duration”:2.797}’
zigbee2mqtt:info 2020-03-15 22:14:08: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:09: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“up-hold”,“duration”:0.764}’
zigbee2mqtt:info 2020-03-15 22:14:09: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:10: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“up-hold”,“duration”:1.572}’
zigbee2mqtt:info 2020-03-15 22:14:10: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:11: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“up-hold”,“duration”:2.379}’
zigbee2mqtt:info 2020-03-15 22:14:11: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:12: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“up-hold-release”,“duration”:3.009}’
zigbee2mqtt:info 2020-03-15 22:14:12: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:86,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:13: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:49,“counter”:1,“brightness”:255,“action”:“up-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:14:13: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:49,“counter”:1,“brightness”:255,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:14: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:191,“action”:“down-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:14:14: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:191,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:191,“action”:“down-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:191,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:159,“action”:“down-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:52,“counter”:1,“brightness”:159,“action”:“”}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:55,“counter”:1,“brightness”:127,“action”:“down-press”,“duration”:0}’
zigbee2mqtt:info 2020-03-15 22:14:15: MQTT publish: topic ‘zigbee2mqtt/Mando_HUE1’, payload ‘{“battery”:66.5,“linkquality”:55,“counter”:1,“brightness”:127,“action”:“”}’

Appdaemon Logs does not have anything related to the clicks…

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-banner.sh: executing…

Add-on: AppDaemon 4
Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.2.3
You are running the latest version of this add-on.
System: HassOS 3.12 (amd64 / qemux86-64)
Home Assistant Core: 0.106.5
Home Assistant Supervisor: 209

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing…
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:16:41] INFO: Starting AppDaemon…
2020-03-15 22:16:42.139700 INFO AppDaemon: AppDaemon Version 4.0.3 starting
2020-03-15 22:16:42.140387 INFO AppDaemon: Python version is 3.8.2
2020-03-15 22:16:42.140859 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-03-15 22:16:42.141268 INFO AppDaemon: Added log: AppDaemon
2020-03-15 22:16:42.141699 INFO AppDaemon: Added log: Error
2020-03-15 22:16:42.142105 INFO AppDaemon: Added log: Access
2020-03-15 22:16:42.142492 INFO AppDaemon: Added log: Diag
2020-03-15 22:16:42.159708 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-03-15 22:16:42.180824 INFO HASS: HASS Plugin Initializing
2020-03-15 22:16:42.181601 INFO HASS: HASS Plugin initialization complete
2020-03-15 22:16:42.182468 INFO AppDaemon: Initializing HTTP
2020-03-15 22:16:42.183154 INFO AppDaemon: Using ‘ws’ for event stream
2020-03-15 22:16:42.197946 INFO AppDaemon: Starting API
2020-03-15 22:16:42.202742 INFO AppDaemon: Starting Admin Interface
2020-03-15 22:16:42.203557 INFO AppDaemon: Dashboards Disabled
2020-03-15 22:16:42.214674 INFO HASS: Connected to Home Assistant 0.106.5
2020-03-15 22:16:42.240766 INFO AppDaemon: App ‘hello_world’ added
2020-03-15 22:16:42.241812 INFO AppDaemon: App ‘mando1_controller’ added
2020-03-15 22:16:42.242891 INFO AppDaemon: Found 2 total apps
2020-03-15 22:16:42.243643 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2020-03-15 22:16:42.245700 INFO AppDaemon: Running on port 5050
2020-03-15 22:16:42.277806 INFO HASS: Evaluating startup conditions
2020-03-15 22:16:42.304246 INFO AppDaemon: Got initial state from namespace default
2020-03-15 22:16:42.520029 INFO AppDaemon: New client Admin Browser connected
2020-03-15 22:16:44.253453 INFO AppDaemon: Scheduler running in realtime
2020-03-15 22:16:44.264454 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-03-15 22:16:44.266259 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2020-03-15 22:16:44.267592 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/devices to module import path
2020-03-15 22:16:44.268856 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core to module import path
2020-03-15 22:16:44.270140 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/type to module import path
2020-03-15 22:16:44.271386 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/integration to module import path
2020-03-15 22:16:44.272653 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/stepper to module import path
2020-03-15 22:16:44.297973 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-03-15 22:16:44.304439 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/const.py - ignoring
2020-03-15 22:16:44.305864 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2020-03-15 22:16:44.328541 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/aqara.py - ignoring
2020-03-15 22:16:44.330254 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/philips.py - ignoring
2020-03-15 22:16:44.331760 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/trust.py - ignoring
2020-03-15 22:16:44.333417 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/init.py - ignoring
2020-03-15 22:16:44.335057 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/ikea.py - ignoring
2020-03-15 22:16:44.336541 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/lutron.py - ignoring
2020-03-15 22:16:44.338158 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/smartthings.py - ignoring
2020-03-15 22:16:44.339806 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/light_features.py - ignoring
2020-03-15 22:16:44.341368 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/controller.py - ignoring
2020-03-15 22:16:44.342835 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/init.py - ignoring
2020-03-15 22:16:44.344440 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/custom_controller.py - ignoring
2020-03-15 22:16:44.345959 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/media_player_controller.py - ignoring
2020-03-15 22:16:44.347389 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/light_controller.py - ignoring
2020-03-15 22:16:44.348793 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/init.py - ignoring
2020-03-15 22:16:44.350274 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/state.py - ignoring
2020-03-15 22:16:44.351721 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/zha.py - ignoring
2020-03-15 22:16:44.353147 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/init.py - ignoring
2020-03-15 22:16:44.354925 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/deconz.py - ignoring
2020-03-15 22:16:44.356434 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/z2m.py - ignoring
2020-03-15 22:16:44.357869 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/minmax_stepper.py - ignoring
2020-03-15 22:16:44.359269 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/circular_stepper.py - ignoring
2020-03-15 22:16:44.360667 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/init.py - ignoring
2020-03-15 22:16:44.361940 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-03-15 22:16:44.363599 INFO AppDaemon: Initializing app mando1_controller using class HueDimmerController from module controllerx
2020-03-15 22:16:44.433000 INFO hello_world: Hello from AppDaemon
2020-03-15 22:16:44.434740 INFO hello_world: You are now ready to run Apps!
2020-03-15 22:16:44.445904 INFO AppDaemon: App initialization complete

Hi @rodolfo,

It is interesting, I am not able to spot the mistake. Could you answer the following questions:

  • I know it goes quick, but do you see the changes also in HA in sensor.mando_hue_1_action?
  • Which light do you have?
  • So you don’t see any change in the light when pressing or holding any button?

Thank you

Hi Xavi

The Light is a Ikea Tradfri Bulb with a E27 connector. I do not see any change in the light when pressing the buttons and I would say that also there is no activity in the HA sensor.

Happy to help debugging the issue with any change if needed.

So you can’t see any sensor events in HA like this for eg. ?

image

Your card would look diffently, though, as I use Rob Mark Cole’s Hue Sensor advanced HA integration for Hue dimmers connected to Hue bridge.

But you should see some sensor action in HA, when buttons are pressed.

Hi htvekov

No, I don’t see any activity at all in HA, but I can see the events in the zigbee2mqtt logs. (Thanks to xaviml who helped me to narrow the problem to this part)

The device was added to HA through zigbee discovery and sincronization.

@rodolfo
I see in your z2m logs that your topic is

If this is case, you’ve added an underscore to your sensor and your config should be:

mando1_controller:
  module: controllerx
  class: HueDimmerController
  controller: sensor.mando_hue1_action
  integration: z2m
  light: light.salon7_mesa_light

Hi @sreknob

I talked to him in private messages and all his configuration was correct and also appdaemon. The problem we found was that the sensors were unavailable and I made him create a HA automation with the sensor and it did not work. I don’t know if @rodolfo figured out what was causing the sensor to be unavailable.

Sorry for not updating the findings in here. Thank you @sreknob and @htvekov for the help.

Thanks @sreknob but hat is not the issue but a small difference between the friendly name of the zigbee device and the sensor in HA.

I still have not figured out what can be wrong. Tomorrow I’ll try to add another spare switch I have to test if it’s related to the device or caused by the name change in zigbee.

I’ll keep the thread informed. Thanks all.

What MQTT broker are you using and do you have the retain flag set?
Just wondering if it could be something like this issue which was resolved with some MQTT changes.

Hi @sreknob, I’m using the default MQTT plugin from hassio with no special flags.

Surprisingly a full restart of the environment has solved (at least initially) the issue. No idea what was the origin or if it is going to replicate later or the origin of the issue.

I still need to add a second switch so we will see if it happens again.

Thanks for your help.

2 Likes

Would love having that RGB Genie "3 Scene Color Touch Panel and Dimmer (ZigBee) White or Black controller supported:
[https://rgbgenie.com/?product=zigbee-color-touch-panel-and-dimmer-white-zigbee


Contact at RGB Genie : Sean Gnant ([email protected])
Note: I certify that I have no affiliation / involvement / interest in that company.

What do you think?

Hi @dede34fr

Do you possess one of those controllers? If so, which integration do you have it integrated. I assume it is z2m, if so, can you send in here the different states the controller sensor gets when pressing and holding the buttons?

Thank you,
Xavi M.

Ordered one but waiting for delivery (delay due to Covid19)

1 Like

Once you have, let me know of all the states that the controller sends, so I can map those states to a default a behaviour. Thank you for your collaboration @dede34fr :slight_smile:

HueDimmerController and output device other than light bulb.

I’ve had the Hue dimmer controlling wall plug without any issues for a while now. But since HA upgrade to 0.107.x, when I press ON (on-press), it will not turn ON and I get error

WARNING HASS: Code: 400, error: 400: Bad Request
WARNING HASS: Error calling Home Assistant service default/homeassistant/turn_on

I’ve tried other plugs and wall switches with same results.
Strange thing is, the OFF press works just fine.
Using CallServiceController works and so does HueDimmerController when it’s used with a light bulb.

I tried restarting HA, AppDaemon, Z2m, downgraded ControllerX to v2.3.1

Not sure what else I could try.

Hi @xaviml and all the others!

First of all, thanks xaviml for the great work, you saved lots of hours of my life.

I finally got it working with “E1810Controller” and “Ikea E27 tradfri 1000lumen bulbs”.
However, I noticed one strange behavior with “E1743Controller” and one “Ikea E27 tradfri 806lumen bulb”. When I press the E1743 switch “on”, the bulb will light up always with full brightness value of “255” and it doesn’t remember the last brightness state. With E1810 controller I didn’t noticed this problem. Have you guys encountered the same problem?

Btw RGB Genie is already supported by zigbee2mqtt:
https://www.zigbee2mqtt.io/devices/ZGRC-KEY-013.html

Hi @Woodcat64,

Since v2.3.0 ControllerX sends also a “transition” attribute when the light is turn on. Apparently, HA used to work with that attribute when calling it to a non light entity, but not anymore. I am afraid, you cannot used the light controller anymore for a switch, this is why I recommend you to use CallServiceController. Here is an example of what you can do:

custom_hue_dimmer_example:
  module: controllerx
  class: CallServiceController
  controller: <your sensor>
  integration: z2m
  light: light.office
  mapping:
    up-press:
      service: switch.turn_on
      data:
        entity_id: switch.example_switch
    down-press:
      service: switch.turn_off
      data:
        entity_id: switch.example_switch

Sorry for the breaking change. I hope this fix your problem :slight_smile:

Hi @sebul0n,

First of all thanks for the appreciation. Secondly, I am sorry for what you are experiencing. However, when the light is turn on and off, ControllerX calls the HA services:

  • homeassistant.turn_on
  • homeassistant.turn_off

The only difference is that is automatically adds a “transition” attribute. Therefore, could you try from “Developer tools > Services” if adding a transition (for example 0 or 100) or not makes a difference on what you are experiencing with the controller.

I do not experience this with my lights, but it could be that your lights do not support transition. So could you also send me the value of the supported_features from the state attribute of your light?

Thanks :slight_smile: