Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when using deconz and ikea e1744 or ICTCG1 [BUG] #102

Closed
Sennevds opened this issue Jul 21, 2020 · 5 comments
Closed

Crashes when using deconz and ikea e1744 or ICTCG1 [BUG] #102

Sennevds opened this issue Jul 21, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Sennevds
Copy link

Sennevds commented Jul 21, 2020

Bug report

Description

When using the E1744 or ICTG1 in combination with deconz to control my volume of group of media_players. As you know it was working before.
I haven't had the time to check it myself maybe I have more time this week to check out what's happening!

Additional information

  • Devices involved:
    • Model: IKEA 1744 and IKEA ICTG1 as Media Player controller
    • ...
  • Integration: Choose from deconz
  • AppDaemon version: v4.0.2.6
  • ControllerX version: v3.3.0
  • HACS version (if installed from there): v1.1.0
  • Home Assistant Core version: v0.112.5

AppDaemon app configuration

media_player_volume:
  module: controllerx
  class: CustomMediaPlayerController
  controller: tradfri_wireless_dimmer
  integration:
    name: deconz
  media_player:  group.current_media_player #
  mapping:
    3002: click_volume_down # Rotate left
    2002: click_volume_up # Rotate right
    1002: next_track # Flip90
    4002: previous_track # Flip180


media_player_volume_2:
  module: controllerx
  class: E1744MediaPlayerController
  controller: symfonisk_controller
  integration: deconz
  media_player: group.current_media_player

media_player_volume_3:
  module: controllerx
  class: E1744MediaPlayerController
  controller: symfonisk_sound_controller
  integration: deconz
  media_player: group.current_media_player

Logs

