nathanmarlor/foxess_em

Fox Cloud retry handling improvements

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Last night, for the second time, the Min SoC (Grid) setting was not set back to the configured level after scheduled charging. It was set to 100% when I woke up this morning, meaning the battery was not discharging from 04:30 onwards, causing the house to draw from the grid for a few hours. The failure was due to Fox Cloud being down at the end of the scheduled charging period.

Logger: custom_components.foxess_em.fox.fox_cloud_service
Source: custom_components/foxess_em/fox/fox_cloud_service.py:115
Integration: FoxESS - Energy Management ([documentation](https://github.com/nathanmarlor/foxess_em), [issues](https://github.com/nathanmarlor/foxess_em/issues))
First occurred: 04:30:07 (1 occurrences)
Last logged: 04:30:07

Could not make request to Fox Cloud - HTTP Status: 502

Describe the solution you'd like
Fox Cloud has proven to be unreliable, with frequent outages. Currently, EM seems to retry 5 times with 10 second intervals. This is fine if the outage is short-lived, but not so useful if the outage is anything longer than a minute or so.

  • Would it be possible to extend the retry logic to maybe try again over an exponentially increasing interval? e.g. 1 minute, 2 minute, 5 minute, 15 minute, 30 minute etc. I don't know if that's possible, just a suggestion.
  • Is there a reason the Min SoC setting is used to force charging instead of the built-in charge scheduling feature? That way, once the schedule is saved to the inverter the charging will stop even if Fox Cloud is unavailable.

Describe alternatives you've considered
I'm migrating to the RS485 over ethernet option using Waveshare converter. Which will hopefully be more reliable and remove the dependency on Fox Cloud. Other users may still want to use Fox Cloud, and it would be great to ensure it's as reliable as possible.

Additional context
N/A

Thank you for all the hard work on this! Minus the Fox Cloud outages and BST funniness, the integration has been fantastic.