Closed jorgror closed 10 months ago
Easee has specifically asked us to not do this. If their servers go offline, and all clients start to try and reconnect with 5 second intervals it is a big challenge for them to get them online again. We have implemented reconnect in the HA component instead which has increasing timeouts, so it will not put that load on the servers during startup.
Would it be okey if we have reconnect as a parameter that default to false? That way home assistant can choose to use it without reconnect, while other consumers of the library can enable reconnect?
I remembered incorrectly, the reconnect logic is implemented in the lib, so it should already work. At least I have not noted any problems with reliability in the HA component. What is that you are seeing that you want to solve?
I have noticed in some situations that the stream has been stuck and not recovering by itself. I have tried to recreated it, but I have not been sucessful. I will close this PR until I'm able to create a reproducable test and fix.
Ok, let us know if you find more details.
If it is possible to have the ping enabled without having the automatic reconnect, perhaps that would be ok. But I am not sure the lib supports that...?
Configure signalr core to use automatic reconnect with keep alive (ping) Ref: https://github.com/mandrewcito/signalrcore/tree/main#configuring-pingkeep-alive
keep_alive_interval is set to 15 seconds, which is equal to what easee.cloud uses.
This will send a ping every 15 seconds, and hopefully will improve reliability of the signalr connection.