twhittock / eo_mini

EO Mini integration for Home Assistant
MIT License
13 stars 6 forks source link

Features depreciated, entities routinely unavailable - help please! #10

Closed Paulholloway closed 7 months ago

Paulholloway commented 7 months ago

Versions

87c314d

HA: Core 2024.3.0 Supervisor 2024.03.0 Operating System 12.0 Frontend 20240306.0

Logs

/homeassistant/home-assistant.log

2024-03-09 18:54:10.577 WARNING (MainThread) [homeassistant.const] TIME_SECONDS was used from eo_mini, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.SECONDS instead, please create a bug report at https://github.com/twhittock/eo_mini/issues
2024-03-09 18:54:10.585 WARNING (MainThread) [homeassistant.const] ENERGY_WATT_HOUR was used from eo_mini, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.WATT_HOUR instead, please create a bug report at https://github.com/twhittock/eo_mini/issues

2024-03-14 18:04:48.250 ERROR (MainThread) [custom_components.eo_mini] Error fetching eo_mini data: 

2024-03-14 18:09:48.252 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 261, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 417, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
    update_callback()
  File "/config/custom_components/eo_mini/sensor.py", line 58, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1052, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 451, in state_attributes
    raise ValueError(
ValueError: Entity sensor.eo_mini_pro_2_em_12345_consumption (<class 'custom_components.eo_mini.sensor.EOMiniChargerSessionEnergySensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured.

Describe the bug

EO Entities are routinely unavailable and are unreliable. On reload the entity is available but quickly becomes unavailable on button press / after short duration.

Paulholloway commented 7 months ago

More logs:

Log Details (ERROR)

This error originated from a custom integration.
Logger: custom_components.eo_mini
Source: helpers/update_coordinator.py:350
integration: EO Mini (documentation, issues)
First occurred: 19:34:10 (2 occurrences)
Last logged: 19:35:24

Error fetching eo_mini data:
2024-03-19 19:34:10.851 ERROR (MainThread) [custom_components.eo_mini] Error fetching eo_mini data: 
...
2024-03-19 19:35:24.780 ERROR (MainThread) [custom_components.eo_mini] Error fetching eo_mini data: 
Paulholloway commented 7 months ago

@twhittock Are you able to have a look at this please?

twhittock commented 7 months ago

Yeah, at some point soon. I've been busy recently.

Paulholloway commented 7 months ago

Thanks. Hopefully it’s an easy fix. Is there a link to buy you a coffee, at least, for your troubles? 

twhittock commented 7 months ago

The total_increasing thing was issue #2 I'm not really sure why it became an error, but it should have been fixed ages ago... That's done.

The "unit of *" stuff was just a warning, but i updated those, too.

This should now be working, in version b2309d1, which HACS should see soon.