ControllerX. Bring full functionality to light and media player controllers

Just blurred a little bit the IDs so @sreknob don’t get mad at me :wink:

I have to apps folders:

  1. ~/dockerdisco2/volumes/ha-data/appdaemon/apps/ ==> was created because of HACS
  2. ~/dockerdisco2/volumes/AppDaemon/conf/apps ==> was created becasue of docker-compose.yaml

The one which contains the apps.yaml file is under the following path:

luiscarlos@luisnuc:~/dockerdisco2/volumes/AppDaemon/conf/apps$ ls
apps.yaml  apps.yaml.example  hello.py  __pycache__
luiscarlos@luisnuc:~/dockerdisco2/volumes/AppDaemon/conf/apps$ pwd
/home/luiscarlos/dockerdisco2/volumes/AppDaemon/conf/apps
luiscarlos@luisnuc:~/dockerdisco2/volumes/AppDaemon/conf/apps$

Thanks again!

All AppDaemon apps should go together where apps.yaml is, so the controllerx folder should go in ~/dockerdisco2/volumes/AppDaemon/conf/apps/. I don’t know if there is a way in HACS of changing the AppDaemon path. But if you move the folder there and then restart AppDaemon, it should work.

So you should have the const.py in: ~/dockerdisco2/volumes/AppDaemon/conf/apps/controllerx/const.py

After doing: ~/dockerdisco2/volumes/ha-data/appdaemon/apps$ sudo cp -r controllerx /home/luiscarlos/dockerdisco2/volumes/AppDaemon/conf/apps/

It looks like this:

luiscarlos@luisnuc:~/dockerdisco2/volumes/AppDaemon/conf/apps$ ls
apps.yaml  apps.yaml.example  controllerx  hello.py  __pycache__

I get the following Warnings on my AppDaemon Docker container log:

2020-02-25 23:20:09.348758 INFO AppDaemon: Adding /conf/apps/controllerx to module import path


2020-02-25 23:20:09.349251 INFO AppDaemon: Adding /conf/apps/controllerx/devices to module import path


2020-02-25 23:20:09.349633 INFO AppDaemon: Adding /conf/apps/controllerx/core to module import path


2020-02-25 23:20:09.349973 INFO AppDaemon: Adding /conf/apps/controllerx/core/stepper to module import path


2020-02-25 23:20:09.350300 INFO AppDaemon: Adding /conf/apps/controllerx/core/type to module import path


2020-02-25 23:20:09.350636 INFO AppDaemon: Adding /conf/apps/controllerx/core/integration to module import path


2020-02-25 23:20:09.367687 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/const.py - ignoring


2020-02-25 23:20:09.368665 INFO AppDaemon: Loading App Module: /conf/apps/controllerx/controllerx.py


2020-02-25 23:20:09.394705 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/devices/ikea.py - ignoring


2020-02-25 23:20:09.395718 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/devices/__init__.py - ignoring


2020-02-25 23:20:09.396531 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/devices/aqara.py - ignoring


2020-02-25 23:20:09.397328 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/devices/philips.py - ignoring


2020-02-25 23:20:09.398011 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/__init__.py - ignoring


2020-02-25 23:20:09.398653 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/controller.py - ignoring


2020-02-25 23:20:09.399238 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/stepper/__init__.py - ignoring


2020-02-25 23:20:09.399836 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/stepper/minmax_stepper.py - ignoring


2020-02-25 23:20:09.400432 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/stepper/circular_stepper.py - ignoring


2020-02-25 23:20:09.401025 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/type/__init__.py - ignoring


2020-02-25 23:20:09.401714 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/type/media_player_controller.py - ignoring


2020-02-25 23:20:09.402345 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/type/light_controller.py - ignoring


2020-02-25 23:20:09.402860 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/integration/zha.py - ignoring


2020-02-25 23:20:09.403423 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/integration/__init__.py - ignoring


2020-02-25 23:20:09.403928 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/integration/z2m.py - ignoring


2020-02-25 23:20:09.404442 WARNING AppDaemon: No app description found for: /conf/apps/controllerx/core/integration/deconz.py - ignoring


