stevebuk1 / pv_opt

Home Assistant PV Optimisation for Solis Inverters
MIT License
0 stars 0 forks source link

IOG hold slots are causing writes to the inverter every optimiser run #4

Closed stevebuk1 closed 3 months ago

stevebuk1 commented 3 months ago

On IOG, when there is no house charge plan, house battery prevention slots (using charge current = 0) are causing the start time to be written to on every optimer run.

The desired behaviour is that the start time remains unchanged for the entire IOG slot so that writes to the inverter are minimised.

stevebuk1 commented 3 months ago

Reason for the behavior is that a status of "charging" is not set unless the inverter current is greater than zero. IOG hold slots should be seen as charge slots as they are utilsing the Solis start and end times.

            status[direction]["active"] = (
                time_now >= status[direction]["start"]
                and time_now < status[direction]["end"]
                and status[direction]["current"] = 0      
                and status["switches"]["Timed"]
                and status["switches"]["GridCharge"]

change fourth line to read and status[direction]["current"] >= 0