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

Cada vez que reinicio HA no me carga "Precio Luz" #39

Open
habibi1969 opened this issue Jul 2, 2024 · 0 comments
Open

Cada vez que reinicio HA no me carga "Precio Luz" #39

habibi1969 opened this issue Jul 2, 2024 · 0 comments

Comments

@habibi1969
Copy link

Al reiniciar HA "Precio Luz" se queda deshabilitado, para habilitarlo de nuevo es necesario ir a ajustes del v2c y recargar las entidades, con eso vuelve a habilitarse.

En cada reinicio me aparecen estos errores en el log:

2024-07-02 21:09:30.226 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform v2c_trydan is taking over 10 seconds.
2024-07-02 21:09:30.374 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'v2c_trydan' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/v2c_trydan/sensor.py, line 285: async_track_state_change(self.hass, ["switch.v2c_trydan_switch_paused"], self.handle_paused_state_change), please create a bug report at https://github.com/Rain1971/V2C_trydant/issues
2024-07-02 21:09:30.382 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.v2c_precio_luz for domain sensor with platform v2c_trydan
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1354, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/v2c_trydan/sensor.py", line 497, in async_added_to_hass
    await update_state(None)
  File "/config/custom_components/v2c_trydan/sensor.py", line 462, in update_state
    entities = await find_entities()
               ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/v2c_trydan/sensor.py", line 426, in find_entities
    entities["paused_switch"] = self.hass.data["switch"].get_entity(entity_id)
                                ~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'switch'

Veo en los errores, en la segunda línea menciona que para 2025.5 se eliminará esa función, aunque no parece tener nada que ver con el error.

¿Saben a que se debe este comportamiento y como se puede solucionar?

Muchas gracias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant