Controllerx: Smooth_power_on for Hue integration broken since ControllerX v2.5.0

Created on 2 Jun 2020  路  5Comments  路  Source: xaviml/controllerx

Description

Smooth_power_on for lights via Hue integration has apparently been broken since v2.5.0 ?
z2m integration still works as intended (and has been through all versions I believe)
Didn't notice until today when I made some other tests.

A quick jump backwards in versions, revealed that last working ControllerX version was v2.4.4

  • Devices involved:
  • Model: IKEA 1743 as Light Controller
  • Integration: z2m
  • AppDaemon version: [ eg. v4.0.2.5 ]
  • ControllerX version: v2.5.0 and upwards
  • HACS version (if installed from there): v1.0.3
  • Home Assistant Core version: v0.110.1

AppDaemon app configuration

office1_controller:
  module: controllerx
  class: E1743Controller #Ikea on/off remote
  controller: sensor.0x000d6ffffeb9f099_click
  integration: z2m
  smooth_power_on: true
  #light: light.0x680ae2fffe924460_light
  light: light.gang_lys_1

Logs

2020-06-02 22:44:39.865976 INFO office1_controller: 馃幃 Button event triggered: `brightness_up`
2020-06-02 22:44:39.870513 INFO office1_controller: 馃弮 Running `hold_brightness_up` now
2020-06-02 22:44:39.875340 WARNING office1_controller: ------------------------------------------------------------
2020-06-02 22:44:39.876189 WARNING office1_controller: Unexpected error in worker for App office1_controller:
2020-06-02 22:44:39.880233 WARNING office1_controller: Worker Ags: {'id': '9f83a226b3ee437fb64b0951e5c0e4bc', 'name': 'office1_controller', 'objectid': 'cc4a306634ea42a180ef2485e3cc1b44', 'type': 'state', 'function': <bound method StateIntegration.callback of <core.integration.z2m.Z2MIntegration object at 0x7fc042df74c0>>, 'attribute': 'state', 'entity': 'sensor.0x000d6ffffeb9f099_click', 'new_state': 'brightness_up', 'old_state': '', 'pin_app': True, 'pin_thread': 4, 'kwargs': {'__thread_id': 'MainThread'}}
2020-06-02 22:44:39.881181 WARNING office1_controller: ------------------------------------------------------------
2020-06-02 22:44:39.883343 WARNING office1_controller: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 709, in async_worker
    await funcref(entity, attr, old_state, new_state, self.AD.state.sanitize_state_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/controllerx/core/integration/state.py", line 20, in callback
    await self.controller.handle_action(new)
  File "/config/appdaemon/apps/controllerx/core/controller.py", line 143, in handle_action
    await self.call_action(action_key)
  File "/config/appdaemon/apps/controllerx/core/controller.py", line 161, in call_action
    await self.action_timer_callback({"action_key": action_key})
  File "/config/appdaemon/apps/controllerx/core/controller.py", line 172, in action_timer_callback
    await action(*args)
  File "/config/appdaemon/apps/controllerx/core/controller.py", line 226, in _action_impl
    await method(controller, *args, **kwargs)
  File "/config/appdaemon/apps/controllerx/core/type/light_controller.py", line 402, in hold
    self.value_attribute = await self.get_value_attribute(attribute)
  File "/config/appdaemon/apps/controllerx/core/type/light_controller.py", line 350, in get_value_attribute
    raise ValueError(
ValueError: Value for `brightness` attribute could not be retrieved from `light.gang_lys_1`. Check the FAQ to know more about this error: https://xaviml.github.io/controllerx/faq
2020-06-02 22:44:39.884186 WARNING office1_controller: ------------------------------------------------------------
2020-06-02 22:44:41.023319 INFO office1_controller: 馃幃 Button event triggered: `brightness_stop`
2020-06-02 22:44:41.027261 INFO office1_controller: 馃弮 Running `release` now

Additional Context

Add any other context or screenshots about the bug here.

bug

All 5 comments

Could it be the refactoring done in v2.5.0 (https://github.com/xaviml/controllerx/issues/69) that breaks the Hue integration ?

Hue lights doesn't present a brightness attribute in HA when they're off.
image

Hi @htvekov,

You are totally right, that fix broke this. However, the bug is that ControllerX reads the brightness when smooth_power_on is called and that is not needed. As you are mentioning the problem is that it reads the brightness attribute when the light is off and it crashes for integrations not showing the brightness when lights are off (like Hue). I will fix this for the next release. Thanks again for spotting this out! :)

Hi @htvekov,

I fix for this issue it is now on the dev branch. Let me know if this is fixed.

Thanks :)

Yep, Xavi.

Working perfectly with Hue bridge again 馃憤馃槑

2020-06-06 22:23:02.343978 INFO mikkel_controller: 馃幃 Button event triggered: `brightness_up`
2020-06-06 22:23:02.347748 INFO mikkel_controller: 馃弮 Running `hold_brightness_up` now
2020-06-06 22:23:02.364906 INFO mikkel_controller: 馃 Service: light.turn_on
2020-06-06 22:23:02.370676 INFO mikkel_controller:   - entity_id: light.mikkel_loft
2020-06-06 22:23:02.381815 INFO mikkel_controller:   - brightness: 1
2020-06-06 22:23:03.202585 INFO mikkel_controller: 馃幃 Button event triggered: `brightness_stop`
2020-06-06 22:23:03.206790 INFO mikkel_controller: 馃弮 Running `release` now

Thank you so much 馃檪馃嵒

Ciao !

Fixed in ControllerX v2.8.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terle picture terle  路  3Comments

EPMatt picture EPMatt  路  8Comments

silbats picture silbats  路  10Comments

xaviml picture xaviml  路  7Comments

mvjt picture mvjt  路  7Comments