AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.75k stars 418 forks source link

2024.1.0 #1288

Closed milandzuris closed 11 months ago

milandzuris commented 11 months ago

2024.1.0b2

video: https://imgur.com/a/VDjhQxm

log:

Logger: homeassistant.components.number
Source: helpers/entity_platform.py:507
Integration: Number (documentation, issues)
First occurred: 17:40:11 (1 occurrences)
Last logged: 17:40:11

Error adding entities for domain number with platform sonoff
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 662, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 238, in capability_attributes
    self.native_min_value, floor_decimal, device_class
    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 70, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 269, in native_min_value
    if hasattr(self, "_attr_native_min_value"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 981 more times]
RecursionError: maximum recursion depth exceeded
yousaf465 commented 11 months ago

post device logs. same issue here.

mesut3000 commented 11 months ago

Same issue here.

https://github.com/AlexxIT/SonoffLAN/issues/1285

Tried everything nothing changed. Waiting for solution.

piio commented 11 months ago

I have also issue with 2024.1.0 - device status changes in ewelink app but in not refreshed anymore in home assistant

hmmbob commented 11 months ago

I have also issue with 2024.1.0 - device status changes in ewelink app but in not refreshed anymore in home assistant

It is for sure an issue in HA 2024.1, because when I roll back to 2023.12 the state is reported correctly again

hmmbob commented 11 months ago

Even weirder - the state seems to get updated sometime, because I suddenly noticed the light being on in my dashboard. If I hit the light again to turn it off, it actually does turn off but the state isn't updated in HA.

edit: this is fixed with the fix in https://github.com/AlexxIT/SonoffLAN/issues/1288#issuecomment-1876688902

mesut3000 commented 11 months ago

Even weirder - the state seems to get updated sometime, because I suddenly noticed the light being on in my dashboard. If I hit the light again to turn it off, it actually does turn off but the state isn't updated in HA.

Same here.

Also my router crashes when toggle sonoff devices. For example when the light is on, i can turn it off but home assistant shows it still on, when i press a few times i can turn on and off. But a few minutes later my router reboots. I am not sure that is related about that issue.

scooper1 commented 11 months ago

none of my Sonoff devices are working well. LAN connections not seeing any devices

Ih8rain2 commented 11 months ago

Same here. Since HA 2024.1.0b2 the entity status is no longer correct. I can’t toggle switches without restarting. Rolled back to 2023.11.3 and no problem

hmmbob commented 11 months ago

I tried yesterday if any changes to the main light component's init.py were to blame, but even when rolling back to the version that shipped with 2023.12 the issue did not resolve.

martamihai88 commented 11 months ago

After the update to 2024.1.0 I get this error also:

This error originated from a custom integration.

Logger: custom_components.sonoff.core.ewelink.cloud Source: custom_components/sonoff/core/ewelink/cloud.py:347 Integration: Sonoff (documentation, issues) First occurred: 12:05:08 AM (1 occurrences) Last logged: 12:05:08 AM

Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '10011078d8', 'apikey': '***', 'sequence': '1704319503000'}

GuidoKJ commented 11 months ago

Hi!

I can confirm that the integration is not working properly with Home Assistant 2024.1.0 (Final release).

None of my devices (Switches, NS Panels, Dual switches, fan controllers, etc.) appear to be working on showing their state change on HA. If I restart the integration it seems that it can retrieve the current status of all devices but no longer can control them if requested from HA.

Home Assistant Core Log shows:

Logger: homeassistant.components.number Source: helpers/entity_platform.py:507 Integration: Number (documentation, issues) First occurred: 6:16:58 PM (4 occurrences) Last logged: 6:51:35 PM

Error adding entities for domain number with platform sonoff Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 662, in _async_add_entity capabilities=entity.capability_attributes, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 238, in capability_attributes self.native_min_value, floor_decimal, device_class ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 70, in get val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 269, in native_min_value if hasattr(self, "_attr_native_min_value"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Previous line repeated 981 more times] RecursionError: maximum recursion depth exceeded

Im also getting the following errors:

Logger: homeassistant.helpers.entity Source: helpers/entity.py:1520 First occurred: 6:16:53 PM (63 occurrences) Last logged: 6:51:35 PM

