-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No hourly data downloaded when the account includes an inactive zaehlpunkt ("Returned data does not match given zaehlpunkt!") #208
Comments
And also the consumed energy (KWh) in the home assistant energy board appears with one day delay. This means in HA I see the consumption of Monday as if it had been consumed on Tuesday. Can this be fixed/improved? Edit: |
As an update: deleting all entities and recreating the entities in the integration did not solve the issue. I'm only seeing daily data. The attribute |
Do you see statistics in the sensor that is unavailable? See also the FAQ for more information: #19 If that is not the case and you still see only daily data: do you see hourly data in the wiener netze dashboard? If no - than there is an issue with the smartmeter itself. If yes, please check the debug log from homeassistant |
reox, thanks. I can see hourly and 15min charts in https://smartmeter-web.wienernetze.at . In HA only the sensor with daily data contains data. the Searching for my sensor name or for "wiener" or "netze" in
…or is my next step to remove everything, reboot and start fresh? |
ah okay, the "unavailable" is fine, but you should see some statistics... yes, please add the debug logging for the custom component.
But I guess that just depends how your component is named? |
I actually don't know what a "component" is in HA, is it a developer term? I'm using the integration and have not yet seen a way to rename the integration. I don't know where/how to check which components I have running. |
I think it only matters how it is named in the custom_components folder, but I'm not sure either... It prints some debug output in any case, thus if it is correctly enabled, you should see some output |
@donkristo I did press that button and 60 seconds later I pressed it again. The browser started to download a 70MB (!!) logfile. This didn't feel helpful at all. |
That’s weird. When I click the button there is no download at all. |
After enabling debug logging and rebooting HA I got the following error:
I'm not sure how do deal with the issue " |
I see, so I guess you triggered this TODO: WienerNetzeSmartmeter/custom_components/wnsm/api/client.py Lines 435 to 440 in 32fb66e
could you paste a anonymized version of the debug output of |
The problem is then, that if the historic data import fails, also no new data is imported - or possibly runs into a similar issue... |
Loading the full log grepping for wnsm does seem to show an issue: When logging into my logwien account in the HA wnsm integration, three entities were created. Two of them share the same zählpunkt, one with last 4 digits of Zählpunkt of active apartment: 1977 To me the log looks like it's querying the data for the active zaehlpunkt but then attempts to store this data in a statistics_sensor for the old (deactivated) zaehlpunkt. Interestingly the address I can see in the log is for my old apartment, although the query in the log line right above queries the zaehlpunkt of the active address.
|
hmmm okay, the issue is here:
I can just speculate here: Either the API has changed or you have some special device... What you can do is comment out these lines: WienerNetzeSmartmeter/custom_components/wnsm/statistics_sensor.py Lines 124 to 126 in 32fb66e
such that only
is started. If any statistical data is present in the sensor, the historical data import will not trigger and it should work (if there are not any other quirks with your sensor...) However, there is something else:
And if you look in the screenshot carefully, it says "inaktiv seit 15.10.2021". |
As mentioned, in my account I have listed two Zähler with each a Zählpunktnummer. One is where I lived until 3 years ago (which is inactive), the other is where I currently live (which is active). In https://smartmeter-web.wienernetze.at/#/anlagedaten I can't see any way to remove the old place I lived in, so I can imagine that some API calls might return data for both zaehlpunkte? And I commented out lines 124-127 and restarted HA, now I'm seeing the following error:
Please also see my logfile from before:
I might be completely wrong, but based on the logfile I can speculate that the API call returns data for all zaehlpunkte associated with the account and not just for the single zaehlpunkt requested. Is that possible? |
okay, I see. But unfortunately, I don't know how to resolve this, because I cannot really test it with my account :( The cleanest solution I can think of would be to add a checkbox during integration setup, where you could disable the import of historical data. Apparently this is what crashes your script. You can try to download the CSV file in the wiener netze dashboard and while doing this check with the developer tools which endpoint is called. Maybe you can spot a difference between the two!
ah, yes - the start is missing, because it wasn't set before.
|
Thanks for all your assistance. I understand that it's hard to resolve such issues. Is there any code I could add or activate that will put the entire API payload (request & response) into the debug log? I could then redact it where necessary and post it here. |
Using the wiener netze dashboard I found two API calls that might be relevant:
|
This unfortunately leads to:
I then tried to add
|
@DarwinsBuddy and @reox Unfortunately the issue is not fixed, please reopen the issue. Here's the same error with version 1.4.3 that was released today:
|
If you installed the plugin manually, you might need to clean up the |
Thanks, but I installed it via HACS two weeks ago. |
@maia let's try to get to the bottom of this. Can you...
|
Thanks. Here's the current debug log after a HA restart. It's exactly the same as 5 days ago with the previous version. The issue is that the way the integration requests the data leads to a payload containing the (non-existant) data for the old address I no longer live in, instead of requesting the data for the current address. I've redacted the data but kept the last 4 digits of the zaehlpunktnummer and added a note if this is the current address or the old address I've not been living in for 3 years.
Also in case it gets lost in the many comments above, using the wiener netze dashboard I found two API calls that might be relevant
Is it intended that the integration uses |
Ah now I get it. Well for the integration it's not clear from just the responses of the API if a zaehlpunkt is a legacy one carried along by Wiener Netze or not. So unless you've disabled your sensors associated with that Zaehlpunkt you'll get that error. So if you already know that this sensor will not get you any data just disable it and you're fine. Please respond if that solved your problem, so I can close the issue. |
@DarwinsBuddy The sensor of the inactive zaehlpunkt has been disabled in HA, as you can see above #208 (comment). It still doesn't work. I also tried enabling it, but that doesn't help either. |
did you disable both sensors the live and the statistics one? |
As you can see in the screenshot in the linked comment above, the inactive zaehlpunkt only has one entity, without _statistics sensor, so I only disabled the one that was generated. |
Let me summarize once more what the issue is here:
Please correct me if anything here is summarized not correctly, or if you would expect a different behaviour. Please confirm if you can see the historical data for the statistics sensor. Once again I want to emphasize that it's very difficult to deliver an experience that is for everyone fitting with this integration, as the API underlies sudden breaking changes and we have no other way than reverse engineering it when it breaks. There is no public documentation or public API which we can leverage. To some extent we are as well dependent on what Wiener Netze responds, which can be wrong and sometimes appear to us as random. |
Regarding your suggestion. It is worth digging into, though I could not reproduce it unfortunately, as my frontend already uses some ominous new endpoint
|
Correct.
Partly correct. The sensor with
Wrong. The sensor is created, but just one and not also the
I can see the daily data, but not the data per 15 or 60 minutes, although these charts are available on my Wiener Netze dashboard. And based on the logfiles the reason is most likely that HA unfortunately is requesting data for the inactive zählpunkt I have not been living at the past 3 years and then erroring out due to the inability to process the response.
I understand and this is why I have been asking how to enable the display of the entire API payload in the logfiles. I'm willing to analyse what's going wrong and report it as exactly as possible, but without knowing the queries HA sends and the response it gets, I can't report more than I did in all my comments above. Please let me know what I'd need to add in the code to dump the payload into the debug log, thanks. |
got you. I'll try to implement more verbose logging in my next change (can't really promise when this will be though) and we can dig into it together afterwards. Sorry for the back and forth and thanks for your patience |
I released a new version with some fixes to the statistics import. @maia I added also extensive logging if we still run into issues. Let's regroup in a separate issues and discuss from there if you still have troubles. :) |
@DarwinsBuddy Thanks, much appreciated. I'm removing, rebooting & reinstalling as I'm tying this here. |
@DarwinsBuddy Is there a way I could send you a (redacted) logfile of ~800 lines? There still is an issue, unfortunately. Thanks! |
thanks for the email |
EDIT: If you scroll down a bit you'll see that the issue is most likely caused by the fact that my wiener netze account includes an inactive zaehlpunkt of an apartment I've moved out of long ago. Either the integration sends a request for the wrong zaehlpunkt or uses the wrong API call, as the wiener netze dashboard properly displays the 15 minute data for the active zaehlpunkt.
–––
I'd like to see hourly data for my energy consumption in HA (at least for the previous day), but I'm only displayed daily data. I've opted in to the hourly resolution at logwien / Wiener Netze a week ago. In HA I'm seeing two entities that have been created, one has a high energy (lightning) icon, this one has one value once per day (usually around 2am), the other entity has the suffix
_statistics
, has a meter icon, the status is constantly at "unavailable".For now I am trying to delete all entities and reconfigure the device/entities, but I might only see if it works tomorrow. And besides that, is there anything I need to do or to debug?
Thanks!
The text was updated successfully, but these errors were encountered: