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

Upgrade from 24.12.22 to v25.02.14 - Sensors inconsistent values. #426

Open
coserotondo opened this issue Feb 16, 2025 · 5 comments
Open
Labels
bug Something isn't working

Comments

@coserotondo
Copy link

coserotondo commented Feb 16, 2025

Description

I updated from v24.12.22 (very stable in my case - but dhcp deprecation in latest HA) to v25.02.14 two days ago. Apparently all fine (on top of the logs below) but data seemed to be reliable. Today, looking at Energy Dashboard, I found very “huge” values in solar production, energy imported / exported… and so I realized the those sensors had some 0, unavailable or spikes and so history added the values after 0 (I think it has been interpreted as reset of total_increasing sensors. I reverted back to v24.12.22 and did manual adjustments to history, trying lo align with real values.
Using custom inverter definition (based on Sofar Wi-Fi kit).

Image
Image
Image

Reproduction Steps

Upgrade from 24.12.22 to v25.02.14.

Log

2025-02-16 00:06:15.813 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/solarman/pysolarman/pysolarman.py", line 169, in _conn_keeper
    data = await self.reader.read(1024)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/streams.py", line 730, in read
    await self._wait_for_data('read')
  File "/usr/local/lib/python3.13/asyncio/streams.py", line 525, in _wait_for_data
    raise RuntimeError(
        f'{func_name}() called while another coroutine is '
        f'already waiting for incoming data')
RuntimeError: read() called while another coroutine is already waiting for incoming data
2025-02-16 03:06:14.473 ERROR (MainThread) [custom_components.solarman.coordinator] Timeout fetching FV data
2025-02-16 15:25:28.656 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _async_refresh
    self.async_update_listeners()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 178, in async_update_listeners
    update_callback()
    ~~~~~~~~~~~~~~~^^
  File "/config/custom_components/solarman/entity.py", line 78, in _handle_coordinator_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 614, in state
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Sensor sensor.fv_inverter_alert_message provides state value '', which is not in the list of options provided

Version

25.02.14

Home Assistant Core Version

2025.2.4

Home Assistant Operating System Version

14.2

@coserotondo coserotondo added the bug Something isn't working label Feb 16, 2025
@AlexRux
Copy link

AlexRux commented Feb 21, 2025

I agree

Image

this has ruined all my data. in HomeAssistant you can't remove bad data. Now i'll have forever this spikes on my graphs.

@as-cmi
Copy link

as-cmi commented Feb 21, 2025

Confirm. I rolled back to 24.12.2 and solved the issue

@Gavin-A92
Copy link

Gavin-A92 commented Feb 21, 2025

Seeing something similar.......recurring daily but at different times so no real consistency there.
Still on 2025.02.14 for now so let me know if I can help with anything....

Below is log in HA from latest "blip" but not sure it tells anything....

Source: components/sensor/__init__.py:642
First occurred: 21:29:32 (1 occurrences)
Last logged: 21:29:32

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 635, in state
    numerical_value = int(value)
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 638, in state
    numerical_value = float(value)
ValueError: could not convert string to float: ''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _async_refresh
    self.async_update_listeners()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 178, in async_update_listeners
    update_callback()
    ~~~~~~~~~~~~~~~^^
  File "/config/custom_components/solarman/entity.py", line 78, in _handle_coordinator_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    raise ValueError(
    ...<5 lines>...
    ) from err
ValueError: Sensor sensor.solarman_total_charge_discharge_cycles has device class 'None', state class 'total_increasing' unit 'None' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)```

@heebo1974
Copy link

heebo1974 commented Feb 25, 2025

Image

I got this kind of results with 25.02.14
Inverter: Sofar 4.4 KTL-X
Inverter definitions: sofar_lsw3.yaml

@heebo1974
Copy link

I also tried that earlier 24.12.22 version, but I got same kind of results with that.
It is weird that energy dashboard shows larger kWh than the sensor itself, which is probably caused by those 0 spikes.

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

5 participants