Closed antonmosich closed 8 months ago
Can confirm "descriptor" issue.
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:573
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 14:03:02 (1 occurrences)
Last logged: 14:03:02
wnsm: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 573, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1216, in async_device_update
await self.async_update()
File "/config/custom_components/wnsm/statistics_sensor.py", line 123, in async_update
await self._import_bewegungsdaten(smartmeter)
File "/config/custom_components/wnsm/statistics_sensor.py", line 187, in _import_bewegungsdaten
recording = await self.get_bewegungsdaten(smartmeter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wnsm/base_sensor.py", line 156, in get_bewegungsdaten
response = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wnsm/api/client.py", line 506, in bewegungsdaten
if data["descriptor"]["zaehlpunktnummer"] != zaehlpunkt:
~~~~^^^^^^^^^^^^^^
KeyError: 'descriptor'
Additionally I get this one but I think that might not be related to wnsm:
Logger: homeassistant.helpers.template
Source: helpers/template.py:2318
First occurred: 14:02:19 (3 occurrences)
Last logged: 14:06:19
Template variable warning: 'dict object' has no attribute 'displaymetric' when rendering '{{ value_json.displaymetric }}'
sorry for the back and forth. I think we have to invest into proper e2e tests
I'm sorry, I'm really not deep enough into home-assistant to provide a proper bug report, but for me it only shows "Unknown" for the added entity, and isn't able to load any data from the API. Looking at my logs I seem to have 3 errors with this plugin. The first has this Traceback:
The second one just says unable to load consumption without further information. The third one has the following information (anonymized)