DarwinsBuddy/WienerNetzeSmartmeter

no data since 26.8.24

Opened this issue · 17 comments

as some time before no data is synced to HA. new version is installed und HA was restarted!

reox commented

do you see data in the wiener netze dashboard?

yes

reox commented

any errors/warnings in the log?

Stopped working for me on August 23.

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:985
integration: Sensor (documentation, issues)
First occurred: August 23, 2024 at 21:16:16 (138 occurrences)
Last logged: 14:16:18

Updating wnsm sensor took longer than the scheduled update interval 1:00:00

Since then this gets logged hourly, but no other errors/exceptions.

edit: not sure if related, because i did get data for up until August 22... a few days earlier on 20:

2024-08-20 18:16:26.109 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.at0010000000000000001000015****** is taking over 10 seconds
2024-08-20 18:16:26.111 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.at0010000000000000001000015******_statistics is taking over 10 seconds
2024-08-20 18:16:28.357 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.at0010000000000000001000015****** fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/scanner.py", line 79, in scan_once
    return _scan_once(string, idx)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/scanner.py", line 70, in _scan_once
    raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
    await self.async_update()
  File "/config/custom_components/wnsm/live_sensor.py", line 29, in async_update
    zaehlpunkt = await self.get_zaehlpunkt(smartmeter)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
    contracts = await self.hass.async_add_executor_job(smartmeter.zaehlpunkte)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/wnsm/api/client.py", line 253, in zaehlpunkte
    return self._call_api("zaehlpunkte")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api
    None if response is None or response.json() is None else json.dumps(response.json(), indent=2)))
                                ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-08-20 18:16:28.455 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.at0010000000000000001000015******_statistics fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/scanner.py", line 79, in scan_once
    return _scan_once(string, idx)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/scanner.py", line 70, in _scan_once
    raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
    await self.async_update()
  File "/config/custom_components/wnsm/statistics_sensor.py", line 110, in async_update
    zaehlpunkt = await self.get_zaehlpunkt(smartmeter)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
    contracts = await self.hass.async_add_executor_job(smartmeter.zaehlpunkte)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/wnsm/api/client.py", line 253, in zaehlpunkte
    return self._call_api("zaehlpunkte")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api
    None if response is None or response.json() is None else json.dumps(response.json(), indent=2)))
                                ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
W-M-B commented

hi,
I think have the same issue: I have daily values from wiener netze both in the smartmeter portal from Wiener Netze and also in HA.
but I dont have any hourly or quarterly values in smartmeter portal and also not in HA.
hence this is an issue with Wiener Netze.
/

I have the same issue: I have daily values from wiener netze both in the smartmeter portal from Wiener Netze and also in HA.

then you do not have the same issue. this is about receiving no data at all since a few days ago, e.g. me since August 23.

W-M-B commented

So you also have no data on a daily basis?
grafik

so you also have no data on a daily basis?

... yes, that is what those words mean:

this is about receiving no data at all since a few days ago, e.g. me since August 23.

smartmeter portal has data:

image

W-M-B commented

ok, sorry for my misunderstanding.

ok, sorry for my misunderstanding.

is alright. sorry, if i was too harsh. requests to close issues without proper resolution trigger me 😬

Error Message:

Logger: homeassistant.helpers.frame
Quelle: helpers/frame.py:184
Erstmals aufgetreten: 05:24:12 (1 Vorkommnisse)
Zuletzt protokolliert: 05:24:12

Detected that custom integration 'wnsm' calls async_forward_entry_setup for integration, wnsm with title: Wiener Netze Smartmeter and entry_id: 01J30KP39R5EPDF5NDKNBSRAJG, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/wnsm/init.py, line 15: await hass.async_create_task(, please create a bug report at https://github.com/DarwinsBuddy/WienerNetzeSmartmeter/issues

and i think the same as above by fdemmer:

Logger: homeassistant.components.sensor
Quelle: helpers/entity_platform.py:727
Integration: Sensor (Dokumentation, Probleme)
Erstmals aufgetreten: 05:24:15 (6 Vorkommnisse)
Zuletzt protokolliert: 05:24:16

wnsm: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/init.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 727, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
await self.async_update()
File "/config/custom_components/wnsm/statistics_sensor.py", line 110, in async_update
zaehlpunkt = await self.get_zaehlpunkt(smartmeter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
contracts = await self.hass.async_add_executor_job(smartmeter.zaehlpunkte)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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/wnsm/api/client.py", line 253, in zaehlpunkte
return self._call_api("zaehlpunkte")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api
None if response is None or response.json() is None else json.dumps(response.json(), indent=2)))
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

reox commented

which is deprecated

This doesnt matter. Could you increase the level to debug and check if you see anything fishy? If there is no error message, then the API did not respond with any data.
Do you have multiple zählpunkte by chance? Or did something change recently?

Updating wnsm sensor took longer than the scheduled update interval 1:00:00

Okay wow, something probably is hanging there. There should be timeouts with 1min and thus 1h is waaay too long. Could you also increase debug level and check if you see something fishy?

Maybe there is something going on with the API that we cannot control ...

reox commented

mhh okay, so it seems like that the JSON that comes from the API is a problem...
actually, I see a similar error, but it works for me:


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/wnsm/statistics_sensor.py", line 110, in async_update
    zaehlpunkt = await self.get_zaehlpunkt(smartmeter)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
    contracts = await self.hass.async_add_executor_job(smartmeter.zaehlpunkte)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/wnsm/api/client.py", line 243, in zaehlpunkte
    return self._call_api("zaehlpunkte")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wnsm/api/client.py", line 218, in _call_api
    None if response is None or response.json() is None else json.dumps(response.json(), indent=2)))
                                ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I guess one first step is to make the debug log work even if the response is bad and instead print the raw text

W-M-B commented

Wednesday Evening is standard MW Window for Wiener Stadtwerke.. if this delay message is from today, maybe the system has not yet fully recovered from that Maintenance Window.

from the log:

2024-08-29 05:24:15.950 ERROR (MainThread) [homeassistant.components.sensor] wnsm: Error on device update!
File "/config/custom_components/wnsm/statistics_sensor.py", line 110, in async_update
File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
File "/config/custom_components/wnsm/api/client.py", line 253, in zaehlpunkte
File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api
2024-08-29 05:24:16.010 ERROR (MainThread) [homeassistant.components.sensor] wnsm: Error on device update!
File "/config/custom_components/wnsm/live_sensor.py", line 29, in async_update
File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
File "/config/custom_components/wnsm/api/client.py", line 253, in zaehlpunkte
File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api
2024-08-29 05:24:16.019 ERROR (MainThread) [homeassistant.components.sensor] wnsm: Error on device update!
File "/config/custom_components/wnsm/statistics_sensor.py", line 110, in async_update
File "/config/custom_components/wnsm/base_sensor.py", line 107, in get_zaehlpunkt
File "/config/custom_components/wnsm/api/client.py", line 253, in zaehlpunkte
File "/config/custom_components/wnsm/api/client.py", line 228, in _call_api

but after i restarted HA once more this morning, data shows in HA