2020-02-25 23:20:09.404888 INFO AppDaemon: Initializing app Luz_Mesa_Comedor_controller_IKEA_E1810 using class E1810Controller from module controllerx

The Ikea Smart Button works, but it onlye change the brightness and the color temperature once!

It’s almost done! thanks a lot @xaviml @sreknob

1 Like

Awesome @Carlos_Luis! So happy you got it up and running, now you can experience the awesome-ness in all it’s glory.

Also, I won’t get mad about those IDs :slight_smile:

Don’t worry about the warnings, it’s normal for ControllerX due to the structure of the app.

As far as the file/folder structure for appdaemon, I have my loaded inside my home-assistant configuration directory. I hadn’t payed attention to that before in your configs.

This is what mine looks like:
My docker mount point is '/mnt/user/appdata/home-assistant/appdaemon/':'/conf'
so all my files are where HACS expect them to be with minimal fuss and can update them directly from within HA.

appdaemon.yaml should be in appdaemon folder (/conf directory in the container) and apps.yaml should be in apps inside appdaemon folder as such:

Capture

I would consider changing your docker mount point to
'/home/luiscarlos/dockerdisco2/volumes/ha-data/appdaemon':'/conf'
to avoid trouble…

2 Likes

Thanks a lot! I finally got it ! @sreknob @xaviml
thanks as well for sharing your screenshot. I will change the path tomorrow, today I have not more time available.

1 Like

v2.3.0 is now released :partying_face:

This minor change does not contain breaking changes.

