ControllerX. Bring full functionality to light and media player controllers

No worries, @xaviml :sunglasses:

Actually Iā€™ve never given it ANY thought, that there were multiple MQTT calls for my click devices. Just used the easiest approach for automations - before you came up with ControllerX :grin:
For HAā€™s state machine it also makes perfect sense and more consistant that states for click devices donā€™t ā€˜liveā€™ forever. You pressed a button - and now itā€™s doneā€¦ Next ! As Iā€™ve mentioned previously, I really dislike my Hue core (or custom ??) remote integration, which actually leaves states to live ā€˜foreverā€™. No, state is not ā€˜1_click_upā€™. I pressed that button like 10 hours ago :unamused:
Itā€™s also much easier for newcomers to understand how to build easy automations, without the need to understand how to parse JSON objects.

But documentation really lacks - quite a bit! Now I know what itā€™s about, I can understand the vague sentences about HA legacy integration. But if Iā€™ve read it two days ago, I wouldnā€™t have a clue about what Koenkk actually meant with that Home Assistant legacy paragraph :joy:

While you at it (MQTT integration in ControllerX), Xavi. Could you briefly check if thereā€™s some potential code optimizing hidden somewhere in order to speed up MQTT integration ? :hugs: Iā€™m still using HA for toggling lights and let ControllerX do the rest. With a MQTT automation in HA, toggle is some estimated 150-200 ms. faster than same with MQTT integration in ControllerX. If not, I might raise an issue (more like a question) and ask Frenck if something could be done in Appdeamon code ?

Ciao !

1 Like

Iā€™m at a loss here guys. Nothing happens when I press any of the buttons on the dimmer
Log for Appdaemon4:

