DarwinsBuddy / WienerNetzeSmartmeter

A home-assistant integration supporting WienerNetze Smartmeters as sensors
121 stars 12 forks source link

No values in API response #204

Closed reox closed 5 months ago

reox commented 6 months ago

Since December 16th and with v1.4.1 I get this error:

 No values in API response! This likely indicates an API error. Original response: {'optIn': True, 'consumptionAverage': 0, 'consumptionMinimum': 0, 'consumptionMaximum': 0} 

Anyone else seeing this? @DarwinsBuddy Has the API changed once more? There are values in the WN Dashboard...

DarwinsBuddy commented 6 months ago

as I changed it on the weekend I got back the right values. I guess I've to again get rid of calls to /verbrauchRaw in favor of /verbrauch as it's not reliable.

I hope I get to it this week. maybe even today

Sup3rMario commented 6 months ago

i have the problem too!

mundschenk-at commented 6 months ago

Looks like the update is not working for a lot of people. Has anyone tested reverting to the previous release?

Sup3rMario commented 6 months ago

Hello together,

Unfortunately I can't go back. But here are my data:

wnsm version 1.4.1, installed on December 16, 2023 10:46 p.m

HA see print screens

Von: Der Mundschenk & Compagnie @.> Gesendet: Samstag, 23. Dezember 2023 07:13 An: DarwinsBuddy/WienerNetzeSmartmeter @.> Cc: Mario Linhart @.>; Comment @.> Betreff: Re: [DarwinsBuddy/WienerNetzeSmartmeter] No values in API response (Issue #204)

Looks like the update is not working for a lot of people. Has anyone tested reverting to the previous release?

— Reply to this email directly, view it on GitHub https://github.com/DarwinsBuddy/WienerNetzeSmartmeter/issues/204#issuecomment-1868218606 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACN7UYCWV4HAJAXHI5KSD4TYKZY45AVCNFSM6AAAAABAZBRVEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGIYTQNRQGY . You are receiving this because you commented. https://github.com/notifications/beacon/ACN7UYABM6QZVOAXDGWYK2TYKZY45A5CNFSM6AAAAABAZBRVEOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTPLLAO4.gif Message ID: @. @.> >

reox commented 6 months ago

I think I see the problem. The endpoint returns no values key when there is no data - before that meant something is wrong. now this just means, that there is no data yet. Removing the return from _import_statistics should fix it. I'm testing this right now!

reox commented 6 months ago

huh, why do I only get daily data now?! Okay, so something else has changed too :/

However, the import is working again in principle ^^

reox commented 6 months ago

ahh okay - the issue is the verbrauchRaw endpoint cannot handle hourly data. That one is only used to get daily consumptions. At least that is how it works on the dashboard.

reox commented 6 months ago

There is even a (hacky) way to remove statistics and re-import hourly ones (might also be a trick for later...)

with SQLite Web installed, first query the metadata_id of the statistics sensor, by looking into the date statistics_meta. Mine was 49. Then delete all statistics data starting from some timestamp:

delete FROM "statistics" where metadata_id = 49 and start_ts >= 1702508400;

but you better have a backup before you do this ;)