2020-07-21 18:18:09.068770 INFO media_player_volume: 🎮 ControllerX v3.3.0
2020-07-21 18:18:09.099279 INFO media_player_volume_2: 🎮 ControllerX v3.3.0
2020-07-21 18:18:09.109135 INFO media_player_volume_3: 🎮 ControllerX v3.3.0
2020-07-21 18:18:09.113978 INFO AppDaemon: App initialization complete
2020-07-21 18:18:35.773057 INFO media_player_volume_2: 🎮 Button event triggered: `2001`
2020-07-21 18:18:35.777346 INFO media_player_volume_2: 🏃 Running `hold_volume_up` now
2020-07-21 18:18:35.780691 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:35.781901 WARNING media_player_volume_2: Unexpected error in worker for App media_player_volume_2:
2020-07-21 18:18:35.782851 WARNING media_player_volume_2: Worker Ags: {'id': 'c8c45b8b2ae445b9b11704bcf92905f2', 'name': 'media_player_volume_2', 'objectid': '8e5a805d1df6497f9d96019b584d2cb4', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.callback of <cx_core.integration.deconz.DeCONZIntegration object at 0x7fab21fbe0>>, 'data': {'id': 'symfonisk_controller', 'unique_id': '14:b4:57:ff:fe:79:c9:a2', 'event': 2001}, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'id': 'symfonisk_controller', '__thread_id': 'MainThread'}}
2020-07-21 18:18:35.784424 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:35.785937 WARNING media_player_volume_2: 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/deconz.py", line 22, in callback
    await self.controller.handle_action(data[type_])
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 144, in handle_action
    await self.call_action(action_key)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 162, in call_action
    await self.action_timer_callback({"action_key": action_key})
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 173, in action_timer_callback
    await action(*args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 234, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 107, in hold
    await self.prepare_volume_change()
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 111, in prepare_volume_change
    volume_level = await self.get_entity_state(
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 261, in get_entity_state
    entity = entities[0]
IndexError: list index out of range
2020-07-21 18:18:35.786824 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:35.939216 INFO media_player_volume_2: 🎮 Button event triggered: `2003`
2020-07-21 18:18:35.943063 INFO media_player_volume_2: 🏃 Running `release` now
2020-07-21 18:18:36.175063 INFO media_player_volume_2: 🎮 Button event triggered: `2001`
2020-07-21 18:18:36.178864 INFO media_player_volume_2: 🏃 Running `hold_volume_up` now
2020-07-21 18:18:36.181396 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.182213 WARNING media_player_volume_2: Unexpected error in worker for App media_player_volume_2:
2020-07-21 18:18:36.182967 WARNING media_player_volume_2: Worker Ags: {'id': 'c8c45b8b2ae445b9b11704bcf92905f2', 'name': 'media_player_volume_2', 'objectid': '8e5a805d1df6497f9d96019b584d2cb4', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.callback of <cx_core.integration.deconz.DeCONZIntegration object at 0x7fab21fbe0>>, 'data': {'id': 'symfonisk_controller', 'unique_id': '14:b4:57:ff:fe:79:c9:a2', 'event': 2001}, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'id': 'symfonisk_controller', '__thread_id': 'MainThread'}}
2020-07-21 18:18:36.183734 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.185199 WARNING media_player_volume_2: 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/deconz.py", line 22, in callback
    await self.controller.handle_action(data[type_])
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 144, in handle_action
    await self.call_action(action_key)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 162, in call_action
    await self.action_timer_callback({"action_key": action_key})
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 173, in action_timer_callback
    await action(*args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 234, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 107, in hold
    await self.prepare_volume_change()
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 111, in prepare_volume_change
    volume_level = await self.get_entity_state(
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 261, in get_entity_state
    entity = entities[0]
IndexError: list index out of range
2020-07-21 18:18:36.185957 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.357377 INFO media_player_volume_2: 🎮 Button event triggered: `2003`
2020-07-21 18:18:36.361175 INFO media_player_volume_2: 🏃 Running `release` now
2020-07-21 18:18:36.570605 INFO media_player_volume_2: 🎮 Button event triggered: `2001`
2020-07-21 18:18:36.574445 INFO media_player_volume_2: 🏃 Running `hold_volume_up` now
2020-07-21 18:18:36.577018 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.577840 WARNING media_player_volume_2: Unexpected error in worker for App media_player_volume_2:
2020-07-21 18:18:36.578611 WARNING media_player_volume_2: Worker Ags: {'id': 'c8c45b8b2ae445b9b11704bcf92905f2', 'name': 'media_player_volume_2', 'objectid': '8e5a805d1df6497f9d96019b584d2cb4', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.callback of <cx_core.integration.deconz.DeCONZIntegration object at 0x7fab21fbe0>>, 'data': {'id': 'symfonisk_controller', 'unique_id': '14:b4:57:ff:fe:79:c9:a2', 'event': 2001}, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'id': 'symfonisk_controller', '__thread_id': 'MainThread'}}
2020-07-21 18:18:36.579338 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.580643 WARNING media_player_volume_2: 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/deconz.py", line 22, in callback
    await self.controller.handle_action(data[type_])
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 144, in handle_action
    await self.call_action(action_key)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 162, in call_action
    await self.action_timer_callback({"action_key": action_key})
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 173, in action_timer_callback
    await action(*args)
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 234, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 107, in hold
    await self.prepare_volume_change()
  File "/config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py", line 111, in prepare_volume_change
    volume_level = await self.get_entity_state(
  File "/config/appdaemon/apps/controllerx/cx_core/controller.py", line 261, in get_entity_state
    entity = entities[0]
IndexError: list index out of range
2020-07-21 18:18:36.581552 WARNING media_player_volume_2: ------------------------------------------------------------
2020-07-21 18:18:36.750860 INFO media_player_volume_2: 🎮 Button event triggered: `2003`
2020-07-21 18:18:36.756367 INFO media_player_volume_2: 🏃 Running `release` now
2020-07-21 18:18:37.316420 INFO media_player_volume_2: 🎮 Button event triggered: `2003`
2020-07-21 18:18:37.320850 INFO media_player_volume_2: 🏃 Running `release` now

Extra info

Haven't tested on all my devices but the current device it crashes on doesn't have a volume value(using IR commands). It only has volume up and volume down.

@Sennevds Sennevds added the bug Something isn't working label Jul 21, 2020
@xaviml
Copy link
Owner

xaviml commented Jul 21, 2020

Hi @Sennevds,

The error you are getting is because the group.current_media_player does not have any entities registered. I would check the automation that sets the entities to that group. The only thing I can do from my side is to give a better error message.

@Sennevds
Copy link
Author

Hmm that's weird I checked and I had one entity in the group being the self created media player. I will check tomorrow to be sure.

@xaviml
Copy link
Owner

xaviml commented Jul 21, 2020

Let me know if it is otherwise, but the error is giving you is because of the entity_id attribute of that group is an empty list.

@xaviml
Copy link
Owner

xaviml commented Jul 30, 2020

Hi @Sennevds,

Did you encounter with this problem again? On a side note, if you are using a group entity that changes automatically depending on xyz conditions, I recommend you to use update_supported_features: true attribute. This way it will always check for the supported features of the device is working on. Otherwise, it will just load the supported feature when the first action runs after initialization.

Cheers,
Xavi M.

@Sennevds
Copy link
Author

Hadn't had time to test it. I will close this ticket and if I have time to test it again and I still encounter the same problem I will reopen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants