Sonoff Integration Fails After HA Update

Upgraded HAOS to 12.0; Core: 2024.2.5

Sonoff Integration has failed to load with “Invalid config” notification.

Error logs shows:

Unexpected exception importing component custom_components.sonoff
Setup failed for custom integration ‘sonoff’: Unable to import component: Exception importing custom_components.sonoff

Anyone else experienced this issue? Fix/workaround?

Thanks

Logger: homeassistant.loader
Source: loader.py:827
First occurred: 9:13:08 AM (1 occurrences)
Last logged: 9:13:08 AM

Unexpected exception importing component custom_components.sonoff
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/sonoff/__init__.py", line 28, in <module>
    from .core import devices as core_devices
  File "/config/custom_components/sonoff/core/devices.py", line 104, in <module>
    PULSEWIDTH = spec(XPulseWidth, param="pulseWidth", enabled=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sonoff/core/devices.py", line 90, in spec
    return type(cls.__name__, (cls,), {**cls.__dict__, **kwargs})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 414, in __init__
    wrap_attr(cls, property_name)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 386, in wrap_attr
    raise TypeError(f"Can't override {attr_name} in subclass")
TypeError: Can't override _attr_native_max_value in subclass

What version of SonoffLAN are you at? How you reloaded it, removed and reloaded it?

1 Like

Hi lordwizzard, I’m on 3.5.3 - I haven’t tried removing and re-adding yet; didn’t know if there was an in-place fix.

Half the time, when I post a question: I end up feeling so stupid :frowning: Of course, I didn’t check to see if there was a new version before spending the morning pouring over the syslogs.

Thank you for responding! Who know how much longer I would have gone before checking the FIRST thing I should have checked.

Hi there,

I have exactly the same problem and my firmware is the latest one - 3.7.6.

Sonoff is “unavailable” after HAOS update.

Any clues?

Hi there,

sorry misunderstood the comments up here … you guys talking about HACS. I thoughts this is about Sonoff firmware.

Will update HACS/Sonoff …