NECH2004 / smartmeter_austria

Home Assistant integration for Austrian Smart Meter using the M-BUS interface
MIT License
10 stars 3 forks source link

"Error doing job: Task exception was never retrieved (None)" #8

Open zaubara opened 1 month ago

zaubara commented 1 month ago

System Health details

System Information

version core-2024.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.33-haos
arch x86_64
timezone Europe/Vienna
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4990 Installed Version | 1.34.0 Stage | running Available Repositories | 1391 Downloaded Repositories | 17
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 7.1 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | Mosquitto broker (6.4.1), TasmoAdmin (0.30.4), Zigbee2MQTT (1.39.0-1), Duck DNS (1.18.0), File editor (5.8.0), SSH Tunnel & Forwarding (1.2.1), NGINX Home Assistant SSL proxy (3.9.0), SQLite Web (4.2.0), Advanced SSH & Web Terminal (18.0.0)
Dashboards dashboards | 5 -- | -- resources | 2 views | 3 mode | storage
Recorder oldest_recorder_run | 22. Juli 2024 um 11:09 -- | -- current_recorder_run | 1. August 2024 um 11:30 estimated_db_size | 156.54 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

The integration works perfectly fine, but there seems to be an underlying issue - maybe just with EVN. The log spams the error described and an additional warning (native_value has a generic error. None) every polling interval. Could this be the Reactive energy in/out that is not being displayed?

Reproduction steps

Watch the log file and wait for a poll

Debug logs

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant
Quelle: custom_components/smartmeter_austria/sensor.py:118
Integration: Smart Meter Austria (Dokumentation, Probleme)
Erstmals aufgetreten: 11:30:51 (20 Vorkommnisse)
Zuletzt protokolliert: 11:41:56

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/smartmeter_austria/sensor.py", line 106, in native_value
    raise ConfigEntryNotReady()
homeassistant.exceptions.ConfigEntryNotReady: None

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 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 491, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1068, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 533, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartmeter_austria/sensor.py", line 118, in native_value
    raise ConfigEntryNotReady() from exception
homeassistant.exceptions.ConfigEntryNotReady: None

Diagnostics dump

No response

NECH2004 commented 1 month ago

Sorry, I am a customer of Salzburg Netz and therefore cannot test EVN. But your assumption related to Reactive Energy is a good guess: Id would be nice if you could try to remove both sensors from sensor.py (line 41/42). (I'll try to look into this issue in the next 10 days).

zaubara commented 1 month ago

Yep, that seems to be it - no more warnings. Looks like the easiest way would be to create the sensors conditionally? Unfortunatelly I don't have experience with HA plugins.