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.
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:
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:
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.
Originally posted by @rdgout in https://github.com/fsaris/home-assistant-zonneplan-one/issues/49#issuecomment-1818638004