Entity sonoff.sonoff_100148bd22 (<class 'custom_components.sonoff.climate.XClimateNS'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE: 1>, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation Entity sonoff.sonoff_100148c188 (<class 'custom_components.sonoff.climate.XClimateNS'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE: 1>, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation Entity sonoff.sonoff_1000becb6f (<class 'custom_components.sonoff.climate.XClimateTH'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE_RANGE: 2>, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation Entity sonoff.sonoff_1000bed05f (<class 'custom_components.sonoff.climate.XClimateTH'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE_RANGE: 2>, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation Entity sonoff.sonoff_100110d3a7 (<class 'custom_components.sonoff.fan.XFan'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <FanEntityFeature.SET_SPEED|PRESET_MODE: 9>, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

Logger: homeassistant.const Source: helpers/deprecation.py:204 First occurred: 6:16:52 PM (7 occurrences) Last logged: 6:17:17 PM

ELECTRIC_CURRENT_AMPERE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues ELECTRIC_POTENTIAL_VOLT was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues ENERGY_KILO_WATT_HOUR was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues POWER_WATT was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues TEMP_CELSIUS was used from frigate, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/blakeblackshear/frigate-hass-integration/issues

Logger: homeassistant.components.fan Source: helpers/deprecation.py:204 Integration: Fan (documentation, issues) First occurred: 6:16:52 PM (4 occurrences) Last logged: 6:16:52 PM

SUPPORT_PRESET_MODE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_SET_SPEED was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.SET_SPEED instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues

Logger: homeassistant.components.climate.const Source: helpers/deprecation.py:204 Integration: Climate (documentation, issues) First occurred: 6:16:50 PM (18 occurrences) Last logged: 6:16:52 PM

HVAC_MODE_HEAT_COOL was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.HEAT_COOL instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues HVAC_MODE_OFF was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.OFF instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_PRESET_MODE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_TARGET_TEMPERATURE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_TARGET_TEMPERATURE_RANGE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE_RANGE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues

alerton123 commented 11 months ago

Hi, after the 2024.1.0 update my sonoff devices stopped working properly, each entity turns on but turns itself back off moments later. the devices still respond and work correctly in the eweelink app. after restoring the previous 2023.12.4 the devices work as expected again. i see others are having similar issues so at least it is not just me :)

dimpep commented 11 months ago

reverting back to 2023.12.4 fixed it.

lordwizzard commented 11 months ago

NO Energy Readings Available

Adding more data:

Logger: homeassistant.components.climate.const Source: helpers/deprecation.py:204 Integration: Climate (documentation, issues) First occurred: 6:47:46 PM (9 occurrences) Last logged: 6:47:46 PM

HVAC_MODE_HEAT_COOL was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.HEAT_COOL instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues HVAC_MODE_OFF was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.OFF instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_PRESET_MODE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_TARGET_TEMPERATURE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_TARGET_TEMPERATURE_RANGE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE_RANGE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues


Logger: homeassistant.components.fan Source: helpers/deprecation.py:204 Integration: Fan (documentation, issues) First occurred: 6:47:46 PM (4 occurrences) Last logged: 6:47:46 PM

SUPPORT_PRESET_MODE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues SUPPORT_SET_SPEED was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.SET_SPEED instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues


Logger: homeassistant.const Source: helpers/deprecation.py:204 First occurred: 6:47:46 PM (6 occurrences) Last logged: 6:47:46 PM

TEMP_CELSIUS was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues ELECTRIC_CURRENT_AMPERE was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues ELECTRIC_POTENTIAL_VOLT was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues ENERGY_KILO_WATT_HOUR was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues POWER_WATT was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues


Logger: homeassistant.helpers.entity Source: helpers/entity.py:1520 First occurred: 6:47:50 PM (13 occurrences) Last logged: 6:47:50 PM

Entity None (<class 'custom_components.hacs.update.HacsRepositoryUpdateEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <UpdateEntityFeature.INSTALL|PROGRESS|RELEASE_NOTES: 21>, please create a bug report at https://github.com/hacs/integration/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation


Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:507 Integration: Sensor (documentation, issues) First occurred: 6:47:54 PM (1 occurrences) Last logged: 6:47:54 PM

Error adding entities for domain sensor with platform sonoff Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity entity.add_to_platform_start( File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 247, in add_to_platform_start if self.unique_id is None or self.device_class is None: ^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 70, in get val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 328, in device_class if hasattr(self, "_attr_device_class"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Previous line repeated 981 more times] RecursionError: maximum recursion depth exceeded


Logger: homeassistant Source: helpers/entity.py:338 First occurred: 6:47:54 PM (1 occurrences) Last logged: 6:47:54 PM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity entity.add_to_platform_start( File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 247, in add_to_platform_start if self.unique_id is None or self.device_class is None: ^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 70, in get val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 328, in device_class if hasattr(self, "_attr_device_class"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter return getattr(o, private_attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Previous line repeated 981 more times] RecursionError: maximum recursion depth exceeded

Sonoff Log

Sonoff log 20240103.txt

mogultekin commented 11 months ago

I have also issue with 2024.1.0 - device status changes in ewelink app but in not refreshed anymore in home assistant

It is for sure an issue in HA 2024.1, because when I roll back to 2023.12 the state is reported correctly again

+1 "I restored to 2023.12.4 and the Sonoff devices were back again."

sirdrums commented 11 months ago

I have also issue with 2024.1.0 - device status changes in ewelink app but in not refreshed anymore in home assistant

It is for sure an issue in HA 2024.1, because when I roll back to 2023.12 the state is reported correctly again

+1 "I restored to 2023.12.4 and the Sonoff devices were back again."

Same issue here. Can confirm it works back again after restoring to 2023.12.4.

jlrosssc commented 11 months ago

How can I restore to 2012.12.4 with docker compose pull to solve this issue?

lemonka commented 11 months ago

How can I restore to 2012.12.4 with docker compose pull to solve this issue?

edit Your docker-compose.yaml file and change line refering to image from:

image: homeassistant/home-assistant

to

image: homeassistant/home-assistant:2023.12.4

just make sure when issue will be solved to revert back this change to get updated image

danielmessem commented 11 months ago

I have also issue with 2024.1.0 - device status changes in ewelink app but in not refreshed anymore in home assistant

It is for sure an issue in HA 2024.1, because when I roll back to 2023.12 the state is reported correctly again

Exactly the same here, rolled back from 2024.1 and now it's working, when I go to 2024.1 it stops working - will stay on the ha version before 2024.1 for now

santypav commented 11 months ago

Esa modificación me produce un error de configuración.

I believe this was caused by home-assistant/core@1c8d961

Since XEntity inherits from Entity, the new caching invalidation strategy introduced in 2024.1.0 does not work properly.

https://github.com/AlexxIT/SonoffLAN/blob/ca812acca8b6a36888f6fc86236942792a387730/custom_components/sonoff/core/entity.py#L34

I managed to fix it by getting XEntity to inherit from ToggleEntity instead of Entity:

class XEntity(ToggleEntity):

This modification gives me a configuration error.

camui-alexandru commented 11 months ago

I believe this was caused by home-assistant/core@1c8d961

Since XEntity inherits from Entity, the new caching invalidation strategy introduced in 2024.1.0 does not work properly.

https://github.com/AlexxIT/SonoffLAN/blob/ca812acca8b6a36888f6fc86236942792a387730/custom_components/sonoff/core/entity.py#L34

I managed to fix it by getting XEntity to inherit from ToggleEntity instead of Entity:

class XEntity(ToggleEntity):

Dont try this !!!! This will resoults in all kind of error. DO NOT TRY THIS !!!

hmmbob commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

razim7 commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself.

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

works perfectly for me, better than reverting back, Thank you @hmmbob

PedroDelCargo commented 11 months ago

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Works perfectly for me. Thank you.

jordcoerse commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

Thank you good sir !

alerton123 commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

I can confirm that this fixes the issue for me thanks very much.

i had rolled back to 2023.12 to get things working again. i then commented out this line before updating to 2024.1 and its all good for me now after the 2024.1 update.

mesut3000 commented 11 months ago

Edit: It is working now.

hmmbob commented 11 months ago

Fix didnt work for me :(

A written in the post, it only works if Sonoff is starting correctly but doesn't show the correct state. It is not a fix for Sonoff failing to start.

PV-Web commented 11 months ago

Same issue here. Following to see if there will be an official fix for the issue. Or is what @hmmbob wrote the official fix for now?

raminhos commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

Working for me. THANK YOU!!!!

songzh1 commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

Working ! THANK YOU!

alexchini commented 11 months ago

OK, summing up so far:

XXX_XXX_XXX was used from sonoff, this is a deprecated constant which will be removed in HA Core 2025.1

This is only a warning. You can ignore this: everything still works (or not) regardless, this is not a breaking change. A fix for this warning has already been merged into the code and will be part of next release. Seriously, this is not the source of Sonoff breaking, it's just a warning.

Sonoff loads correctly on HA 2024.1, but my light/switch state doesn't get updated

This is an easy fix that you can apply yourself. It's a line of code for compatibility with HA 2021, but you're running 2024.1 anyways otherwise you wouldn't have this issue 😉

  • Go to the folder custom_components / sonoff / core on your server
  • Open the file entity.py
  • Comment out line 40: change _attr_is_on = None into # _attr_is_on = None
  • Save the file, and restart Home Assistant

Error adding entities for domain xxx with platform sonoff

Combined with RecursionError: maximum recursion depth exceeded

There's currently no fix known, stay on (or roll back to) HA 2023.12

This Work. Thank You!!!

milandzuris commented 11 months ago

@AlexxIT ?

OriginalCREart commented 11 months ago

Rolled back to 2023.12.4, until HA team fix this issue

for those who need to rollback, open your terminal, ssh to HA, use this command:

ha core update --version 2023.12.4

AlexxIT commented 11 months ago

I have spent the whole day for RecursionError without big success. Very heavy issue in the core code of Hass...

jamespoore commented 11 months ago

Thanks for everyones efforts, hmmbobs workaround at least got me going again. Cheers

hmmbob commented 11 months ago

I have spent the whole day for RecursionError without big success. Very heavy issue in the core code of Hass...

I can't help with that, but maybe a thought: as the minimum version of HA for the component will be 2023.1 anyways (due to the other recently merged PR), would it maybe make sense to start removing all backward compatibility thingies in the code and see if the error is still there?

If I look at bdraco's comment on Discord (the last lines, without yellow background) he is pointing to a piece of code that looks (to me) to be in place as backward compatibility piece?

Screenshot_20240104_183307_Discord

https://github.com/AlexxIT/SonoffLAN/blob/56f20553d6a12daec99a888e5b01577591831c3b/custom_components/sonoff/number.py#L56

Again, I'm no dev but maybe it's a way forward for you.

Regardless, thank you for your efforts here.

yousaf465 commented 11 months ago

@AlexxIT I would suggest, release an update with the current partial fix by @hmmbob PR, and fix the rest of the issue with the next release. At least something will start working again. Thanks for the great work.

JensJackowski commented 11 months ago

I have had also same trouble after updating to 2024.1.0

In my case the devices behaved totaly odd: HomeAssisstant was able to turn on a Switch like the 4channel bridge and shows the correct status but than it was not possible to turn it off via homeassistant. The R3 series worked as expeced but lost connection to HomeAssistant making HomeAssistant to show the device som "unavailble" - despite it still was connected to the WIFI and responded to commands from the eWeLink app.

I am not shure if this is the same problem, i found no errors in the logfiles.

But when i roled back the HomeAssistant Core update all worked just like before.

hmmbob commented 11 months ago

I have had also same trouble after updating to 2024.1.0

In my case the devices behaved totaly odd: HomeAssisstant was able to turn on a Switch like the 4channel bridge and shows the correct status but than it was not possible to turn it off via homeassistant. The R3 series worked as expeced but lost connection to HomeAssistant making HomeAssistant to show the device som "unavailble" - despite it still was connected to the WIFI and responded to commands from the eWeLink app.

I am not shure if this is the same problem, i found no errors in the logfiles.

But when i roled back the HomeAssistant Core update all worked just like before.

The first problem might be solved with the solution in https://github.com/AlexxIT/SonoffLAN/issues/1288#issuecomment-1876688902, for the 2nd issue there's currently no other solution than a roll back to 2023.12 for now.

AlexxIT commented 11 months ago

This was first issue about RecursionError: #1285

lordwizzard commented 11 months ago

After the update to 2024.1.0 I get this error also:

This error originated from a custom integration.

Logger: custom_components.sonoff.core.ewelink.cloud Source: custom_components/sonoff/core/ewelink/cloud.py:347 Integration: Sonoff (documentation, issues) First occurred: 12:05:08 AM (1 occurrences) Last logged: 12:05:08 AM

Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '10011078d8', 'apikey': '***', 'sequence': '1704319503000'}

That is either a Wifi coverage issue, or a cloud transport issue. I have found it is usually resolve by restarting HA.

AlexxIT commented 11 months ago

@hmmbob that was first what I do. Thanks, very helpful. But not the cause of problem :)

alerton123 commented 11 months ago

i now received and installed the v3.5.4 update. it seems to be working fine again. thanks very much to hmmbob for his quick response and fantastic temp fix and to AlexxIT for this excellent integration and the update.

lordwizzard commented 11 months ago

Yes, AlexxIT and the others who contributed to the SonoffLAN fix for 2024.1.0 HA update did a fantastic job! Appreciate all the hard and fast work to understand what the changes to HA by the update and have a excellent fix in a day or two was incredible! AlexxIT also responded to other issues with great answers. THANK YOU!!