:pencil2: Features

  • Support for custom controllers (#12)
  • Adding new predefined function for media players: next_source, previous_source
  • E1810MediaPlayerController execute next and previous source when arrows are held
  • Support for custom arguments to integrations @crserran
  • New integration: State. This is just an integration that works like z2m, but it might change in the future.
  • Being able to change minimum/maximum brightness/color temp from yaml (#41)

:video_game: New devices

  • Support for Xiaomi Aqara Smart Cube (z2m, deconz) @crserran
  • Support for Xiaomi single switches WXKG12LM and WXKG01LM (z2m)
  • Support for IM6001-BTP01, a SmartThings button (z2m, deconz, zha) @sreknob
  • Support for LZL4BWHL01, a Lutron controller (deconz, zha) @sreknob
  • Support for Lutron Caseta Pro Pico (state) @sreknob
  • Support for ZYCT-202, a Trust controller (z2m)

Special thanks to @htvekov for all the bug hunting and testing.

4 Likes

After the update and restart of AppDaemon, I defined the following:

tvroom:
  module: controllerx
  class: CustomLightController
  controller: sensor.0x000d6ffffe343d9c_action
  integration: z2m
  light: light.0xec1bbdfffe36260f_light
  mapping:
    brightness_up_click: on_full_brightness
    brightness_down_click: on_min_brightness
    brightness_up_hold: on_full_brightness
    brightness_down_hold: on_min_brightness

but :disappointed_relieved: I get this in the AppDaemon log

2020-02-27 17:58:47.351952 INFO hello_world: Hello from AppDaemon
2020-02-27 17:58:47.354042 INFO hello_world: You are now ready to run Apps!
2020-02-27 17:58:47.360014 INFO alexa_talking_clock: INITIALIZE start:2020-02-27 18:00:00.357418, frequency:60, times:[0]
2020-02-27 17:58:47.375836 WARNING AppDaemon: Unable to find module tvroom - initialize() skipped
2020-02-27 17:58:47.377311 INFO AppDaemon: App initialization complete

Hi @Doublet

Have you restart the Appdaemon addon/server?

yes, I did

Are those all the logs you see? Can you show all the logs to see if there is something else we are missing?

-----------------------------------------------------------
 Add-on: AppDaemon 4
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.2.1
 You are running the latest version of this add-on.
 System: Raspbian GNU/Linux 10 (buster)  (armv7 / raspberrypi4)
 Home Assistant Core: 0.106.0
 Home Assistant Supervisor: 201
-----------------------------------------------------------
 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.
[18:35:33] INFO: Starting AppDaemon...
2020-02-27 18:35:34.872900 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-27 18:35:34.873561 INFO AppDaemon: Python version is 3.8.1
2020-02-27 18:35:34.873952 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-02-27 18:35:34.874394 INFO AppDaemon: Added log: AppDaemon
2020-02-27 18:35:34.874791 INFO AppDaemon: Added log: Error
2020-02-27 18:35:34.875231 INFO AppDaemon: Added log: Access
2020-02-27 18:35:34.875584 INFO AppDaemon: Added log: Diag
2020-02-27 18:35:34.909639 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-02-27 18:35:34.945673 INFO HASS: HASS Plugin Initializing
2020-02-27 18:35:34.946399 INFO HASS: HASS Plugin initialization complete
2020-02-27 18:35:34.947384 INFO AppDaemon: Initializing HTTP
2020-02-27 18:35:34.948418 INFO AppDaemon: Using 'ws' for event stream
2020-02-27 18:35:34.972289 INFO AppDaemon: Starting API
2020-02-27 18:35:34.982093 INFO AppDaemon: Starting Admin Interface
2020-02-27 18:35:34.982998 INFO AppDaemon: Starting Dashboards
2020-02-27 18:35:35.005598 INFO HASS: Connected to Home Assistant 0.106.0
2020-02-27 18:35:35.048353 INFO AppDaemon: App 'hello_world' added
2020-02-27 18:35:35.049290 INFO AppDaemon: App 'alexa_talking_clock' added
2020-02-27 18:35:35.050078 INFO AppDaemon: App 'sofa' added
2020-02-27 18:35:35.050799 INFO AppDaemon: App 'tvroom' added
2020-02-27 18:35:35.052462 INFO AppDaemon: Found 4 total apps
2020-02-27 18:35:35.053533 INFO AppDaemon: Starting Apps with 4 workers and 4 pins
2020-02-27 18:35:35.057895 INFO AppDaemon: Running on port 5050
2020-02-27 18:35:35.109484 INFO HASS: Evaluating startup conditions
2020-02-27 18:35:35.217151 INFO AppDaemon: Got initial state from namespace default
2020-02-27 18:35:37.072343 INFO AppDaemon: Scheduler running in realtime
2020-02-27 18:35:37.083874 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-02-27 18:35:37.086108 INFO AppDaemon: Adding /config/appdaemon/apps/simple_door_bell to module import path
2020-02-27 18:35:37.087853 INFO AppDaemon: Adding /config/appdaemon/apps/alexa_talking_clock to module import path
2020-02-27 18:35:37.089353 INFO AppDaemon: Adding /config/appdaemon/apps/alexa_talking_clock/apps to module import path
2020-02-27 18:35:37.090915 INFO AppDaemon: Adding /config/appdaemon/apps/alexa_talking_clock/apps/alexa_talking_clock to module import path
2020-02-27 18:35:37.092347 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2020-02-27 18:35:37.094017 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core to module import path
2020-02-27 18:35:37.095424 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/stepper to module import path
2020-02-27 18:35:37.097009 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/integration to module import path
2020-02-27 18:35:37.098558 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/core/type to module import path
2020-02-27 18:35:37.100186 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/devices to module import path
2020-02-27 18:35:37.145697 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-02-27 18:35:37.158032 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/simple_door_bell/simple_door_bell.py - ignoring
2020-02-27 18:35:37.159907 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/alexa_talking_clock/apps/alexa_talking_clock/alexa_talking_clock.py
2020-02-27 18:35:37.163046 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/const.py - ignoring
2020-02-27 18:35:37.164781 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2020-02-27 18:35:37.216681 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/controller.py - ignoring
2020-02-27 18:35:37.218578 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/__init__.py - ignoring
2020-02-27 18:35:37.220365 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/circular_stepper.py - ignoring
2020-02-27 18:35:37.222090 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/minmax_stepper.py - ignoring
2020-02-27 18:35:37.223807 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/stepper/__init__.py - ignoring
2020-02-27 18:35:37.225495 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/deconz.py - ignoring
2020-02-27 18:35:37.227186 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/__init__.py - ignoring
2020-02-27 18:35:37.229036 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/zha.py - ignoring
2020-02-27 18:35:37.230770 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/integration/z2m.py - ignoring
2020-02-27 18:35:37.232473 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/media_player_controller.py - ignoring
2020-02-27 18:35:37.234190 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/light_controller.py - ignoring
2020-02-27 18:35:37.235884 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/core/type/__init__.py - ignoring
2020-02-27 18:35:37.237570 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/aqara.py - ignoring
2020-02-27 18:35:37.239322 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/philips.py - ignoring
2020-02-27 18:35:37.241030 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/ikea.py - ignoring
2020-02-27 18:35:37.242722 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/devices/__init__.py - ignoring
2020-02-27 18:35:37.244257 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-02-27 18:35:37.246663 INFO AppDaemon: Initializing app alexa_talking_clock using class AlexaTalkingClock from module alexa_talking_clock
2020-02-27 18:35:37.249451 INFO AppDaemon: Initializing app sofa using class E1743Controller from module controllerx
2020-02-27 18:35:37.252002 INFO AppDaemon: Initializing app tvroom using class CustomLightController from module controllerx
2020-02-27 18:35:37.254146 WARNING AppDaemon: Unable to find class CustomLightController in module controllerx - 'tvroom' is not initialized
2020-02-27 18:35:37.414512 INFO hello_world: Hello from AppDaemon
2020-02-27 18:35:37.416573 INFO hello_world: You are now ready to run Apps!
2020-02-27 18:35:37.422787 INFO alexa_talking_clock: INITIALIZE start:2020-02-27 19:00:00.420748, frequency:60, times:[0]
2020-02-27 18:35:37.436849 WARNING AppDaemon: Unable to find module tvroom - initialize() skipped
2020-02-27 18:35:37.438478 INFO AppDaemon: App initialization complete

I think the problem is that the update has not been properly installed due to: Unable to find class CustomLightController in module controllerx. I believe there is a bug on HACS that when click on “Update” it does not download properly the version. Try to:

  • Click on “REINSTALL” on HACS for ControllerX
  • Restart AppDaemon addon/server
2 Likes

YES that’s it, now it’s working :muscle:

1 Like

v2.3.1 is now released :partying_face:

This patch change does not contain breaking changes.

:pencil2: Features

  • Adding transition attribute to light controllers (#42)

:hammer: Fixes

  • Changing the behaviour for Lutron devices. From on to on_full_brightness.
1 Like

@xaviml, @Doublet I’ve also had to reinstall in HACS after most of the beta releases.
Wasn’t sure if it was just me.
Guess it’s time to collect some logs…

1 Like

Same here, guys.

Several times through all the beta’s up to v2.3.0 I had to reinstall several times to actually load new version. Even though HACS indicated that new version actually WAS loaded ??

Hi, I’ve just bought a Trust ZYCT-202 controller which I’m playing around with, I’m talking to zigbee with a ZHA+Conbee II setup does the feature release in 2.30 below mean it’s only supported in z2m currently or am I just being thick and that is a config setting?

Cheers

Mark

@hainesy - correct, it is only supported for zigbee2mqtt currently.

If you can send the zha_events from the button presses, support can easily be added.

To do so, go to developer tools -> events and under listen to events, type in zha_event and hit start listening.

Then post here or gitthub the zha events for the controller. You should get an event for each press of “on”, “up”, “down” “off” and one that happens with every release of any button.

Each remote and the integrations that are currently supported are always listed here on the ControllerX docs.

EDIT: Is this device currently supported on zha? If not, it will need a quirk before it can be supported in ControllerX.

1 Like

@sreknob Hey, thanks for replying. I’m brand new to HA so just bought a few bits and pieces to start playing before building out a fuller system - I think I might have jumped the gun a bit on these remotes :-(.

I’ve got it working in homeassistant using ZHA, but it only registers as a generic ‘EndDevice’, it doesn’t have a specific quirk like my Xiaomi sensors do. This means it just recognizes the On & Off button but none of the others. I think i’m a bit stuck as my Conbee II stick doesn’t work with z2m and I’ve had more luck pairing devices with ZHA than with Deconz so don’t really want to move off it again just yet. Oh well…