uvejota / homeassistant-edata

Home Assistant integration for spanish energy data providers (e.g., datadis)
GNU General Public License v3.0
264 stars 22 forks source link

Error while setting up edata platform for sensor, después de reinstalar eDATA 2024.07.2 #255

Closed JoseBoria closed 3 months ago

JoseBoria commented 3 months ago

Realizado todo el proceso sin problemas. Esperando 24 horas. En el registro me muestra lo siguiente:

Registrador: homeassistant.components.sensor Fuente: helpers/entity_platform.py:364 integración: Sensor (documentación, problemas) Ocurrió por primera vez: 18:31:51 (3 ocurrencias) Último inicio de sesión: 17:18:28

Error while setting up edata platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/edata/sensor.py", line 199, in async_setup_entry coordinator = await EdataCoordinator.async_setup( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/edata/coordinator.py", line 187, in async_setup 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/edata/coordinator.py", line 76, in init self._edata = EdataHelper( ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/edata/helpers.py", line 74, in init self.datadis_api = DatadisConnector( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/edata/connectors/datadis.py", line 108, in init self._load_recent_cache() File "/usr/local/lib/python3.12/site-packages/edata/connectors/datadis.py", line 115, in _load_recent_cache recent_queries = json.load(dst_file) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/init.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 794 (char 793)

uvejota commented 3 months ago

Por algún motivo tu fichero de caché está corrupto.

Renombra el directorio /config/.storage/edata y prueba a reiniciar la integración (o home assistant)

JoseBoria commented 3 months ago

Gracias por el apoyo. Funcionando correctamente después de reiniciar.