nordicopen / easee_hass

Custom component for Easee EV charger integration with Home Assistant
215 stars 36 forks source link

Usage of time_to_live on set_circuit_dynamic_limit #386

Closed cpoulsen closed 9 months ago

cpoulsen commented 9 months ago

Question

When using time_to_live on set_circuit_dynamic_limit i expected the limitation to only be present on the charger for the number specified, but it seems like the limitation is permanent until changed.

Am i misunderstanding the usage of the time_to_live option?

What version of the integration are you using?

0.9.56

Anything in the logs that might be useful for us?

No response

Additional information

No response

olalid commented 9 months ago

That was the intention, but from looking quickly at the code I think it was not implemented correctly... I will look more later during weekend.

cpoulsen commented 9 months ago

That was the intention, but from looking quickly at the code I think it was not implemented correctly... I will look more later during weekend.

Awesome 💪 I wasnt able to find the endpoint in question from the Easee docs to verify if this option is supported there

cpoulsen commented 9 months ago

@olalid i located the API here https://developer.easee.com/reference/post_api-sites-siteid-circuits-circuitid-dynamiccurrent However when calling it directly from the developer portal, it doesnt seem to care about the ttl either

olalid commented 9 months ago

In any case there is a bug in the code, so the time to live parameter is never actually used when calling the API. So that will be corrected in a coming release.

olalid commented 9 months ago

See https://github.com/nordicopen/easee_hass/pull/388

olalid commented 9 months ago

For what is worth, the latest release has a fix for this now.

cpoulsen commented 9 months ago

Awesome. Had a chat with the Easee support team meanwhile

“If you want to actively load balance the circuit, they can use SetDynamicCircuitCurrent with a TTL. This command must be sent to the master charger, so that it will load balance the circuit according to the command sent by the operator. If the operator does not send a new command before the TTL expires, the charger can fall back to the offline fallback. Example scenario I can think of is load balancing between multiple circuits, or other consumers on the same circuit/fuse.

Basically if the charger doesn’t receive a new dynamic current command within the TTL interval, it can go into offline fallback settings. […] Yes, the values will not go back. The charger, however, will use the offline settings. You need to set the limits back manually.

It might be a little confusing, but the TTL for the endpoint works a bit different than you would expect.”