Closed MatthiasRei closed 7 months ago
Same here.
Same here
Same here. would be great to address #140 as well when fixing that in order to recover the lost data...
Can confirm, no data since 07.11. In theory, if we fix this, the import should resume from 07.11. onwards. The issue with #140 is really only if data between two dates is missing.
Right now, I cannot really look into this - have to prepare many things for my day job right now :(
So a quick fix would be to replace the string "zaehlpunkt" with the actual "Kundennummer" in client.py wherever it appears in "/zahlpunkt/AT..."? Could somebody try?
Tested and it works.
You need to change in /wnsm/api/client.py
the line 304:
endpoint = f"messdaten/zaehlpunkt/{zaehlpunkt}/verbrauch"
Just repleace zaehlpunkt
with your customer number.
and what about line 278? (in verbrauchRaw)?
For me it was enough to change line 304 to get statistic data.
Amazing, it works! I changed both instances, just to be on the safe side :)
Hello, same issue here.. unfortunately I could not apply the fix properly: what I did is I changed line 304 endpoint = f"messdaten/zaehlpunkt/{12xxxxx}/verbrauch" and rebooted HA. The code changed is there but there is no data for the days after Nov 7. Am I not waiting long enough for the data loading? thanks for your Help!
Hello, same issue here.. unfortunately I could not apply the fix properly: what I did is I changed line 304 endpoint = f"messdaten/zaehlpunkt/{12xxxxx}/verbrauch" and rebooted HA. The code changed is there but there is no data for the days after Nov 7. Am I not waiting long enough for the data loading? thanks for your Help!
You have to keep {zaehlpunkt}. It has to look like:
endpoint = f"messdaten/12xxxxxx/{zaehlpunkt}/verbrauch"
it works
if zaehlpunkt is None:
zaehlpunkt = self._get_first_zaehlpunkt()
endpoint = f"messdaten/fillinhereyourcustomernumber/{zaehlpunkt}/verbrauch"
query = const.build_verbrauchs_args(
dateFrom=self._dt_string(date_from),
dayViewResolution=resolution.value,
)
return
after reboot and missing data shows up
yes it works. thank you for the fast feedback and clarification @markwien @MatthiasRei
@DarwinsBuddy thanks for fixing! I pulled the latest version and data was immediately synced.
I thought I'll give it a try today. Nice to know that it's working. ☺️
Version: 1.3.2
Since 07.11.2023 I will not get any statitistic updates in HA.
Debug logs from HA:
2023-11-09 13:25:45.793 DEBUG (MainThread) [custom_components.wnsm.statistics_sensor] {'optIn': False, 'consumptionAverage': 0, 'consumptionMinimum': 0, 'consumptionMaximum': 0} 2023-11-09 13:25:45.793 ERROR (MainThread) [custom_components.wnsm.statistics_sensor] No values in API response! This likely indicates an API error. Original response: {'optIn': False, 'consumptionAverage': 0, 'consumptionMinimum': 0, 'consumptionMaximum': 0}
I compared the request with the request from "https://smartmeter-web.wienernetze.at/#/verbrauchsdarstellung" and it looks like they changed the API request. Instead of
zaehlpunkt
it is necessary to use thecustomer number
:Old:
https://api.wstw.at/gateway/WN_SMART_METER_PORTAL_API_B2C/1.0/messdaten/zaehlpunkt/AT.....
New:
https://api.wstw.at/gateway/WN_SMART_METER_PORTAL_API_B2C/1.0/messdaten/120184xxxx/AT...
I tried both requests with powershell (generate the command with the dev tools from chrome). With your request I will receive the same response as in the HA logs![Screenshot 2023-11-09 134210](https://github.com/DarwinsBuddy/WienerNetzeSmartmeter/assets/59359122/bd039c67-ea47-4218-bbeb-b69d41d8b28b)
{'optIn': False, 'consumptionAverage': 0, 'consumptionMinimum': 0, 'consumptionMaximum': 0}
:With the new request:![Screenshot 2023-11-09 134636](https://github.com/DarwinsBuddy/WienerNetzeSmartmeter/assets/59359122/b22b5224-c6ec-4886-af33-4585d1b277b0)