krbaker / hass-sunpower

Home Assistant SunPower Integration using the local installer ethernet interface.
Apache License 2.0
63 stars 23 forks source link

Integration stopped working #90

Open dombrowa opened 4 weeks ago

dombrowa commented 4 weeks ago

Core 2024.10.4 Supervisor 2024.10.3 Operating System 13.2 Frontend 20241002.4

Two VMS both failed to load integration

Errors

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 10:47:02 PM (1 occurrences)
Last logged: 10:47:02 PM

Error setting up entry PVS 192.168.0.131 for sunpower
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sunpower/__init__.py", line 385, in async_setup_entry
    await coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sunpower/__init__.py", line 348, in async_update_data
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError: Global task timeout

Other

Logger: custom_components.sunpower
Source: helpers/update_coordinator.py:354
integration: SunPower ([documentation](https://github.com/krbaker/hass-sunpower), [issues](https://github.com/krbaker/hass-sunpower/issues))
First occurred: 10:42:08 PM (174351 occurrences)
Last logged: 10:47:02 PM

Unexpected error fetching SunPower PVS data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sunpower/__init__.py", line 348, in async_update_data
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sunpower/__init__.py", line 287, in sunpower_fetch
    data = convert_sunpower_data(sunpower_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sunpower/__init__.py", line 105, in convert_sunpower_data
    create_vmeter(data)
  File "/config/custom_components/sunpower/__init__.py", line 74, in create_vmeter
    freq_avg = sum(freq) / len(freq)
               ~~~~~~~~~~^~~~~~~~~~~
ZeroDivisionError: division by zero

Warning is likely not relevant

Log details (WARNING)
Logger: homeassistant.const
Source: helpers/deprecation.py:197
First occurred: 10:42:03 PM (1 occurrences)
Last logged: 10:42:03 PM

POWER_VOLT_AMPERE_REACTIVE was used from sunpower, this is a deprecated constant which will be removed in HA Core 2025.9. Use UnitOfReactivePower.VOLT_AMPERE_REACTIVE instead, please report it to the author of the 'sunpower' custom integration

curl command to 192.168.0.131 is working fine (e.g. curl http://192.168.0.131/cgi-bin/dl_cgi?Command=GridProfileRefresh)

In a 2nd HASS VM I removed the integration and started to add it again. It finished after >5 min with success but did not find any device

image

dombrowa commented 4 weeks ago

Attempted

  1. Restart PVS6 system
  2. Remove and Re-add integration
  3. Downgrade: ha core update --version 2024.10.3
  4. Restart PVS6 system
  5. Remove and Re-add integration
  6. Install a new VM with 13.1 as before, add integration, no devices found
    
    Logger: custom_components.sunpower
    Source: helpers/update_coordinator.py:354
    integration: SunPower ([documentation](https://github.com/krbaker/hass-sunpower), [issues](https://github.com/krbaker/hass-sunpower/issues))
    First occurred: 11:45:56 PM (211761 occurrences)
    Last logged: 11:50:50 PM

Unexpected error fetching SunPower PVS data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/sunpower/init.py", line 348, in async_update_data return await hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/sunpower/init.py", line 287, in sunpower_fetch data = convert_sunpower_data(sunpower_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/sunpower/init.py", line 105, in convert_sunpower_data create_vmeter(data) File "/config/custom_components/sunpower/init.py", line 74, in create_vmeter freq_avg = sum(freq) / len(freq)


ZeroDivisionError: division by zero
```
suggests there is something wrong with the connection.

7. Restarting the Rasp Pi despite having used all commands

```
Start
Stop
Get_Comm
DeviceList
CheckFW
DeviceDetails
GridProfile
GridProfileRefresh
GetCellPurchased
GetDiscoveryProgress
SetCellPurchased
```
successfully

Maybe integration cannot be re-added at night because some components return error?
dombrowa commented 3 weeks ago

I readded the integration after sunrise in a new VM -> success I reloaded the integration on the original HASS -> success

Closing issue.