fboundy / pv_opt

Home Assistant PV Optimisation for Solis Inverters
Other
27 stars 6 forks source link

Fix for IOG tariff going stale and Zappi logging #215

Closed stevebuk1 closed 6 months ago

stevebuk1 commented 7 months ago

When the IOG tariff is loaded at midnight UTC (1am BST) it loads 27 hours of data, so through to the next day at 04:30. After that, the df (which is reset to cover 48 hours at midnight BST) is still filled with the cheap rate for data beyond the 27 hours. Once we roll all the way from the 1am load to the time it really counts, which is just before 23:20, we don't have an expensive rate on file, so no charging occurs.

This PR creates a separate contract load for IOG., set to 4.40pm daily. This does not include the same checks that Agile has for when the tariff expires, because it doesn't load sufficient data to get it through to that point. The time at least ensures that an expensive rate is on file when the plan just before cheap rate makes the final charging decision. A later time may be more beneficial, this is under investigation.

The Zappi historic consumption logging was creating an empty dataframe due to an extra +, removing this now logs data which on first glance now looks correct.