[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.6
 You are running the latest version of this add-on.
 System: HassOS 4.11  (armv7 / raspberrypi4)
 Home Assistant Core: 0.113.3
 Home Assistant Supervisor: 229
-----------------------------------------------------------
 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.
[16:10:09] INFO: Starting AppDaemon...
2020-08-05 16:10:10.637804 INFO AppDaemon: AppDaemon Version 4.0.3 starting
2020-08-05 16:10:10.638242 INFO AppDaemon: Python version is 3.8.2
2020-08-05 16:10:10.638823 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-08-05 16:10:10.639267 INFO AppDaemon: Added log: AppDaemon
2020-08-05 16:10:10.639871 INFO AppDaemon: Added log: Error
2020-08-05 16:10:10.640252 INFO AppDaemon: Added log: Access
2020-08-05 16:10:10.640633 INFO AppDaemon: Added log: Diag
2020-08-05 16:10:10.682808 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-08-05 16:10:10.723520 INFO HASS: HASS Plugin Initializing
2020-08-05 16:10:10.724020 INFO HASS: HASS Plugin initialization complete
2020-08-05 16:10:10.725048 INFO AppDaemon: Initializing HTTP
2020-08-05 16:10:10.725907 INFO AppDaemon: Using 'ws' for event stream
2020-08-05 16:10:10.751138 INFO AppDaemon: Starting API
2020-08-05 16:10:10.762340 INFO AppDaemon: Starting Admin Interface
2020-08-05 16:10:10.763217 INFO AppDaemon: Starting Dashboards
2020-08-05 16:10:10.792982 INFO HASS: Connected to Home Assistant 0.113.3
2020-08-05 16:10:10.836462 INFO AppDaemon: App 'hello_world' added
2020-08-05 16:10:10.837938 INFO AppDaemon: App 'myroom_controller' added
2020-08-05 16:10:10.840961 INFO AppDaemon: Found 2 total apps
2020-08-05 16:10:10.842502 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2020-08-05 16:10:10.846649 INFO AppDaemon: Running on port 5050
2020-08-05 16:10:10.888306 INFO HASS: Evaluating startup conditions
2020-08-05 16:10:10.920861 INFO AppDaemon: Got initial state from namespace default
2020-08-05 16:10:12.863428 INFO AppDaemon: Scheduler running in realtime
2020-08-05 16:10:12.874521 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-08-05 16:10:12.876460 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2020-08-05 16:10:12.878670 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_devices to module import path
2020-08-05 16:10:12.880662 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core to module import path
2020-08-05 16:10:12.882016 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/type to module import path
2020-08-05 16:10:12.883162 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/stepper to module import path
2020-08-05 16:10:12.884318 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/integration to module import path
2020-08-05 16:10:12.885538 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/feature_support to module import path
2020-08-05 16:10:12.941157 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-08-05 16:10:12.953977 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_const.py - ignoring
2020-08-05 16:10:12.956244 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/controllerx/controllerx.py
2020-08-05 16:10:12.998783 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_version.py - ignoring
2020-08-05 16:10:13.000717 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/legrand.py - ignoring
2020-08-05 16:10:13.003684 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aqara.py - ignoring
2020-08-05 16:10:13.005612 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/ikea.py - ignoring
2020-08-05 16:10:13.007838 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/lutron.py - ignoring
2020-08-05 16:10:13.009922 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/trust.py - ignoring
2020-08-05 16:10:13.012114 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/smartthings.py - ignoring
2020-08-05 16:10:13.014140 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/philips.py - ignoring
2020-08-05 16:10:13.016331 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/__init__.py - ignoring
2020-08-05 16:10:13.018369 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/color_helper.py - ignoring
2020-08-05 16:10:13.020569 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/custom_controller.py - ignoring
2020-08-05 16:10:13.022434 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/__init__.py - ignoring
2020-08-05 16:10:13.024730 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/controller.py - ignoring
2020-08-05 16:10:13.026582 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py - ignoring
2020-08-05 16:10:13.029509 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/light_controller.py - ignoring
2020-08-05 16:10:13.032127 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/__init__.py - ignoring
2020-08-05 16:10:13.035285 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py - ignoring
2020-08-05 16:10:13.037956 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/cover_controller.py - ignoring
2020-08-05 16:10:13.041113 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/circular_stepper.py - ignoring
2020-08-05 16:10:13.043780 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/__init__.py - ignoring
2020-08-05 16:10:13.046857 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/minmax_stepper.py - ignoring
2020-08-05 16:10:13.049604 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/mqtt.py - ignoring
2020-08-05 16:10:13.052724 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/zha.py - ignoring
2020-08-05 16:10:13.055405 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/z2m.py - ignoring
2020-08-05 16:10:13.058581 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/__init__.py - ignoring
2020-08-05 16:10:13.061176 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/state.py - ignoring
2020-08-05 16:10:13.064278 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/deconz.py - ignoring
2020-08-05 16:10:13.066919 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/cover.py - ignoring
2020-08-05 16:10:13.070030 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/light.py - ignoring
2020-08-05 16:10:13.072698 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/media_player.py - ignoring
2020-08-05 16:10:13.075720 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py - ignoring
2020-08-05 16:10:13.077988 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-08-05 16:10:13.081931 INFO AppDaemon: Initializing app myroom_controller using class HueDimmerController from module controllerx
2020-08-05 16:10:13.275121 INFO hello_world: Hello from AppDaemon
2020-08-05 16:10:13.277518 INFO hello_world: You are now ready to run Apps!
2020-08-05 16:10:13.291356 INFO myroom_controller: šŸŽ® ControllerX v3.3.0
2020-08-05 16:10:13.299759 INFO AppDaemon: App initialization complete

ZHA event:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:17:88:01:04:f1:b4:f0",
        "unique_id": "00:17:88:01:04:f1:b4:f0:2:0xfc00",
        "endpoint_id": 2,
        "cluster_id": 64512,
        "command": "on_short_release",
        "args": {
            "button": "on",
            "press_type": "short_release",
            "command_id": 0,
            "args": [
                1,
                3145728,
                2,
                33,
                0,
                0
            ]
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-08-05T15:02:46.716006+00:00",
    "context": {
        "id": "1d6d720736154e5fa1e81b95f092f641",
        "parent_id": null,
        "user_id": null
    }
}

config\appdaemon\apps\apps.yaml

---
hello_world:
  module: hello
  class: HelloWorld
myroom_controller:
  module: controllerx
  class: HueDimmerController
  controller: 00:17:88:01:04:f1:b4:f0
  integration: zha
  light: group.my_room

What am I missing?

Hi @cabalforces,

Everything related to configuration seems right to me. What I think is happening is that the events that the Hue Dimmer switch fire are different from what ControllerX is expecting. ZHA is the most complicated integration to maintain since the events change from time to time and I am the only one maintaining all the controllers to be up-to-date. So if you want to help, could you please raise an issue (bug) on the GitHub repository and report the different ZHA JSON events for each action (clicks, holds and releases). Then I will update the code to integrate again that Controller for the ZHA integration.

Cheers,
Xavi M.

1 Like

Hi @htvekov,

Could you share the YAML automation from HA to have an idea of what the flow is and compare it to ControllerX? There is no much to optimize on the MQTT integration, it just listens to the topic that is been set and then calls HA services. Just to clarify, the MQTT integration (and any other) is to get the actions from the controllers, when dealing with devices/entities (lights, media players, switches, etc) ControllerX communicates through HA call services. This means that if you have a controller and a light with Z2M, the communication with the controller will be done with MQTT directly to AppDaemon/ControllerX, but when toggling the light, ControllerX sends a HA call service and not a MQTT topic.

Cheers,
Xavi M.

Hiā€™ Xavi.

Iā€™ve been trying many different setupā€™s to toggle lights as fast as possible from my in wall Tasmota switchmode 11/12 Shellyā€™s. As you know, these use MQTT commands for the different click and hold situations.

Fastest setup so far for ā€˜toggleā€™, is using HA automation which listens to identical topic as used in ControllerX and uses standard HA light.toggle service calls to toggle the light. This setup is really close to instant action.

With Appdeamon, identical setup is notisable slower. On first tests, I had an active contrain_input_boolean in YAML. Disabling that actually makes ControllerX quite a bit faster. Perhaps almost halfes the ā€˜lagā€™ experienced with constrain_input_boolean. But still HA automation with MQTT trigger and even HA state trigger is faster than ControllerX with MQTT triggerā€¦ ?

On second thought, this leads me to think that MQTT integration is perhaps not the culprit here, but more likely that appdeamon <ā€“> HA state integration has speed issues. Appdeamon uses many milliseconds more than HA itself to check states (condition using contrain_input_boolean) and/or changing states with same service calls as HA uses. Either that or HA automations are more closely linked to HA core than appdeamon (or any other external app) is. And hence can access state machine much faster than any external app ?

Donā€™t get me wrong - Both Appdeamon and ControllerX are excellent and makes life SO much easier :hugs: But it triggers my OCD :crazy_face::joy::rofl:that I canā€™t gather all tidy and neatly in ControllerX. Instead Iā€™m forced to breakup my automations in both HA and ControllerX.

Probably just the way it is Iā€™m afraid. And Iā€™ll, without any doubt, survive this ā€˜luxuryā€™ problem :grin::grin:

Below my test automation in HA and appdeamon.

Ciao !

# *** HA AUTOMATION ***
# Toggle lights through HA using MQTT trigger. Quicker responce than using platform state or directly in appdeamon ControllerX app 

- id: kontor_loftlys_cstm_mqtt_toggle
  alias: kontor_loftlys_cstm_mqtt_toggle
  
  trigger:
    platform: mqtt
    topic: zigbee2mqtt/office_cmnd
    payload: "toggle"
  
  #trigger:
  #- entity_id: sensor.tasmotest
  #  platform: state
  #  to: 'toggle'
  
  action:  
  - service: light.toggle
    data:
      entity_id:
      - light.0xec1bbdfffed45c3b_light
# ***  appdeamon app ***
controller_switchmode11_toggle_office:
  module: controllerx
  class: CustomLightController
  
  controller: 'zigbee2mqtt/office_cmnd'
  integration: mqtt
  #controller: sensor.tasmotest
  #integration: state

  light: light.0x680ae2fffe924460_light
  add_transition_turn_toggle: false
  mapping:
    toggle: toggle
  #constrain_input_boolean: light.0x90fd9ffffe838cb3_light,off 

feature request: make it possible to create ā€œvirtualā€ binary sensors for whatever zigbee switches.

apps.yaml
ā€¦
short_press_virtual_binary_sensor: ā€œbinary_sensor.bedroom_switch_shortā€
long_press_virtual_binary_sensor: ā€œbinary_sensor.bedroom_switch_longā€

then I could use those zigbee switches as normal button entities in other usecases, the benefit is that the consumer case would not need to know if its a zigbee button or something else.

so pressing the button on my xiaomi switch would just flip the value of the defined virtual binary sensor.

Hi @gibman,

Not sure if I understood you fully, but you can toggle any type of sensor using CallServiceController (about to be deprecated and Controller can be used, but behaviour is the same). You can overwrite an attribute called mapping where you can define the event/action as a key and the service to call as value. Configuration would look like:

example_app:
  module: controllerx
  class: CallServiceController
  controller: sensor.controller_id
  integration: z2m
  mapping:
    single:
      service: input_boolean.toggle
      data:
        entity_id: input_boolean.your_input_boolean

From the ControllerX v3.4.0 (the beta version was just released) you will be able to do the same by doing:

example_app:
  module: controllerx
  class: SwitchController
  controller: sensor.controller_id
  integration: z2m
  switch: input_boolean.your_input_boolean
  mapping:
    single: toggle

This configuration allows you then to switch the value of your input_boolean when pressing the WXKG11LM Aqara switch. It goes without saying that the input_boolean.your_input_boolean should exist in your HA setup, either via UI r configuration.yaml.

Not sure if this is what you are looking for, otherwise, could you specify more in detail what is what you are looking for and see if it is something worth to implement or itā€™s there already a way of achieving it.

Cheers and thanks for the feature request!
Xavi M.

1 Like

Hi, do you think you can add support for this controller?

I have it working using deCONZ. It doesnā€™t show there, but it is listed under integrations/entities in HA. Also I can listen to event and have written an automation with it succesfully toggling lights using event_type: deconz_event. ControllerX support would be amazing!

I can help you out with finding out all the events that are paired to button presses and test this :slight_smile:

Hi @ASNNetworks,

Adding support to new device is simple. I will just need all the actions fired from each of the buttons (presses, holds, releases). You can create a new device in here.

Let me know if you have any questions.

Cheers,
Xavi M.

Awesome! I noticed some buttons have a hold option (firing a new event every 1-2 seconds) while others have a press-hold-release event and donā€™t keep firing.

I will test extensively tomorrow and share it there!

1 Like

Is is possible for custom controller to release an action if it repeated, for example, if I long press it do hold_xycolor_up and long press again it release the action ?

Hi @SilverWx,

This is not possible in the latest ControllerX version, but it will be possible on ControllerX v3.4.0. You can try it out on the beta version: https://github.com/xaviml/controllerx/releases/tag/v3.4.0b2

There is a new added attribute called hold_release_toggle. If true , a hold action will work as a release when another hold is running. This is useful when you have a button with just one action event and you want to use the hold-release feature, then you just need to map that event to a hold action. Otherwise, it will work as always, when a hold action is called while another one is called, then it will be ignored. Default is false. Configuration would look like the following:

example_app:
  module: controllerx
  class: E1810Controller
  controller: example_controller
  integration:
    name: z2m
    listen_to: mqtt
  light: light.livingroom_lamp
  hold_release_toggle: true
  mapping:
    toggle: hold_brightness_toggle

The important things in the config are the hold_release_toggle: true and that you can just use the toggle: hold_brightness_toggle without a release action. With this, every time you click the toggle button, it will bright up/down the light and stop when it is click again if it is still changing the brightness.

Cheers,
Xavi M.

So a good news !!
Perfect, thanks for the info :smiley:

1 Like

v3.4.0 is now released :partying_face:

downloads

This minor change does not contain breaking changes.
Note: Remember to restart the AppDaemon addon/server after updating to a new version.

:pencil2: Features

  • Add the mapping attribute to the Controller base code, so the attribute can be used in any controller class. Custom controllers have been deprecated, they can still be in use, but a warning will be shown in the console [ #98 ]
  • Add attribute parameter to the state integration to listen to state attributes. Default is to listen to the state as it already was [ #106 ]
  • Allow input_boolean and binary_sensor entities to be used in switch controllers
  • Add listen_to attribute to choose between listening to HA state or MQTT [ #109 ]
  • Add hold_release_toggle attribute. If true, a hold action will work as a release when another hold is running. This is useful when you have a button with just one action event and you want to use the hold-release feature, then you just need to map that event to a hold action. Otherwise, it will work as always, when a hold action is called while another one is called, then it will be ignored. Default is false.

:hammer: Fixes

  • Raise an error when a group has no entities [ #102 ]
  • Fix brightness transition only works once after a controller is started [ #100 ]
  • Fix ZHA mapping for HueDimmerController [ #110 ]
  • Fix Toggle direction requires the button to be held twice [ #113 ]

:scroll: Docs

  • Create Sonos Display documentation @htvekov [ #104 ]
  • Fix mapping for E1744 in the documentation [ #103, #105 ]
  • Update Tasmota Switchmode example @htvekov [ #114 ]
1 Like

Nice!

Can you perhaps update this controller https://xaviml.github.io/controllerx/controllers/WXCJKG13LM?

deCONZ supports this controller as well (I have received one today and paired it succesfully). Or can I just edit some files and tie in the deconz events myself?

Hi @ASNNetworks,

You can create a GitHub ticet in here. I will just need the events that each button fire (press, hold, release, double click, triple click).

Cheers,
Xavi M.

1 Like

Holy cr*p, @xaviml.
Youā€™re on fire!! :fire::fire::fire::rocket::rocket::rocket: - v3.4.0 :sunglasses:

Iā€™ve been using ControllerX for half a year now and just thought about the incredible development youā€™ve done with ControllerX in only six months time. Wow !! :clap::clap:
Your dedication, time spent with us end users and the countless hours youā€™ve spent debugging issues / enhancing code is simply amazingā€¦

Go have a beer (or two), mate! :beers:
You definitely deserve it ! :smiley:

Edit: They are on me ! :wink:

Cheers !!

1 Like

Hi,
Since upgrading to v3.4.0, my Symfonski media controller app is failing. Reverting to 3.3.0 fixed it.

Not sure whatā€™s causing the issue.

App:

study_media_controller:
  module: controllerx
  class: CallServiceController
  controller: 14:b4:57:ff:fe:f6:81:e3
  integration: zha
  mapping: 
    "move_1_195":
      - service: media_player.volume_down
        data: 
          entity_id: media_player.study_display
    "move_0_195":
      - service: media_player.volume_up
        data: 
          entity_id: media_player.study_display
    "toggle":
      - service: script.turn_on
        data:
          entity_id: script.1594023958628
      - service: switch.turn_on
        data:
          entity_id: switch.plug_158d000163d3fe
    "step_0_1_0":
      - service: light.toggle
        data:
          entity_id: light.study
          brightness_pct: 100

Error:

2020-08-18 13:12:27.276145 WARNING study_media_controller: Unexpected error in worker for App study_media_controller:
2020-08-18 13:12:27.276974 WARNING study_media_controller: Worker Ags: {'id': '2b216ac40529454d8ad3db6b4b29c444', 'name': 'study_media_controller', 'objectid': 'f54a83fb76184340ab789400bd6a8d04', 'type': 'event', 'event': 'zha_event', 'function': <bound method ZHAIntegration.callback of <cx_core.integration.zha.ZHAIntegration object at 0x7f838c301e80>>, 'data': {'device_ieee': '14:b4:57:ff:fe:f6:81:e3', 'unique_id': '14:b4:57:ff:fe:f6:81:e3:1:0x0008', 'endpoint_id': 1, 'cluster_id': 8, 'command': 'move', 'args': [0, 195]}, 'pin_app': True, 'pin_thread': 3, 'kwargs': {'device_ieee': '14:b4:57:ff:fe:f6:81:e3', '__thread_id': 'MainThread'}}
2020-08-18 13:12:27.277756 WARNING study_media_controller: ------------------------------------------------------------
2020-08-18 13:12:27.279289 WARNING study_media_controller: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 725, in async_worker
    await funcref(args["event"], data, args["kwargs"])
  File "/config/appdaemon/apps/controllerx/cx_core/integration/zha.py", line 39, in callback
    await self.controller.handle_action(action)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 144, in handle_action
    def get_list(self, entities: Union[Sequence[str], str]) -> List[str]:
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 162, in call_action
    f"  - {attribute}: {value}", level="INFO", ascii_encode=False,
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 173, in action_timer_callback
    f"šŸŽ® Button event triggered: `{action_key}`",
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 234, in _action_impl
    if isinstance(action, str):
  File "/config/appdaemon/apps/controllerx/cx_core/custom_controller.py", line 76, in call_services
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 120, in call_service
    f"Type {type(integration)} is not supported for `integration` attribute"
  File "/usr/lib/python3.8/site-packages/appdaemon/adapi.py", line 143, in log
    msg = self._sub_stack(msg)
  File "/usr/lib/python3.8/site-packages/appdaemon/adapi.py", line 56, in _sub_stack
    stack = inspect.stack()
  File "/usr/lib/python3.8/inspect.py", line 1514, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python3.8/inspect.py", line 1491, in getouterframes
    frameinfo = (frame,) + getframeinfo(frame, context)
  File "/usr/lib/python3.8/inspect.py", line 1465, in getframeinfo
    lines, lnum = findsource(frame)
  File "/usr/lib/python3.8/inspect.py", line 840, in findsource
    if pat.match(lines[lnum]): break
IndexError: list index out of range
2020-08-18 13:12:27.279879 WARNING study_media_controller: ------------------------------------------------------------

Cheers.

Hey @htvekov,

Thank you for the support! I really appreciate all the time you put in the documentation and finding out the reason in the bugs you encountered. It really makes my life easier :slight_smile:

I will definitely have a beer (or two) later in the day. I cannot do morning beers :laughing:

Cheers,
Xavi M.

1 Like

Hi @Kanishkaz,

Your errors donā€™t seem to make sense to me and I think it is because AppDaemon hasnā€™t been restarted, could it be? After each update to ControllerX, AppDaemon needs a restart.

Also, from ControllerX v3.4.0 on, you should change CallServiceController for just Controller. This is not what is causing the error, but once you restart the addon, you will see a warning about this.

Cheers,
Xavi M.