ricott / homey-no.easee

Easee app for Homey
GNU General Public License v3.0
5 stars 5 forks source link

App crashing or loosing connection to api #68

Closed Homey4Osty closed 7 months ago

Homey4Osty commented 7 months ago

Hello. Since the issues at the end of the last year with the API gateway at easee, sometimes my app is loosing the connection the my wallbox or my app is crashing. It happens about 4 times this year.... I sent a report (72a1e67e-246d-4c24-9ba4-487cd935fdc1) to you. Restarting the app makes everything working again. Please can you take a look at it? My car isn't charging or is changing during high power prices...

Thx.

ricott commented 7 months ago

I got the diag report. I can see this a lot in the error log. This is not a common error, wonder if have even seen it in a diag report before. 2024-01-30T20:53:20.873Z [err] [ManagerDrivers] [Driver:charger] [Device:7a89629a-1644-44cd-b6d2-f13eb6391b43] Error: Command didn't return a state after '50' attempts!

This means that we sent a command to Easee cloud that in turn sent it to the charger. This is an async process, so to get the result of the command, if the charger accepted it or not, we are polling an endpoint in the Easee cloud to get the result. This endpoint hadn't gotten a reply back from the charger after the Homey app polled that endpoint 50 times (0.5s between each invocation).

I know the "queue" between Easee cloud and the charger can get saturated and if so there is no way during a period of time to invoke any command on the charger using any app. Can't tell if that is the case here. But in general, don't invoke too many commands in a short time.

I can see one call to disable the charger. This is not recommended to use frequently since this is stored permanently in the charger's flash memory, which has a limited number of writes during its lifetime. If you want to control charging instead lock the access to the charger, meaning you need to manually authorize a charge session in the app or use a registered RFID tag. You "lock" the charger manually once using for instance the Easee mobile app. This way you can connect the car at any time and it won't start charging. Then you build your logic in a flow to start and stop charging. Triggering the turn on/off action will automatically authorize the charger and it will start to charge.

Homey4Osty commented 7 months ago

Thanks for the fast support. I deleted the disable - call from all flows. I implemented it cause I only need the wallbox for 2 h per day. And now it needs 22 h standby power.

I hope that the issue won't happen again. At night (about 3:20 am) the box got a signal and it was activated. The call about 30 mins later didn't work. Both calls were from easee, not from my homey. Now the box is only 24/7.

I'll take a look at it and - perhaps - will implement an app-restart in front of a signal to the app.

If you want, you can close this ticket. I'll open a new one, if it's happened again.

Thanks again. Osty

Homey4Osty commented 7 months ago

I had no issues since changing my flows .. thx. I'll close this ticket!