Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hass 2024.1 error: RecursionError #1285

Closed
mesut3000 opened this issue Dec 31, 2023 · 13 comments
Closed

Hass 2024.1 error: RecursionError #1285

mesut3000 opened this issue Dec 31, 2023 · 13 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mesut3000
Copy link

mesut3000 commented Dec 31, 2023

I have 24 Sonoff devices in my system. I have been using them for years. But I am not sure why, my system is crashing and devices can not respond from Home Assistant. Everything is OK by the Ewelink app.

I removed HACS addon, integration many times and installed again. I can see all my devices but they do not respond.

For switches there is also a strange thing. When I turn on one, it turns but on Home Assistants it is still off. It cant read its state.

This is what I see this error in my logs:

Log details (ERROR)
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:507
Integration: Sensor ([documentation](https://rc.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 08:40:44 (1 occurrences)
Last logged: 08:40:44

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 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1278, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 529, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  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 449, in native_value
    return self._attr_native_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 976 more times]
RecursionError: maximum recursion depth exceeded
@mattomu22
Copy link

Hallo. Exactly same problem for me. Always perfect and now stopped. Ewlink app is working fine. I think it is coincident with latest HA update. Following...

@lloydcferguson
Copy link

Same problem

@dCypherNx
Copy link

Same here, just updated HA core to 2024.1.0b2, was working fine until 2023 stable and beta versions

@lloydcferguson
Copy link

Strangely enough, it is working now!

I could not access my Sonoff device through the eWeLink app on Android either. tried reinstalling with no luck. A;so noticed that my phone would not connect to the "guest" WiFi net work with an error like "could not get IP address". Rebooted my AT&T fiber gateway and also had to restart the 2.4 GHz WiFi, and everything now works. I've seen the IP Address problem on the gateway before. haven't had a chance to dig into it.

This is what I suspect happened:

  • The Sonoff device got an IP address while the DHCP service on the gateway was working. I seem to remember that once a device has an address it will keep it even if a subsequent lease renewal fails so, it just kept it even though the DHCP service stopped at some point.
  • I did unplug the Sonoff device yesterday and when I reconnected it it could not get an address so it went off-line in both Home Assistant and the Sonoff app.

@mesut3000
Copy link
Author

Strangely enough, it is working now!

I could not access my Sonoff device through the eWeLink app on Android either. tried reinstalling with no luck. A;so noticed that my phone would not connect to the "guest" WiFi net work with an error like "could not get IP address". Rebooted my AT&T fiber gateway and also had to restart the 2.4 GHz WiFi, and everything now works. I've seen the IP Address problem on the gateway before. haven't had a chance to dig into it.

This is what I suspect happened:

  • The Sonoff device got an IP address while the DHCP service on the gateway was working. I seem to remember that once a device has an address it will keep it even if a subsequent lease renewal fails so, it just kept it even though the DHCP service stopped at some point.
  • I did unplug the Sonoff device yesterday and when I reconnected it it could not get an address so it went off-line in both Home Assistant and the Sonoff app.

eWelink app works for me. There is nothing wrong there. I think there is something wrong between Home Assistant and eWelink app. I can turn on a light on Home Assistant which has Sonoff integration, but its state remains off.

@lloydcferguson
Copy link

lloydcferguson commented Jan 1, 2024 via email

@mesut3000 mesut3000 mentioned this issue Jan 1, 2024
@mesut3000
Copy link
Author

Both the App and Home Assistant are working for me...


From: mesut3000 @.>
Sent: Sunday, December 31, 2023 2:43:52 PM
To: AlexxIT/SonoffLAN @.
>
Cc: lloydcferguson @.>; Comment @.>
Subject: Re: [AlexxIT/SonoffLAN] Integration not working (Issue #1285)

Strangely enough, it is working now!

I could not access my Sonoff device through the eWeLink app on Android either. tried reinstalling with no luck. A;so noticed that my phone would not connect to the "guest" WiFi net work with an error like "could not get IP address". Rebooted my AT&T fiber gateway and also had to restart the 2.4 GHz WiFi, and everything now works. I've seen the IP Address problem on the gateway before. haven't had a chance to dig into it.

This is what I suspect happened:

  • The Sonoff device got an IP address while the DHCP service on the gateway was working. I seem to remember that once a device has an address it will keep it even if a subsequent lease renewal fails so, it just kept it even though the DHCP service stopped at some point.
  • I did unplug the Sonoff device yesterday and when I reconnected it it could not get an address so it went off-line in both Home Assistant and the Sonoff app.

eWelink app works for me. There is nothing wrong there. I think there is something wrong between Home Assistant and eWelink app. I can turn on a light on Home Assistant which has Sonoff integration, but its state remains off.


Reply to this email directly, view it on GitHub#1285 (comment), or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZY265ASIDWD3IW7UFARSIDYMHTCRAVCNFSM6AAAAABBIAYJ2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGA2DSMRWGM.
You are receiving this because you commented.Message ID: @.***>

Which Home Assistant release do you have. I think 2024.1 beta has this issue.

@gcarneiro
Copy link

Same problem here, my automations started failing and device status it is not working. Problem began after ha core 2024 update

@SpartanTech
Copy link

Same problem here after a 2024 core update. Works fine in the app. Integration fails to retrieve states. Can send commands just fine.

Screenshot_20240104_034458_Solid Explorer
Screenshot_20240104_034518_Solid Explorer

@SpartanTech
Copy link

Running 2024.1.0 stable

@hmmbob
Copy link
Contributor

hmmbob commented Jan 4, 2024

There's a fix for that available in #1288

@SpartanTech
Copy link

Much love. So many hours today working on it

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 4, 2024

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants