home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.25k stars 30.59k forks source link

"Attribute hass is None for {self}" error on SolaX Power integration #59478

Closed WhyNine closed 2 years ago

WhyNine commented 2 years ago

The problem

The SolaX Power integration has stopped retrieving any data since I updated yesterday to the last hass version. I installed hass a couple of weeks ago with the then latest version and it was working fine at that point.

What version of Home Assistant Core has the issue?

2021.1.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

SolaX Power

Link to integration documentation on our website

https://www.home-assistant.io/integrations/solax/

Example YAML snippet

sensor:
  - platform: solax
    ip_address: 5.8.8.8

Anything in the logs that might be useful for us?

Logger: homeassistant
Source: helpers/entity.py:289
First occurred: 9 November 2021, 20:04:51 (1824 occurrences)
Last logged: 11:16:20
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/solax/sensor.py", line 73, in async_refresh
    sensor.async_schedule_update_ha_state()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 441, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 289, in async_write_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity Solax SWZTNG7NXA PV1 Current: 0.0>

Additional information

The hardware is a Raspberry Pi 4 with the latest Raspberry Pi OS with the desktop environment.

probot-home-assistant[bot] commented 2 years ago

solax documentation solax source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @squishykid, mind taking a look at this issue as it has been labeled with an integration (solax) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

WhyNine commented 2 years ago

I had some of the entites for SolaX disabled, including the PV1 Current. Re-enabling it didn't seem to make a difference (not sure about the error code at this point) so I removed solax from the configuration.yaml and all the SolaX entities, restarted the server and added them again. Now they are showing up ok again.

WhyNine commented 2 years ago

Rebooted the Pi and the error has come back.