ShellyForHASS: [BUG] light unavailable after 2022.9.0 upadate

Environment

  • ShellyForHASS release with the issue: 1.0.1
  • Last working ShellyForHASS release (if known): 1.0.1 (under homeassiastant 2022.8.7
  • Home Assistant Core release with the issue: 2022.9.0
  • Operating environment (Home Assistant/Supervised/Docker/venv): HomeAssistant

Describe the bug

After 2022.9.0 update, light entities of shelly dimmer 2’s became unavailable.

Steps to Reproduce

Expected behavior

Screenshots

Traceback/Error logs

Logger: homeassistant.setup Source: setup.py:320 First occurred: 20:14:23 (3 occurrences) Last logged: 20:21:03

Unable to prepare setup for platform shelly.light: Platform not found (cannot import name ‘ATTR_WHITE_VALUE’ from ‘homeassistant.components.light’ (/usr/src/homeassistant/homeassistant/components/light/init.py)).


Additional context

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 35
  • Comments: 54 (4 by maintainers)

Most upvoted comments

We working on a new release.

Maybe it is just time to migrate to native Shelly integration… I thought that this integration would be up-to-date not that something is forgotten to be implemented and that author do not have time… sorry - but this is probably something that author need to be hear…

If there is no time, no problem, but be honest and publish this and give project to someone else… simply my humble opinion.

PS. this so called hotfix broke rgbw2 behaive as was before, so it is not hotfix but half way baked patch…

@dolenec you know they’re sharing this for free, developing it in their own spare time? It’s not a product you’ve bought. The speed with which they deployed this hotfix (even though the auther mentioned he’s very busy atm) is something to thank them for, not to get annoyed at :\ Also, he repeatedly asked for help, so there’s no option to ‘give it to someone else’ as noone has the skills and time to help.

Perhaps you’d be better off buying something off the shelves?

To simplify it even further, remove ONLY the red lines, and leave everything else as is. image

Close the file and restart HA.

Have made a very crude fix to at least get most of your lights working again - but this doesn’t fix RGBW lights #714

hey thx, how can i use your fix? best regards

Just remove this lines from light.py

ATTR_WHITE_VALUE,
SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_EFFECT,
SUPPORT_WHITE_VALUE,
   if ATTR_WHITE_VALUE in kwargs:
        white_value = int(kwargs[ATTR_WHITE_VALUE])
        self._white_value = white_value

as speciifed in this url: ca4b860 and restart HA

can you tell me what is the path to this file? thx best regards

config\custom_components\shelly\light.py

I have created a new release 1.0.2. Now it is in pre-release/beta mode. Can you please test and I will change it to a full release shortly.

Have made a very crude fix to at least get most of your lights working again - but this doesn’t fix RGBW lights #714

hey thx, how can i use your fix?

best regards

Just remove this lines from light.py

ATTR_WHITE_VALUE,
SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_EFFECT,
SUPPORT_WHITE_VALUE,

   if ATTR_WHITE_VALUE in kwargs:
        white_value = int(kwargs[ATTR_WHITE_VALUE])
        self._white_value = white_value

as speciifed in this url: https://github.com/StyraHem/ShellyForHASS/pull/714/commits/ca4b860f6985b3c3e845f74f93bfc9e661a7959e

and restart HA

Have made a very crude fix to at least get most of your lights working again - but this doesn’t fix RGBW lights https://github.com/StyraHem/ShellyForHASS/pull/714

Another workable solution I could imagine is to have a virtual ‘mode’ switch which needs to be set either ‘white’ or ‘RGB’ and the brightness would control the white brightness in white mode and the RGB brightness in RGB mode.

That’s actually what the new ColorMode.WHITE is supposed to be used for. See: https://github.com/home-assistant/core/pull/51411 and https://developers.home-assistant.io/docs/core/entity/light/#color-modes

Note that there is actually an enum called ColorMode.RGBW in the link.

To simplify it even further, remove ONLY the red lines, and leave everything else as is. image

Close the file and restart HA.

I can also confirm that the temporary fix is working, I had issues with Shelly Bulb Duo and Shelly Dimmer