HA 2022.9.0 Shelly dimmer issue

Hi all!

Since upgrading to the latest version, ny shelly dimmer is not working, it is detected in shelly dashboard but the light switch and dimmer show as anavailable. Also the sytem gives the following error:

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)).

Has anybody else this error as well? Is there a workaround or fix?

2 Likes

Issue is with ShellyforHass and there is a thread that may help.

It did not help me. No difference. Still same error, in fact there were more errors showing up.

File "/config/custom_components/shelly/light.py", line 36, in <module> SUPPORT_SHELLYRGB_COLOR = (SUPPORT_BRIGHTNESS | SUPPORT_COLOR)
NameError: name 'SUPPORT_BRIGHTNESS' is not defined

remove this fix it from /config/custom_components/shelly/light.py

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


# SUPPORT_SHELLYRGB_COLOR = (SUPPORT_BRIGHTNESS | SUPPORT_COLOR)
# SUPPORT_SHELLYRGB_WHITE = (SUPPORT_BRIGHTNESS)


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


1 Like

Confirmed that adjusting my light.py with these mods resolved the issue. Although I decided to remove everything but brightness from the first snippet since I only use shelly switches/dimmers; resulting in the section reading this afterward:

from homeassistant.components.light import (
    ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS
)

Fixed in ShellyForHass 1.0.2