Comments (26)
@fsaris we can see in the api that some installations are performing an update request every minute. Our data only refreshes every 5 minutes. So this means that these installations are basically spamming our API with pointless requests.
It would be great if you could setup a refresh time of 5 minutes or more. This would reduce the, pointless, load on our api.
from home-assistant-zonneplan-one.
It probably needs a redesign of the solution. The price information (the source) actually changes only once a day (around 1-2pm currently) - all info is then "known" and can be used for the sensors later in the day (it won't change anymore - all prices for all timeframes are known already) including the "actual tariff" sensor. So that would negate the need to request all data every 5 mins., we could just update the sensors in accordance with the known tariff at the known timeslot. So your sensors still update in time, but the info is request way less often.
Basically i'm saying "we should be caching" - but with a lot of words
edit: and for some expectation management: I can hack some existing code (hence the previous PRs for some small fixes) but I am no Python dev - so don't hold your breath waiting for me to raise a PR for this 😉
from home-assistant-zonneplan-one.
@deqw @hmmbob I added the ETag to the request header. Now Zonneplan can tell us if there is updated data. Every endpoint is polled every 10 seconds and depending on the ETag check (that they perform) we get new data or a status 304 Not Modified. This should give more up-to-date data for the charge points without hammering there API
from home-assistant-zonneplan-one.
Looks like a temporary hickup on there side
from home-assistant-zonneplan-one.
I have the same error, since last friday.
from home-assistant-zonneplan-one.
I have the same, the service is unavailable very often, many times per hour. The own Zonneplan app seems to work fine during those moments. Can it be something else then their server having problems?
from home-assistant-zonneplan-one.
I'm experiencing this issue as well. I think a quick solution could be to simply not update sensors when getting an error like this. Then, in the future perhaps it could be added to expire values that are time bound (like setting the electricity price to unknown
when the next hour starts)
from home-assistant-zonneplan-one.
I am also relying on this plugin for my energy use logging. But I'm afraid, when these problems continue, I can better use a P1 splitter and log energy usage directly from the P1 port again, like I did before...
from home-assistant-zonneplan-one.
Same here, it is completely unusable at this moment. Goes down every 5-15 minutes.
from home-assistant-zonneplan-one.
It looks like the API is working again
from home-assistant-zonneplan-one.
mmm, need to check the HA inner code again. My logs show that even when the api call fails it uses the previous values, but somehow the values are not visible in the stats.
from home-assistant-zonneplan-one.
I think they fix it before they left the office because no more errors after 17.00 :-)
from home-assistant-zonneplan-one.
It seems their app wont work during these times either.
from home-assistant-zonneplan-one.
Same issue here, app is working
from home-assistant-zonneplan-one.
Same here, all entities (except gas price for some reason) unavailable right now.
A couple of days ago it was the other way around, then the gas price was unavailable.
Where can I find logs, would that help?
from home-assistant-zonneplan-one.
It was set to 2mins actually, but I've raised a PR to change it to 300sec (=5min)
from home-assistant-zonneplan-one.
As I (and perhaps others?) am only using the hourly changing pricefeeds for my total cost and smart device integrations, perhaps in a future update the interval could be settable according to usage, during setup?
So
- when using 'live' data like current power consumption, set 5 min interval
- When using hourly rates only: 30 minute interval (or so)
from home-assistant-zonneplan-one.
@hbeekhuis I'm using the price to trigger charging. Your solution results in waiting much too long before I can start and stop charging.
from home-assistant-zonneplan-one.
@hmmbob That would work. And maybe doing regular requests when the time window that lays ahead shortens too much (eg. when no updates came in at the expected time).
from home-assistant-zonneplan-one.
Another option would be respecting the etag caching headers. But didn't yet find a native python solution for this. Will give it some more thought. Help is welcome :)
from home-assistant-zonneplan-one.
@deqw @hmmbob I added the ETag to the request header. Now Zonneplan can tell us if there is updated data. Every endpoint is polled every 10 seconds and depending on the ETag check (that they perform) we get new data or a status 304 Not Modified. This should give more up-to-date data for the charge points without hammering there API
Hi @fsaris,
This is not how ETags work, an ETag is a generated hash based on the content the server produces. This means that the server still has to do all the work, the only thing it saves is data transfer.
So if you move to polling every 10 seconds, our server will be overloaded with a ton of pointless requests.
Please go back to 300 seconds. 😄
What was said before is correct, this plugin should be caching data itself like the prices which do not change for hours.
from home-assistant-zonneplan-one.
@rdgout okay, that's a unfortunate 😄
Will revert it back. Can you tell me with what interval the charge point
endpoint updates its values? Especially after performing an action as start/stop charge.
from home-assistant-zonneplan-one.
@rdgout okay, that's a unfortunate 😄
Will revert it back. Can you tell me with what interval the
charge point
endpoint updates its values? Especially after performing an action as start/stop charge.
Charge points update on a fixed 5 minute schedule, however, they may also send updates every time something changes.
What we do in the app is poll for updates after we request a change for a fixed period until we see the change has happened. This will require some sort of keeping state to know when the change has happened otherwise it will be just asking for data continuously.
So basically what you could do:
- Send instruction (like boost, stop charging)
- Poll every 10 seconds to see if the change has happened. (started or stopped charging with a maximum of a minute, so 6 times)
- If the change has not happened after this minute, assume the instruction has failed.
It would be great however if you would not implement this in a naive way where the plugin just keeps trying to send instructions and spam our API anyway, instructions may fail for any number of reasons like:
- The charge point is disconnected (literally turned off by the client)
- 4G is not working due to a network / ISP error
- The charge point is not connected to a car
If you could make sure instructions are sent only when the car is connected AND not in an error state, that would probably resolve most issues that could arise otherwise.
from home-assistant-zonneplan-one.
@fsaris
We have noticed that a fair amount of HomeAssistant installations have started requesting updates every 10 seconds, for some installations this has lead to an average of 1 request every second.
Did you change something or do these people have a version where the update timer was changed to 10 seconds?
We would love to leave the current limits in place but if this continues we will be forced to implement rate limiting since we are not expecting this many requests.
I also noticed that if a customer has electricity and gas that the integration requests the /summary endpoint for both connections. The data in /summary is essentially the same for each connection.
Can you look into this and see why it's happening?
from home-assistant-zonneplan-one.
@rdgout the refresh was only for a short time set to 10 seconds and this wasn't part of a official release. Maybe it's the charge point users that are testing a beta, but there is already a new release that only polls every 5 minutes.
Will have a look at the summary call
from home-assistant-zonneplan-one.
@rdgout the 0.021b1 release had a 10sec interval for the poll. Just removed that beta release. The new beta release was released yesterday so all users that use the beta will probably update soon and that should result in less traffic for your server's
from home-assistant-zonneplan-one.
Related Issues (20)
- Multiple zero values retrieved throughout the day for delivery/production of Zonneplan home battery HOT 4
- Powerplay compensation sensor HOT 16
- Current electricity tariff one hour off since Summertime HOT 2
- Thuisbatteriij sensors stopped updating HOT 6
- Entity "Schedule start and end" is not working anymore HOT 8
- Gas price not updating anymore HOT 3
- Powerplay HOT 3
- Connect call failed HOT 10
- HomeAssistantType
- deprecated alias HOT 1
- Detected blocking call to open inside the event loop (HA 2024.6) HOT 2
- sensor.zonneplan_current_usage Shows 0 HOT 9
- How does it work? HOT 6
- Just errors in the logs HOT 4
- No trigger on current elect. tariff HOT 3
- New costs sensors have wrong state_class HOT 5
- Data is rounded HOT 10
- Zonneplan last measured value update only once per hour HOT 4
- Deprecated constants used in Zonneplan integration HOT 2
- Only one of two PV installation shown (both present on one address) HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home-assistant-zonneplan-one.