Continuing thread using
#AmberElectric now with
#homeassistant. The
#Modbus integration works well with my
#Sungrow SH10RT inverter and Sungrow home battery. The home assistant
#AmberElectric integration works well for the most part, but I have noticed it just stops occasionally, which is fixed by a restart of HA.
I have had to create some bespoke code to choose the best sell time for the inverter based on the feed-in forecast from Amber. The code is triggered from automation using pyscript integration. Fortunately the version of HomeAssistant I’m on includes numpy and pandas, so doing some definite integration (trapz) over the leccy forecast price does not require any python module installs. I have also included some additional features not available in the Amber automation.
1. Overnight reserve level, stop exporting power when battery is at a predetermined level to allow for overnight use, (but above minimum reserve level as per Amber app for grid outages). This means I never charge from the grid.
2. Floor price. when calculating sell time in the evening do not sell if the feed in price is below a certain level. This preserves battery cycles for better prices in the future. Floor price is also active as a trigger when exporting from the battery if the price drops while selling
3. Stop exporting power from the battery if a better price is found in the near future. Configurable threshold for the stop trigger.
4. Delay charging the battery In the morning when the feed in price is still positive, and instead export power to the grid. Later if the feed in price is still positive, opt to charge the battery in the middle of the day
I will be giving a talk on this at the Programmable.tech conference in Melbourne and Sydney in March. I will also share the python and automation yaml on gh at some point.