fboundy / pv_opt

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

export tariff OUTGOING-LITE-FIX-12M-23-09-12 causes 400 error #105

Closed mergwyn closed 8 months ago

mergwyn commented 9 months ago

Describe the bug Im currently on the above export tariff. When I use this tariff pv_opt fails.

I suspect this is because the tariff has no end date.

To Reproduce

  1. Select the above tariff in the config
  2. Initialisation fails with 400 error

Expected behavior Tariff to be treated as valid

Logs The config:

  octopus_import_tariff_code: E-1R-GO-18-06-12-F                                                                                                                                                                                                  
  octopus_export_tariff_code: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F  

Detecting the config in the logs:

2024-02-04 15:31:46.858473 INFO pv_opt: Starting Opimisation with discharge enabled
2024-02-04 15:31:46.859185 INFO pv_opt: -------------------------------------------
2024-02-04 15:31:46.859864 INFO pv_opt: 
2024-02-04 15:31:46.860571 INFO pv_opt: Checking tariffs:
2024-02-04 15:31:46.861282 INFO pv_opt: -----------------
2024-02-04 15:31:46.866274 INFO pv_opt:   Import: E-1R-GO-18-06-12-F                       Start: 2023-05-31 23:30:00+0000 End: 2024-02-06 00:30:00+0000 
2024-02-04 15:31:46.867082 INFO pv_opt:   Export: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F    Start: 2023-09-11 23:00:00+0000 End: N/A 
2024-02-04 15:31:46.867813 INFO pv_opt:   - Tariffs OK
2024-02-04 15:31:46.868516 INFO pv_opt: 

The error:

2024-02-04 15:31:51.337563 WARNING HASS: Error setting Home Assistant state default.sensor.pvopt_opt_cost, {'state': 0.0, 'attributes': {'friendly_name': 'PV Opt Optimised Cost', 'device_class': 'monetary', 'state_class': 'measurement', 'unit_of_measurement': 'GBP', 'cost_today': 0.0, 'cost_tomorrow': 0.0, 'soc': [{'period_start': '2024-02-04T15:30:00+00:00', 'soc': 9.0}, {'period_start': '2024-02-04T16:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T16:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'soc': 21.35}, {'period_start': '2024-02-05T01:30:00+00:00', 'soc': 32.7}, {'period_start': '2024-02-05T02:00:00+00:00', 'soc': 44.04}, {'period_start': '2024-02-05T02:30:00+00:00', 'soc': 55.39}, {'period_start': '2024-02-05T03:00:00+00:00', 'soc': 66.74}, {'period_start': '2024-02-05T03:30:00+00:00', 'soc': 78.09}, {'period_start': '2024-02-05T04:00:00+00:00', 'soc': 89.44}, {'period_start': '2024-02-05T04:30:00+00:00', 'soc': 88.73}, {'period_start': '2024-02-05T05:00:00+00:00', 'soc': 86.46}, {'period_start': '2024-02-05T05:30:00+00:00', 'soc': 83.91}, {'period_start': '2024-02-05T06:00:00+00:00', 'soc': 81.78}, {'period_start': '2024-02-05T06:30:00+00:00', 'soc': 81.21}, {'period_start': '2024-02-05T07:00:00+00:00', 'soc': 80.65}, {'period_start': '2024-02-05T07:30:00+00:00', 'soc': 79.37}, {'period_start': '2024-02-05T08:00:00+00:00', 'soc': 76.96}, {'period_start': '2024-02-05T08:30:00+00:00', 'soc': 71.53}, {'period_start': '2024-02-05T09:00:00+00:00', 'soc': 67.04}, {'period_start': '2024-02-05T09:30:00+00:00', 'soc': 64.11}, {'period_start': '2024-02-05T10:00:00+00:00', 'soc': 62.37}, {'period_start': '2024-02-05T10:30:00+00:00', 'soc': 63.45}, {'period_start': '2024-02-05T11:00:00+00:00', 'soc': 64.35}, {'period_start': '2024-02-05T11:30:00+00:00', 'soc': 66.26}, {'period_start': '2024-02-05T12:00:00+00:00', 'soc': 67.61}, {'period_start': '2024-02-05T12:30:00+00:00', 'soc': 68.5}, {'period_start': '2024-02-05T13:00:00+00:00', 'soc': 68.85}, {'period_start': '2024-02-05T13:30:00+00:00', 'soc': 71.06}, {'period_start': '2024-02-05T14:00:00+00:00', 'soc': 71.34}, {'period_start': '2024-02-05T14:30:00+00:00', 'soc': 70.12}, {'period_start': '2024-02-05T15:00:00+00:00', 'soc': 70.63}, {'period_start': '2024-02-05T15:30:00+00:00', 'soc': 60.39}, {'period_start': '2024-02-05T16:00:00+00:00', 'soc': 48.5}, {'period_start': '2024-02-05T16:30:00+00:00', 'soc': 37.47}, {'period_start': '2024-02-05T17:00:00+00:00', 'soc': 34.28}, {'period_start': '2024-02-05T17:30:00+00:00', 'soc': 29.6}, {'period_start': '2024-02-05T18:00:00+00:00', 'soc': 22.23}, {'period_start': '2024-02-05T18:30:00+00:00', 'soc': 16.98}, {'period_start': '2024-02-05T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'soc': 10.0}], 'forced': [{'period_start': '2024-02-04T15:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T16:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:30:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T01:00:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T01:30:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T02:00:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T02:30:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T03:00:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T03:30:00+00:00', 'forced': 2494}, {'period_start': '2024-02-05T04:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T04:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:30:00+00:00', 'forced': 0}], 'import': [{'period_start': '2024-02-04T15:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T16:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T16:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T17:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T17:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T18:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T18:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T19:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T19:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T20:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T20:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T21:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T21:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T22:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T22:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T23:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T23:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T00:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T00:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T05:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T05:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T06:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T06:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T07:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T07:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T08:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T08:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T09:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T09:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T10:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T10:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T11:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T11:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T12:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T12:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T13:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T13:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T14:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T14:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T15:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T15:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T16:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T16:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T17:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T17:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T18:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T18:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T19:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T19:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T20:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T20:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T21:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T21:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T22:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T22:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T23:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T23:30:00+00:00', 'import': 12.93}], 'export': [{'period_start': '2024-02-04T15:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T16:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T16:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T12:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T12:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T13:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T13:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T14:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T14:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T15:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T15:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'export': 0.0}], 'grid': [{'period_start': '2024-02-04T15:30:00+00:00', 'grid': 140.0}, {'period_start': '2024-02-04T16:00:00+00:00', 'grid': 166.0}, {'period_start': '2024-02-04T16:30:00+00:00', 'grid': 289.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'grid': 1017.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'grid': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'grid': 1128.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'grid': 1512.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'grid': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'grid': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'grid': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'grid': 192.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'grid': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'grid': 412.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'grid': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'grid': 3952.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'grid': 5519.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'grid': 6894.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'grid': 6344.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'grid': 3897.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'grid': 3484.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'grid': 2604.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T12:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T12:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T14:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T14:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T15:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T15:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'grid': 598.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'grid': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'grid': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'grid': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'grid': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'grid': 385.0}], 'consumption': [{'period_start': '2024-02-04T15:30:00+00:00', 'consumption': 137.5}, {'period_start': '2024-02-04T16:00:00+00:00', 'consumption': 220.0}, {'period_start': '2024-02-04T16:30:00+00:00', 'consumption': 293.33}, {'period_start': '2024-02-04T17:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-04T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'consumption': 1127.5}, {'period_start': '2024-02-04T18:30:00+00:00', 'consumption': 1512.5}, {'period_start': '2024-02-04T19:00:00+00:00', 'consumption': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'consumption': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'consumption': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-04T21:00:00+00:00', 'consumption': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-04T22:00:00+00:00', 'consumption': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-04T23:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'consumption': 1457.5}, {'period_start': '2024-02-05T01:00:00+00:00', 'consumption': 3025.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'consumption': 4400.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'consumption': 3850.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'consumption': 1402.5}, {'period_start': '2024-02-05T03:00:00+00:00', 'consumption': 990.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'consumption': 137.5}, {'period_start': '2024-02-05T04:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T06:00:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'consumption': 247.5}, {'period_start': '2024-02-05T07:30:00+00:00', 'consumption': 467.5}, {'period_start': '2024-02-05T08:00:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T09:00:00+00:00', 'consumption': 825.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'consumption': 742.5}, {'period_start': '2024-02-05T10:00:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T10:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'consumption': 275.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T12:00:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T12:30:00+00:00', 'consumption': 632.5}, {'period_start': '2024-02-05T13:00:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-05T13:30:00+00:00', 'consumption': 577.5}, {'period_start': '2024-02-05T14:00:00+00:00', 'consumption': 797.5}, {'period_start': '2024-02-05T14:30:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T15:00:00+00:00', 'consumption': 2227.5}, {'period_start': '2024-02-05T15:30:00+00:00', 'consumption': 2447.5}, {'period_start': '2024-02-05T16:00:00+00:00', 'consumption': 2200.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'consumption': 623.33}, {'period_start': '2024-02-05T17:00:00+00:00', 'consumption': 907.5}, {'period_start': '2024-02-05T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T18:30:00+00:00', 'consumption': 1952.5}, {'period_start': '2024-02-05T19:00:00+00:00', 'consumption': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T21:00:00+00:00', 'consumption': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T22:00:00+00:00', 'consumption': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-05T23:30:00+00:00', 'consumption': 385.0}], 'cost': [{'period_start': '2024-02-04T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:30:00+00:00', 'cumulative_cost': nan}]}}
2024-02-04 15:31:51.338351 WARNING HASS: Code: 400, error: {"message":"Invalid JSON specified."}

Additional context

$ curl -u <<api>> https://api.octopus.energy/v1/products/OUTGOING-LITE-FIX-12M-23-09-12/electricity-tariffs/E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F/standard-unit-rates/ | jq .
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "value_exc_vat": 8,
      "value_inc_vat": 8,
      "valid_from": "2023-09-11T23:00:00Z",
      "valid_to": null,
      "payment_method": null
    }
  ]
}
SzosszeNET commented 9 months ago

Sorry to butt in but my export tarrif has no end date either and not seeing that an an issue

15:40:00 INFO: Checking tariffs: 15:40:00 INFO: ----------------- 15:40:00 INFO: Import: E-1R-AGILE-FLEX-22-11-25-N Start: 2024-01-25 13:00:00+0000 End: 2024-02-04 23:00:00+0000 15:40:00 INFO: Export: E-1R-OUTGOING-FIX-12M-19-05-13-N Start: 2019-05-15 23:00:00+0000 End: N/A 15:40:00 INFO: AGILE tariff detected. Rates will update at 16:00 daily 15:40:00 INFO: - Tariffs OK 15:40:00 INFO:

mergwyn commented 9 months ago

Interesting, querying the API produces:

product=OUTGOING-FIX-12M-19-05-13, tariff=E-1R-OUTGOING-FIX-12M-19-05-13-N
{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "value_exc_vat": 15,
      "value_inc_vat": 15,
      "valid_from": "2022-09-19T23:00:00Z",
      "valid_to": null,
      "payment_method": null
    },
    {
      "value_exc_vat": 7.5,
      "value_inc_vat": 7.5,
      "valid_from": "2022-02-01T00:00:00Z",
      "valid_to": "2022-09-19T23:00:00Z",
      "payment_method": null
    },
    {
      "value_exc_vat": 5.5,
      "value_inc_vat": 5.5,
      "valid_from": "2019-05-15T23:00:00Z",
      "valid_to": "2022-02-01T00:00:00Z",
      "payment_method": null
    }
  ]
}

So your tariff has 3 rates, some with and one without an end date.

SzosszeNET commented 9 months ago

Yes, but two of the tariffs end in the past hence no longer valid and the current one is used without the end date.

What else is in your appdaemon log(s) as like said I'm almost certain due to the fact that my current tariff does not have an end date that it's not your issue.

mergwyn commented 9 months ago

Thanks for your help - here is the full log (without the FutureWarnings:

Collecting numpy==1.25
  Downloading numpy-1.25.0-cp310-cp310-musllinux_1_1_x86_64.whl (17.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.4/17.4 MB 17.1 MB/s eta 0:00:00
Collecting pandas
  Downloading pandas-2.2.0-cp310-cp310-musllinux_1_1_x86_64.whl (13.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 17.2 MB/s eta 0:00:00
Collecting pvpy
  Downloading pvpy-1.4.1a0-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.0/64.0 kB 8.2 MB/s eta 0:00:00
Collecting solis
  Downloading solis-0.1.1-py3-none-any.whl (6.1 kB)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/site-packages (from pandas->-r /conf/requirements.txt (line 2)) (2023.3)
Collecting tzdata>=2022.7
  Downloading tzdata-2023.4-py2.py3-none-any.whl (346 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 346.6/346.6 kB 13.0 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/site-packages (from pandas->-r /conf/requirements.txt (line 2)) (2.8.2)
Collecting scipy
  Downloading scipy-1.12.0-cp310-cp310-musllinux_1_1_x86_64.whl (38.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 MB 12.9 MB/s eta 0:00:00
Collecting asyncclick<9.0.0.0,>=8.1.3.4
  Downloading asyncclick-8.1.7.1-py3-none-any.whl (99 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.2/99.2 kB 17.0 MB/s eta 0:00:00
Collecting click<9.0.0,>=8.1.3
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 18.6 MB/s eta 0:00:00
Collecting zem-pysolarmanv5<3.0.0,>=2.5.0rc2
  Downloading zem_pysolarmanv5-2.5.0rc2-py3-none-any.whl (13 kB)
Collecting anyio
  Downloading anyio-4.2.0-py3-none-any.whl (85 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.5/85.5 kB 11.8 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas->-r /conf/requirements.txt (line 2)) (1.16.0)
Collecting umodbus
  Downloading uModbus-1.0.4-py2.py3-none-any.whl (31 kB)
Collecting typing-extensions>=4.1
  Downloading typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Collecting exceptiongroup>=1.0.2
  Downloading exceptiongroup-1.2.0-py3-none-any.whl (16 kB)
Collecting sniffio>=1.1
  Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.10/site-packages (from anyio->asyncclick<9.0.0.0,>=8.1.3.4->solis->-r /conf/requirements.txt (line 4)) (3.4)
Collecting pyserial~=3.4
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 17.2 MB/s eta 0:00:00
Installing collected packages: pyserial, umodbus, tzdata, typing-extensions, sniffio, numpy, exceptiongroup, click, zem-pysolarmanv5, scipy, pandas, anyio, pvpy, asyncclick, solis
Successfully installed anyio-4.2.0 asyncclick-8.1.7.1 click-8.1.7 exceptiongroup-1.2.0 numpy-1.25.0 pandas-2.2.0 pvpy-1.4.1a0 pyserial-3.5 scipy-1.12.0 sniffio-1.3.0 solis-0.1.1 typing-extensions-4.9.0 tzdata-2023.4 umodbus-1.0.4 zem-pysolarmanv5-2.5.0rc2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
2024-02-04 16:44:55.990502 INFO AppDaemon: AppDaemon Version 4.4.2 starting
2024-02-04 16:44:55.990605 INFO AppDaemon: Python version is 3.10.11
2024-02-04 16:44:55.990692 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2024-02-04 16:44:55.990762 INFO AppDaemon: Added log: AppDaemon
2024-02-04 16:44:55.990834 INFO AppDaemon: Added log: Error
2024-02-04 16:44:55.990894 INFO AppDaemon: Added log: Access
2024-02-04 16:44:55.990956 INFO AppDaemon: Added log: Diag
2024-02-04 16:44:56.008134 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2024-02-04 16:44:56.187154 INFO HASS: HASS Plugin Initializing
2024-02-04 16:44:56.187265 INFO HASS: HASS Plugin initialization complete
2024-02-04 16:44:56.187395 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2024-02-04 16:44:56.190861 INFO MQTT: MQTT Plugin Initializing
2024-02-04 16:44:56.191136 INFO MQTT: Using 'localad/status' as Will Topic
2024-02-04 16:44:56.191204 INFO MQTT: Using 'localad/status' as Birth Topic
2024-02-04 16:44:56.191451 INFO AppDaemon: Initializing HTTP
2024-02-04 16:44:56.191603 INFO AppDaemon: Using 'ws' for event stream
2024-02-04 16:44:56.193405 INFO AppDaemon: Starting API
2024-02-04 16:44:56.194814 INFO AppDaemon: Starting Admin Interface
2024-02-04 16:44:56.194990 INFO AppDaemon: Starting Dashboards
2024-02-04 16:44:56.201359 INFO HASS: Connected to Home Assistant 2024.1.6
2024-02-04 16:44:56.205870 INFO MQTT: Connected to Broker at URL mosquitto:1883
2024-02-04 16:44:56.225740 INFO HASS: Evaluating startup conditions
2024-02-04 16:44:56.235685 INFO AppDaemon: Got initial state from namespace mqtt
2024-02-04 16:44:56.235862 INFO MQTT: MQTT Plugin initialization complete
2024-02-04 16:44:56.236297 INFO HASS: Startup condition met: hass state=RUNNING
2024-02-04 16:44:56.236407 INFO HASS: All startup conditions met
2024-02-04 16:44:56.237566 INFO AppDaemon: App 'pv_opt' added
2024-02-04 16:44:56.238044 INFO AppDaemon: Found 1 active apps
2024-02-04 16:44:56.238188 INFO AppDaemon: Found 0 inactive apps
2024-02-04 16:44:56.238317 INFO AppDaemon: Found 2 global libraries
2024-02-04 16:44:56.238456 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2024-02-04 16:44:56.238862 INFO AppDaemon: Running on port 5050
2024-02-04 16:44:56.252128 INFO AppDaemon: Got initial state from namespace default
2024-02-04 16:44:58.244504 INFO AppDaemon: Scheduler running in realtime
2024-02-04 16:44:58.251326 INFO AppDaemon: Adding /home-assistant/appdaemon/apps to module import path
2024-02-04 16:44:58.252589 INFO AppDaemon: Adding /home-assistant/appdaemon/apps/pv_opt to module import path
2024-02-04 16:44:58.253576 INFO AppDaemon: Adding /home-assistant/appdaemon/apps/pv_opt/config to module import path
2024-02-04 16:44:58.261318 INFO AppDaemon: Loading App Module: /home-assistant/appdaemon/apps/pv_opt/pv_opt.py
2024-02-04 16:44:58.485876 INFO AppDaemon: Loading Global Module: /home-assistant/appdaemon/apps/pv_opt/pvpy.py
2024-02-04 16:44:58.486318 WARNING AppDaemon: No app description found for: /home-assistant/appdaemon/apps/pv_opt/solis.py - ignoring
2024-02-04 16:44:58.486597 WARNING AppDaemon: Unable to find app solis in dependencies for pv_opt
2024-02-04 16:44:58.486730 WARNING AppDaemon: Ignoring app pv_opt
2024-02-04 16:44:58.486985 INFO AppDaemon: Loading app pv_opt using class PVOpt from module pv_opt
2024-02-04 16:44:58.487638 ERROR pv_opt: User defined log pv_opt_log not found
2024-02-04 16:44:58.488170 INFO AppDaemon: Calling initialize() for pv_opt
2024-02-04 16:44:58.534963 INFO pv_opt: 
2024-02-04 16:44:58.535418 INFO pv_opt: ******************* PV Opt v3.6.2 *******************
2024-02-04 16:44:58.535720 INFO pv_opt: 
2024-02-04 16:44:58.535903 ERROR pv_opt: User defined log pv_opt_log not found
2024-02-04 16:44:58.536844 ERROR pv_opt: User defined log pv_opt_log not found
2024-02-04 16:44:58.537728 INFO pv_opt: Local timezone set to GB
2024-02-04 16:44:58.538368 INFO pv_opt: Time Zone Offset: 0.0 minutes
2024-02-04 16:44:58.540885 INFO pv_opt: Inverter type: SOLIS_SOLAX_MODBUS: inverter module: solis.py
2024-02-04 16:44:58.545318 INFO pv_opt: Reading arguments from YAML:
2024-02-04 16:44:58.545719 INFO pv_opt: -----------------------------------
2024-02-04 16:44:58.546071 INFO pv_opt: 
2024-02-04 16:44:58.546422 INFO pv_opt:   Over-write flag is set so YAML will over-write HA
2024-02-04 16:44:58.546791 INFO pv_opt:     redact_personal_data_from_log      = True                                                        True: value in YAML
2024-02-04 16:44:58.547149 INFO pv_opt:     consumption_history_days           = 7                                                              7: value in YAML
2024-02-04 16:44:58.547500 INFO pv_opt:     charger_power_watts                = 5000                                                        5000: value in YAML
2024-02-04 16:44:58.547853 INFO pv_opt:     inverter_power_watts               = 5000                                                        5000: value in YAML
2024-02-04 16:44:58.548235 INFO pv_opt:     octopus_auto                       = True                                                        True: value in YAML
  pd.to_datetime(values[0], errors="ignore", format="%H:%M")
2024-02-04 16:44:58.550824 INFO pv_opt:     octopus_export_tariff_code         = E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F                     E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F: YAML default value. No default defined.
  pd.to_datetime(values[0], errors="ignore", format="%H:%M")
2024-02-04 16:44:58.551962 INFO pv_opt:     octopus_import_tariff_code         = E-1R-GO-18-06-12-F                                        E-1R-GO-18-06-12-F: YAML default value. No default defined.
2024-02-04 16:44:58.553198 INFO pv_opt:     id_daily_solar                     = sensor.solax_power_generation_today                          1.4: value(s) in YAML
2024-02-04 16:44:58.553579 WARNING pv_opt:     alt_tariffs                        = None                                                        None: system default. Null entry found in YAML.
2024-02-04 16:44:58.554040 INFO pv_opt: 
2024-02-04 16:44:58.554396 INFO pv_opt: Checking config:
2024-02-04 16:44:58.554737 INFO pv_opt: -----------------------
2024-02-04 16:44:58.555121 WARNING pv_opt:     forced_charge                      = True                                                        True: system default. Not in YAML.
2024-02-04 16:44:58.555468 WARNING pv_opt:     forced_discharge                   = True                                                        True: system default. Not in YAML.
2024-02-04 16:44:58.555812 WARNING pv_opt:     read_only                          = True                                                        True: system default. Not in YAML.
2024-02-04 16:44:58.556196 WARNING pv_opt:     allow_cyclic                       = False                                                      False: system default. Not in YAML.
2024-02-04 16:44:58.556545 WARNING pv_opt:     optimise_frequency_minutes         = 10                                                            10: system default. Not in YAML.
2024-02-04 16:44:58.556892 WARNING pv_opt:     slot_threshold_p                   = 1.0                                                          1.0: system default. Not in YAML.
2024-02-04 16:44:58.557237 WARNING pv_opt:     day_of_week_weighting              = 0.5                                                          0.5: system default. Not in YAML.
2024-02-04 16:44:58.557580 WARNING pv_opt:     pass_threshold_p                   = 4.0                                                          4.0: system default. Not in YAML.
2024-02-04 16:44:58.557925 WARNING pv_opt:     battery_capacity_wh                = 10000                                                      10000: system default. Not in YAML.
2024-02-04 16:44:58.558265 WARNING pv_opt:     inverter_efficiency_percent        = 97                                                            97: system default. Not in YAML.
2024-02-04 16:44:58.558603 WARNING pv_opt:     charger_efficiency_percent         = 91                                                            91: system default. Not in YAML.
2024-02-04 16:44:58.558945 WARNING pv_opt:     inverter_loss_watts                = 100                                                          100: system default. Not in YAML.
2024-02-04 16:44:58.560150 WARNING pv_opt:     solar_forecast                     = Solcast                                                   Solcast: system default. Not in YAML.
2024-02-04 16:44:58.561232 WARNING pv_opt:     id_solcast_today                   = sensor.solcast_pv_forecast_forecast_today                 2.13165: system default. Not in YAML.
2024-02-04 16:44:58.562202 WARNING pv_opt:     id_solcast_tomorrow                = sensor.solcast_pv_forecast_forecast_tomorrow               3.801: system default. Not in YAML.
2024-02-04 16:44:58.562540 WARNING pv_opt:     consumption_margin                 = 10                                                            10: system default. Not in YAML.
2024-02-04 16:44:58.563167 WARNING pv_opt:     consumption_grouping               = mean                                                        mean: system default. Not in YAML.
2024-02-04 16:44:58.563532 WARNING pv_opt:     forced_power_group_tolerance       = 100                                                          100: system default. Not in YAML.
2024-02-04 16:44:58.564534 WARNING pv_opt:     maximum_dod_percent                = number.solax_battery_minimum_soc                            10.0: system default. Not in YAML.
2024-02-04 16:44:58.565450 WARNING pv_opt:     id_battery_soc                     = sensor.solax_battery_soc                                     9.0: system default. Not in YAML.
2024-02-04 16:44:58.566390 WARNING pv_opt:     id_consumption_today               = sensor.solax_house_load_today                               25.5: system default. Not in YAML.
2024-02-04 16:44:58.567315 WARNING pv_opt:     id_grid_import_today               = sensor.solax_grid_import_today                              20.7: system default. Not in YAML.
2024-02-04 16:44:58.568344 WARNING pv_opt:     id_grid_export_today               = sensor.solax_grid_export_today                               0.0: system default. Not in YAML.
2024-02-04 16:44:58.569277 WARNING pv_opt:     id_battery_charge_power            = sensor.solax_battery_input_energy                            0.0: system default. Not in YAML.
2024-02-04 16:44:58.570201 WARNING pv_opt:     id_inverter_ac_power               = sensor.solax_active_power                                  -90.0: system default. Not in YAML.
2024-02-04 16:44:58.570569 WARNING pv_opt:     supports_hold_soc                  = True                                                        True: system default. Not in YAML.
2024-02-04 16:44:58.570923 WARNING pv_opt:     update_cycle_seconds               = 15                                                            15: system default. Not in YAML.
2024-02-04 16:44:58.571909 WARNING pv_opt:     battery_voltage                    = sensor.solax_battery_voltage                                47.8: system default. Not in YAML.
2024-02-04 16:44:58.572851 WARNING pv_opt:     id_timed_charge_start_hours        = number.solax_timed_charge_start_hours                        0.0: system default. Not in YAML.
2024-02-04 16:44:58.573762 WARNING pv_opt:     id_timed_charge_start_minutes      = number.solax_timed_charge_start_minutes                     30.0: system default. Not in YAML.
2024-02-04 16:44:58.574715 WARNING pv_opt:     id_timed_charge_end_hours          = number.solax_timed_charge_end_hours                          4.0: system default. Not in YAML.
2024-02-04 16:44:58.575615 WARNING pv_opt:     id_timed_charge_end_minutes        = number.solax_timed_charge_end_minutes                       30.0: system default. Not in YAML.
2024-02-04 16:44:58.576539 WARNING pv_opt:     id_timed_charge_current            = number.solax_timed_charge_current                          100.0: system default. Not in YAML.
2024-02-04 16:44:58.577552 WARNING pv_opt:     id_timed_discharge_start_hours     = number.solax_timed_discharge_start_hours                     0.0: system default. Not in YAML.
2024-02-04 16:44:58.578444 WARNING pv_opt:     id_timed_discharge_start_minutes   = number.solax_timed_discharge_start_minutes                   0.0: system default. Not in YAML.
2024-02-04 16:44:58.579322 WARNING pv_opt:     id_timed_discharge_end_hours       = number.solax_timed_discharge_end_hours                       0.0: system default. Not in YAML.
2024-02-04 16:44:58.580361 WARNING pv_opt:     id_timed_discharge_end_minutes     = number.solax_timed_discharge_end_minutes                     0.0: system default. Not in YAML.
2024-02-04 16:44:58.581312 WARNING pv_opt:     id_timed_discharge_current         = number.solax_timed_discharge_current                         0.0: system default. Not in YAML.
2024-02-04 16:44:58.582256 WARNING pv_opt:     id_timed_charge_discharge_button   = button.solax_update_charge_discharge_times                2024-02-04T03:50:10.577104+00:00: system default. Not in YAML.
2024-02-04 16:44:58.583315 WARNING pv_opt:     id_inverter_mode                   = select.solax_energy_storage_control_switch                Selfuse: system default. Not in YAML.
2024-02-04 16:44:58.584272 WARNING pv_opt:     id_backup_mode_soc                 = number.solax_backup_mode_soc                                80.0: system default. Not in YAML.
2024-02-04 16:44:58.584620 INFO pv_opt: 
2024-02-04 16:44:58.584955 INFO pv_opt: >>> {'redact_personal_data_from_log': True, 'consumption_history_days': 7, 'charger_power_watts': 5000, 'inverter_power_watts': 5000, 'octopus_auto': True, 'id_daily_solar': 'sensor.solax_power_generation_today'}
2024-02-04 16:44:58.596989 INFO pv_opt: Syncing config with Home Assistant:
2024-02-04 16:44:58.597349 INFO pv_opt: -----------------------------------
2024-02-04 16:44:58.597684 INFO pv_opt: 
2024-02-04 16:44:58.598012 INFO pv_opt:   Config Item                               HA Entity                                   Current State
2024-02-04 16:44:58.598342 INFO pv_opt:   -----------                               ---------                                   -------------
2024-02-04 16:44:58.598675 INFO pv_opt:   forced_charge                             switch.pvopt_forced_charge                  on
2024-02-04 16:44:58.599666 INFO pv_opt:   forced_discharge                          switch.pvopt_forced_discharge               on
2024-02-04 16:44:58.600522 INFO pv_opt:   read_only                                 switch.pvopt_read_only                      on
2024-02-04 16:44:58.601546 INFO pv_opt:   allow_cyclic                              switch.pvopt_allow_cyclic                   off
2024-02-04 16:44:58.602459 INFO pv_opt:   optimise_frequency_minutes                number.pvopt_optimise_frequency_minutes     10
2024-02-04 16:44:58.603252 INFO pv_opt:   slot_threshold_p                          number.pvopt_slot_threshold_p               1.0
2024-02-04 16:44:58.604074 INFO pv_opt:   day_of_week_weighting                     number.pvopt_day_of_week_weighting          0.5
2024-02-04 16:44:58.604846 INFO pv_opt:   pass_threshold_p                          number.pvopt_pass_threshold_p               4.0
2024-02-04 16:44:58.605612 INFO pv_opt:   battery_capacity_wh                       number.pvopt_battery_capacity_wh            10000
2024-02-04 16:44:58.606376 INFO pv_opt:   inverter_efficiency_percent               number.pvopt_inverter_efficiency_percent    97
2024-02-04 16:44:58.607131 INFO pv_opt:   charger_efficiency_percent                number.pvopt_charger_efficiency_percent     91
2024-02-04 16:44:58.607895 INFO pv_opt:   charger_power_watts                       number.pvopt_charger_power_watts            5000
2024-02-04 16:44:58.608726 INFO pv_opt:   inverter_power_watts                      number.pvopt_inverter_power_watts           5000
2024-02-04 16:44:58.609503 INFO pv_opt:   inverter_loss_watts                       number.pvopt_inverter_loss_watts            100
2024-02-04 16:44:58.610306 INFO pv_opt:   solar_forecast                            select.pvopt_solar_forecast                 Solcast
2024-02-04 16:44:58.611070 INFO pv_opt:   consumption_history_days                  number.pvopt_consumption_history_days       7
2024-02-04 16:44:58.611849 INFO pv_opt:   consumption_margin                        number.pvopt_consumption_margin             10
2024-02-04 16:44:58.612730 INFO pv_opt:   consumption_grouping                      select.pvopt_consumption_grouping           mean
2024-02-04 16:44:58.613676 INFO pv_opt:   forced_power_group_tolerance              number.pvopt_forced_power_group_tolerance   100
2024-02-04 16:44:58.618302 INFO pv_opt: 
2024-02-04 16:44:58.618700 INFO pv_opt: Loading Contract:
2024-02-04 16:44:58.622089 INFO pv_opt: -----------------
2024-02-04 16:44:58.622477 INFO pv_opt: Trying to auto detect Octopus tariffs:
2024-02-04 16:44:58.625437 INFO pv_opt:     Found import entity event.octopus_energy_electricity_22l3527084_1580001758865_current_day_rates
2024-02-04 16:44:58.625819 INFO pv_opt:     Found export entity event.octopus_energy_electricity_22l3527084_1574300421366_export_current_day_rates
2024-02-04 16:44:59.158566 INFO pv_opt: Contract tariffs loaded OK
2024-02-04 16:44:59.160082 INFO pv_opt: Trying to load tariff codes: Import: E-1R-GO-18-06-12-F Export: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F
2024-02-04 16:44:59.659048 INFO pv_opt: Contract tariffs loaded OK from Tariff Codes
2024-02-04 16:44:59.677039 INFO pv_opt:   Import: E-1R-GO-18-06-12-F                       Start: 2023-05-31 23:30:00+0000 End: 2024-02-06 00:30:00+0000 
2024-02-04 16:44:59.678308 INFO pv_opt:   Export: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F    Start: 2023-09-11 23:00:00+0000 End: N/A 
2024-02-04 16:44:59.679243 INFO pv_opt: 
2024-02-04 16:44:59.690866 INFO pv_opt: Previous message repeated 1 times
2024-02-04 16:44:59.691131 INFO pv_opt: Found Octopus Savings Events entity: event.octopus_energy_**********_octoplus_saving_session_events
2024-02-04 16:44:59.693709 INFO pv_opt: 
2024-02-04 16:44:59.694694 INFO pv_opt: No upcoming Octopus Saving Events detected or joined:
2024-02-04 16:44:59.695441 INFO pv_opt: Finished loading contract
  index = pd.date_range(
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:44:59.775074 INFO pv_opt: 
2024-02-04 16:44:59.775444 INFO pv_opt: Running initial Optimisation:
2024-02-04 16:44:59.775939 INFO pv_opt: 
2024-02-04 16:44:59.781360 INFO pv_opt: Previous message repeated 1 times
2024-02-04 16:44:59.781472 INFO pv_opt: Found Octopus Savings Events entity: event.octopus_energy_**********_octoplus_saving_session_events
2024-02-04 16:44:59.782637 INFO pv_opt: 
2024-02-04 16:44:59.783033 INFO pv_opt: No upcoming Octopus Saving Events detected or joined:
2024-02-04 16:44:59.783394 INFO pv_opt: 
2024-02-04 16:44:59.783741 INFO pv_opt: Starting Opimisation with discharge enabled
2024-02-04 16:44:59.784127 INFO pv_opt: -------------------------------------------
2024-02-04 16:44:59.784488 INFO pv_opt: 
2024-02-04 16:44:59.784841 INFO pv_opt: Checking tariffs:
2024-02-04 16:44:59.785187 INFO pv_opt: -----------------
2024-02-04 16:44:59.813869 INFO pv_opt:   Import: E-1R-GO-18-06-12-F                       Start: 2023-05-31 23:30:00+0000 End: 2024-02-06 00:30:00+0000 
2024-02-04 16:44:59.814383 INFO pv_opt:   Export: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F    Start: 2023-09-11 23:00:00+0000 End: N/A 
2024-02-04 16:44:59.814811 INFO pv_opt:   - Tariffs OK
2024-02-04 16:44:59.815208 INFO pv_opt: 
  index=pd.date_range(
2024-02-04 16:44:59.820182 INFO pv_opt: Solcast forecast loaded OK
2024-02-04 16:44:59.820706 INFO pv_opt: Getting expected consumption data
  index = pd.date_range(start, end, inclusive="left", freq="30T")
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  time_value = pd.to_datetime(state, errors="ignore", format="%H:%M")
2024-02-04 16:44:59.868151 INFO pv_opt:   - Estimated consumption from sensor.solax_house_load_today loaded OK 
  self.static = self.static[self.time_now.floor("30T") :].fillna(0)
2024-02-04 16:44:59.881389 INFO pv_opt: Initial SOC: 9.0
2024-02-04 16:44:59.881847 INFO pv_opt: Calculating Base flows
  time_value = pd.to_datetime(state, errors="ignore", format="%H:%M")
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:44:59.915897 INFO pv_opt: Base cost:   0.00p
2024-02-04 16:44:59.916341 INFO pv_opt: 
  time_value = pd.to_datetime(state, errors="ignore", format="%H:%M")
2024-02-04 16:44:59.916959 INFO pv_opt: Optimising for Solcast forecast from 04-Feb 16:30 to 05-Feb 23:30
  time_value = pd.to_datetime(state, errors="ignore", format="%H:%M")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:44:59.951093 INFO pv_opt:   Optimiser prices loaded for period 04/02 16:30 - 05/02 23:30
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:44:59.987826 INFO pv_opt: 
2024-02-04 16:44:59.988305 INFO pv_opt: High Cost Usage Swaps
2024-02-04 16:44:59.988690 INFO pv_opt: ---------------------
2024-02-04 16:44:59.989063 INFO pv_opt: 
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.043331 INFO pv_opt: 05/02 15:30:  1.37 kWh at  15.61p. <==> 05/02 00:30:  5.00p/kWh  6.84p  SOC:  10.0%-> 10.0% New SOC:  10.0%-> 11.6% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.086652 INFO pv_opt: 05/02 15:30:  1.37 kWh at  15.61p. <==> 05/02 00:30:  5.00p/kWh  6.84p  SOC:  10.0%-> 22.4% New SOC:  10.0%-> 13.1% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.129973 INFO pv_opt: 05/02 15:30:  1.37 kWh at  15.61p. <==> 05/02 00:30:  5.00p/kWh  6.84p  SOC:  10.0%-> 34.9% New SOC:  10.0%-> 14.7% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.174960 INFO pv_opt: 05/02 16:00:  1.21 kWh at  13.83p. <==> 05/02 00:30:  5.00p/kWh  6.06p  SOC:  10.0%-> 47.3% New SOC:  10.0%-> 16.0% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.220423 INFO pv_opt: 05/02 18:30:  1.11 kWh at  12.62p. <==> 05/02 00:30:  5.00p/kWh  5.53p  SOC:  10.0%-> 58.4% New SOC:  10.0%-> 17.3% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.267781 INFO pv_opt: 05/02 18:30:  1.11 kWh at  12.62p. <==> 05/02 00:30:  5.00p/kWh  5.53p  SOC:  10.0%-> 68.4% New SOC:  10.0%-> 18.6% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.315272 INFO pv_opt: 05/02 18:30:  1.11 kWh at  12.62p. <==> 05/02 00:30:  5.00p/kWh  5.53p  SOC:  10.0%-> 78.5% New SOC:  10.0%-> 19.8% Net:    0.0
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.363541 INFO pv_opt: 05/02 19:00:  0.90 kWh at  10.31p. <==> 05/02 00:30:  5.00p/kWh  4.52p  SOC:  10.0%-> 88.5% New SOC:  10.0%-> 20.8% Net:    0.0
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.436745 INFO pv_opt: 05/02 19:30:  0.62 kWh at   7.11p. <==> 05/02 00:30:  5.00p/kWh  3.11p  SOC:  10.0%-> 96.7% New SOC:  10.0%-> 21.6% Net:    0.0
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
  (slot.tz_localize(None) + pd.Timedelta("30T"))
2024-02-04 16:45:00.560464 INFO pv_opt: 
2024-02-04 16:45:00.560930 INFO pv_opt: Maximum 1st pass slot delta is 0.0p
2024-02-04 16:45:00.561324 INFO pv_opt: 
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
2024-02-04 16:45:00.574021 INFO pv_opt: Previous message repeated 1 times
2024-02-04 16:45:00.574159 INFO pv_opt: Low Cost Charging
2024-02-04 16:45:00.574535 INFO pv_opt: ------------------
2024-02-04 16:45:00.574909 INFO pv_opt: 
2024-02-04 16:45:00.575289 INFO pv_opt: Max export price when there is no forced charge: nanp/kWh.
2024-02-04 16:45:00.576216 INFO pv_opt: 0 slots have an import price less than the max export price
2024-02-04 16:45:00.576730 INFO pv_opt: 
2024-02-04 16:45:00.577115 INFO pv_opt: Charge net cost delta: -0.0p: < threshold 4.0 => Excluded
2024-02-04 16:45:00.577567 INFO pv_opt: 
2024-02-04 16:45:00.577950 INFO pv_opt: Forced Discharging
2024-02-04 16:45:00.578330 INFO pv_opt: ------------------
2024-02-04 16:45:00.578703 INFO pv_opt: 
2024-02-04 16:45:00.579418 INFO pv_opt: 0 slots have an export price greater than the min import price
2024-02-04 16:45:00.579855 INFO pv_opt: 
2024-02-04 16:45:00.580252 INFO pv_opt: Discharge net cost delta: -0.0p: < threshold (4.0) => Excluded
2024-02-04 16:45:00.580634 INFO pv_opt: Iteration  1: Slots added:   0
2024-02-04 16:45:00.581271 INFO pv_opt: 
2024-02-04 16:45:00.581655 INFO pv_opt: Removing cyclic charge/discharge
  freq = pd.infer_freq(static_flows.index) / pd.Timedelta("60T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.618728 INFO pv_opt:   Net cost revised from 0.0p to 0.0p
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.647150 INFO pv_opt: 
  x["end"] = x.index + pd.Timedelta("30T")
  x["end"] = x.index + pd.Timedelta("30T")
2024-02-04 16:45:00.659293 INFO pv_opt: Checking for Hold SOC slots
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

  self.windows["hold_soc"].loc[
/home-assistant/appdaemon/apps/pv_opt/pv_opt.py:1649: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self.windows["hold_soc"].loc[
2024-02-04 16:45:00.660928 INFO pv_opt: 
2024-02-04 16:45:00.661347 INFO pv_opt: Optimal forced charge/discharge slots:
2024-02-04 16:45:00.662224 INFO pv_opt:    05-Feb 00:30 - 05-Feb 04:00   Power:  2500W  SOC:   10% ->   91%  
2024-02-04 16:45:00.665025 INFO pv_opt: 
2024-02-04 16:45:00.665604 INFO pv_opt: Plan time: 04-Feb 16:30 - 05-Feb 23:30 Initial SOC: 9.0 Base Cost:  0.00 Opt Cost:  0.00
2024-02-04 16:45:00.665965 INFO pv_opt: 
2024-02-04 16:45:00.666352 INFO pv_opt: Optimiser elapsed time 0.9 seconds
2024-02-04 16:45:00.666706 INFO pv_opt: 
2024-02-04 16:45:00.670783 INFO pv_opt: Previous message repeated 1 times
2024-02-04 16:45:00.670913 INFO pv_opt: Output written to sensor.pvopt_optimiser_elapsed
  index = pd.date_range(
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
2024-02-04 16:45:00.725851 INFO pv_opt: Average unit cost today: 0.00p/kWh
2024-02-04 16:45:00.728390 INFO pv_opt: Output written to sensor.pvopt_unit_cost_today
  index = pd.date_range(
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  midnight = pd.Timestamp.now(tz="UTC").normalize() + pd.Timedelta("24H")
  (cost["cost"].loc[: midnight - pd.Timedelta("30T")].sum()) / 100,
2024-02-04 16:45:00.800390 WARNING HASS: Error setting Home Assistant state default.sensor.pvopt_base_cost, {'state': 0.0, 'attributes': {'friendly_name': 'PV Opt Base Cost', 'device_class': 'monetary', 'state_class': 'measurement', 'unit_of_measurement': 'GBP', 'cost_today': 0.0, 'cost_tomorrow': 0.0, 'soc': [{'period_start': '2024-02-04T16:30:00+00:00', 'soc': 9.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'soc': 11.07}, {'period_start': '2024-02-05T11:00:00+00:00', 'soc': 11.98}, {'period_start': '2024-02-05T11:30:00+00:00', 'soc': 13.89}, {'period_start': '2024-02-05T12:00:00+00:00', 'soc': 15.24}, {'period_start': '2024-02-05T12:30:00+00:00', 'soc': 16.12}, {'period_start': '2024-02-05T13:00:00+00:00', 'soc': 16.47}, {'period_start': '2024-02-05T13:30:00+00:00', 'soc': 18.68}, {'period_start': '2024-02-05T14:00:00+00:00', 'soc': 18.97}, {'period_start': '2024-02-05T14:30:00+00:00', 'soc': 17.75}, {'period_start': '2024-02-05T15:00:00+00:00', 'soc': 18.26}, {'period_start': '2024-02-05T15:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'soc': 10.0}], 'forced': [{'period_start': '2024-02-04T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T01:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T01:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T02:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T02:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T03:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T03:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T04:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T04:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:30:00+00:00', 'forced': 0}], 'grid': [{'period_start': '2024-02-04T16:30:00+00:00', 'grid': 436.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'grid': 1017.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'grid': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'grid': 1128.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'grid': 1512.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'grid': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'grid': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'grid': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'grid': 192.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'grid': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'grid': 412.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'grid': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'grid': 1457.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'grid': 3025.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'grid': 4400.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'grid': 3850.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'grid': 1402.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'grid': 990.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'grid': 110.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'grid': 137.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'grid': 440.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'grid': 412.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'grid': 110.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'grid': 110.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'grid': 247.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'grid': 467.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'grid': 1053.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'grid': 872.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'grid': 569.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'grid': 337.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T12:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T12:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T14:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T14:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T15:00:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T15:30:00+00:00', 'grid': 2416.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'grid': 2140.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'grid': 546.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'grid': 907.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'grid': 1430.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'grid': 1018.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'grid': 1952.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'grid': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'grid': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'grid': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'grid': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'grid': 385.0}], 'consumption': [{'period_start': '2024-02-04T16:30:00+00:00', 'consumption': 220.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-04T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'consumption': 1127.5}, {'period_start': '2024-02-04T18:30:00+00:00', 'consumption': 1512.5}, {'period_start': '2024-02-04T19:00:00+00:00', 'consumption': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'consumption': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'consumption': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-04T21:00:00+00:00', 'consumption': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-04T22:00:00+00:00', 'consumption': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-04T23:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'consumption': 1457.5}, {'period_start': '2024-02-05T01:00:00+00:00', 'consumption': 3025.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'consumption': 4400.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'consumption': 3850.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'consumption': 1402.5}, {'period_start': '2024-02-05T03:00:00+00:00', 'consumption': 990.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'consumption': 137.5}, {'period_start': '2024-02-05T04:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T06:00:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'consumption': 247.5}, {'period_start': '2024-02-05T07:30:00+00:00', 'consumption': 467.5}, {'period_start': '2024-02-05T08:00:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T09:00:00+00:00', 'consumption': 825.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'consumption': 742.5}, {'period_start': '2024-02-05T10:00:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T10:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'consumption': 275.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T12:00:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T12:30:00+00:00', 'consumption': 632.5}, {'period_start': '2024-02-05T13:00:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-05T13:30:00+00:00', 'consumption': 577.5}, {'period_start': '2024-02-05T14:00:00+00:00', 'consumption': 797.5}, {'period_start': '2024-02-05T14:30:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T15:00:00+00:00', 'consumption': 2227.5}, {'period_start': '2024-02-05T15:30:00+00:00', 'consumption': 2557.5}, {'period_start': '2024-02-05T16:00:00+00:00', 'consumption': 2200.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'consumption': 550.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'consumption': 907.5}, {'period_start': '2024-02-05T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T18:30:00+00:00', 'consumption': 1952.5}, {'period_start': '2024-02-05T19:00:00+00:00', 'consumption': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T21:00:00+00:00', 'consumption': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T22:00:00+00:00', 'consumption': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-05T23:30:00+00:00', 'consumption': 385.0}], 'cost': [{'period_start': '2024-02-04T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:30:00+00:00', 'cumulative_cost': nan}]}}
2024-02-04 16:45:00.801059 WARNING HASS: Code: 400, error: {"message":"Invalid JSON specified."}
2024-02-04 16:45:00.802500 INFO pv_opt: Output written to sensor.pvopt_base_cost
  index = pd.date_range(
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  df.diff(-1).fillna(0).clip(upper=0).cumsum().resample("30T")
  newindex = pd.date_range(df.index[0], end, freq="30T")
  newindex = pd.date_range(x.index[0], df.index[-1], freq="30T")
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  df.index[-1] + pd.Timedelta("30T"),
  df.index[-1] + pd.Timedelta("24H"),
  extended_index = pd.date_range(
  midnight = pd.Timestamp.now(tz="UTC").normalize() + pd.Timedelta("24H")
  (cost["cost"].loc[: midnight - pd.Timedelta("30T")].sum()) / 100,
2024-02-04 16:45:00.867186 WARNING HASS: Error setting Home Assistant state default.sensor.pvopt_opt_cost, {'state': 0.0, 'attributes': {'friendly_name': 'PV Opt Optimised Cost', 'device_class': 'monetary', 'state_class': 'measurement', 'unit_of_measurement': 'GBP', 'cost_today': 0.0, 'cost_tomorrow': 0.0, 'soc': [{'period_start': '2024-02-04T16:30:00+00:00', 'soc': 9.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'soc': 21.55}, {'period_start': '2024-02-05T01:30:00+00:00', 'soc': 33.1}, {'period_start': '2024-02-05T02:00:00+00:00', 'soc': 44.66}, {'period_start': '2024-02-05T02:30:00+00:00', 'soc': 56.21}, {'period_start': '2024-02-05T03:00:00+00:00', 'soc': 67.76}, {'period_start': '2024-02-05T03:30:00+00:00', 'soc': 79.31}, {'period_start': '2024-02-05T04:00:00+00:00', 'soc': 90.86}, {'period_start': '2024-02-05T04:30:00+00:00', 'soc': 90.16}, {'period_start': '2024-02-05T05:00:00+00:00', 'soc': 87.89}, {'period_start': '2024-02-05T05:30:00+00:00', 'soc': 85.34}, {'period_start': '2024-02-05T06:00:00+00:00', 'soc': 83.21}, {'period_start': '2024-02-05T06:30:00+00:00', 'soc': 82.64}, {'period_start': '2024-02-05T07:00:00+00:00', 'soc': 82.08}, {'period_start': '2024-02-05T07:30:00+00:00', 'soc': 80.8}, {'period_start': '2024-02-05T08:00:00+00:00', 'soc': 78.39}, {'period_start': '2024-02-05T08:30:00+00:00', 'soc': 72.96}, {'period_start': '2024-02-05T09:00:00+00:00', 'soc': 68.47}, {'period_start': '2024-02-05T09:30:00+00:00', 'soc': 65.54}, {'period_start': '2024-02-05T10:00:00+00:00', 'soc': 63.8}, {'period_start': '2024-02-05T10:30:00+00:00', 'soc': 64.87}, {'period_start': '2024-02-05T11:00:00+00:00', 'soc': 65.78}, {'period_start': '2024-02-05T11:30:00+00:00', 'soc': 67.69}, {'period_start': '2024-02-05T12:00:00+00:00', 'soc': 69.04}, {'period_start': '2024-02-05T12:30:00+00:00', 'soc': 69.92}, {'period_start': '2024-02-05T13:00:00+00:00', 'soc': 70.27}, {'period_start': '2024-02-05T13:30:00+00:00', 'soc': 72.48}, {'period_start': '2024-02-05T14:00:00+00:00', 'soc': 72.77}, {'period_start': '2024-02-05T14:30:00+00:00', 'soc': 71.55}, {'period_start': '2024-02-05T15:00:00+00:00', 'soc': 72.06}, {'period_start': '2024-02-05T15:30:00+00:00', 'soc': 61.82}, {'period_start': '2024-02-05T16:00:00+00:00', 'soc': 49.36}, {'period_start': '2024-02-05T16:30:00+00:00', 'soc': 38.33}, {'period_start': '2024-02-05T17:00:00+00:00', 'soc': 35.52}, {'period_start': '2024-02-05T17:30:00+00:00', 'soc': 30.84}, {'period_start': '2024-02-05T18:00:00+00:00', 'soc': 23.47}, {'period_start': '2024-02-05T18:30:00+00:00', 'soc': 18.22}, {'period_start': '2024-02-05T19:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'soc': 10.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'soc': 10.0}], 'forced': [{'period_start': '2024-02-04T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-04T23:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T00:30:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T01:00:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T01:30:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T02:00:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T02:30:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T03:00:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T03:30:00+00:00', 'forced': 2539}, {'period_start': '2024-02-05T04:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T04:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T05:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T06:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T07:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T08:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T09:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T10:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T11:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T12:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T13:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T14:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T15:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T16:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T17:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T18:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T19:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T20:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T21:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T22:30:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:00:00+00:00', 'forced': 0}, {'period_start': '2024-02-05T23:30:00+00:00', 'forced': 0}], 'import': [{'period_start': '2024-02-04T16:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T17:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T17:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T18:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T18:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T19:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T19:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T20:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T20:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T21:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T21:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T22:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T22:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T23:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-04T23:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T00:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T00:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'import': 5.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T05:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T05:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T06:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T06:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T07:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T07:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T08:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T08:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T09:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T09:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T10:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T10:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T11:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T11:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T12:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T12:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T13:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T13:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T14:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T14:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T15:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T15:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T16:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T16:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T17:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T17:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T18:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T18:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T19:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T19:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T20:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T20:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T21:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T21:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T22:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T22:30:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T23:00:00+00:00', 'import': 12.93}, {'period_start': '2024-02-05T23:30:00+00:00', 'import': 12.93}], 'export': [{'period_start': '2024-02-04T16:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T12:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T12:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T13:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T13:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T14:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T14:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T15:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T15:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'export': 0.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'export': 0.0}], 'grid': [{'period_start': '2024-02-04T16:30:00+00:00', 'grid': 436.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'grid': 1017.0}, {'period_start': '2024-02-04T17:30:00+00:00', 'grid': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'grid': 1128.0}, {'period_start': '2024-02-04T18:30:00+00:00', 'grid': 1512.0}, {'period_start': '2024-02-04T19:00:00+00:00', 'grid': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'grid': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'grid': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'grid': 192.0}, {'period_start': '2024-02-04T21:00:00+00:00', 'grid': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'grid': 412.0}, {'period_start': '2024-02-04T22:00:00+00:00', 'grid': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-04T23:30:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'grid': 3996.0}, {'period_start': '2024-02-05T01:00:00+00:00', 'grid': 5564.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'grid': 6939.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'grid': 6389.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'grid': 3941.0}, {'period_start': '2024-02-05T03:00:00+00:00', 'grid': 3529.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'grid': 2649.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T04:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T06:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T07:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T08:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T09:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T10:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T10:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T12:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T12:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:00:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T13:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T14:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T14:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T15:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T15:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T16:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T17:30:00+00:00', 'grid': 0.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'grid': -0.0}, {'period_start': '2024-02-05T18:30:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-05T19:00:00+00:00', 'grid': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'grid': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'grid': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T21:00:00+00:00', 'grid': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'grid': 522.0}, {'period_start': '2024-02-05T22:00:00+00:00', 'grid': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'grid': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'grid': 357.0}, {'period_start': '2024-02-05T23:30:00+00:00', 'grid': 385.0}], 'consumption': [{'period_start': '2024-02-04T16:30:00+00:00', 'consumption': 220.0}, {'period_start': '2024-02-04T17:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-04T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-04T18:00:00+00:00', 'consumption': 1127.5}, {'period_start': '2024-02-04T18:30:00+00:00', 'consumption': 1512.5}, {'period_start': '2024-02-04T19:00:00+00:00', 'consumption': 1155.0}, {'period_start': '2024-02-04T19:30:00+00:00', 'consumption': 1320.0}, {'period_start': '2024-02-04T20:00:00+00:00', 'consumption': 165.0}, {'period_start': '2024-02-04T20:30:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-04T21:00:00+00:00', 'consumption': 660.0}, {'period_start': '2024-02-04T21:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-04T22:00:00+00:00', 'consumption': 715.0}, {'period_start': '2024-02-04T22:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-04T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-04T23:30:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T00:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T00:30:00+00:00', 'consumption': 1457.5}, {'period_start': '2024-02-05T01:00:00+00:00', 'consumption': 3025.0}, {'period_start': '2024-02-05T01:30:00+00:00', 'consumption': 4400.0}, {'period_start': '2024-02-05T02:00:00+00:00', 'consumption': 3850.0}, {'period_start': '2024-02-05T02:30:00+00:00', 'consumption': 1402.5}, {'period_start': '2024-02-05T03:00:00+00:00', 'consumption': 990.0}, {'period_start': '2024-02-05T03:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T04:00:00+00:00', 'consumption': 137.5}, {'period_start': '2024-02-05T04:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T05:00:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T05:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T06:00:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T06:30:00+00:00', 'consumption': 110.0}, {'period_start': '2024-02-05T07:00:00+00:00', 'consumption': 247.5}, {'period_start': '2024-02-05T07:30:00+00:00', 'consumption': 467.5}, {'period_start': '2024-02-05T08:00:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T08:30:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T09:00:00+00:00', 'consumption': 825.0}, {'period_start': '2024-02-05T09:30:00+00:00', 'consumption': 742.5}, {'period_start': '2024-02-05T10:00:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T10:30:00+00:00', 'consumption': 440.0}, {'period_start': '2024-02-05T11:00:00+00:00', 'consumption': 275.0}, {'period_start': '2024-02-05T11:30:00+00:00', 'consumption': 412.5}, {'period_start': '2024-02-05T12:00:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T12:30:00+00:00', 'consumption': 632.5}, {'period_start': '2024-02-05T13:00:00+00:00', 'consumption': 192.5}, {'period_start': '2024-02-05T13:30:00+00:00', 'consumption': 577.5}, {'period_start': '2024-02-05T14:00:00+00:00', 'consumption': 797.5}, {'period_start': '2024-02-05T14:30:00+00:00', 'consumption': 302.5}, {'period_start': '2024-02-05T15:00:00+00:00', 'consumption': 2227.5}, {'period_start': '2024-02-05T15:30:00+00:00', 'consumption': 2557.5}, {'period_start': '2024-02-05T16:00:00+00:00', 'consumption': 2200.0}, {'period_start': '2024-02-05T16:30:00+00:00', 'consumption': 550.0}, {'period_start': '2024-02-05T17:00:00+00:00', 'consumption': 907.5}, {'period_start': '2024-02-05T17:30:00+00:00', 'consumption': 1430.0}, {'period_start': '2024-02-05T18:00:00+00:00', 'consumption': 1017.5}, {'period_start': '2024-02-05T18:30:00+00:00', 'consumption': 1952.5}, {'period_start': '2024-02-05T19:00:00+00:00', 'consumption': 1595.0}, {'period_start': '2024-02-05T19:30:00+00:00', 'consumption': 1100.0}, {'period_start': '2024-02-05T20:00:00+00:00', 'consumption': 385.0}, {'period_start': '2024-02-05T20:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T21:00:00+00:00', 'consumption': 770.0}, {'period_start': '2024-02-05T21:30:00+00:00', 'consumption': 522.5}, {'period_start': '2024-02-05T22:00:00+00:00', 'consumption': 605.0}, {'period_start': '2024-02-05T22:30:00+00:00', 'consumption': 495.0}, {'period_start': '2024-02-05T23:00:00+00:00', 'consumption': 357.5}, {'period_start': '2024-02-05T23:30:00+00:00', 'consumption': 385.0}], 'cost': [{'period_start': '2024-02-04T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-04T23:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T00:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T01:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T02:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T03:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T04:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T05:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T06:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T07:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T08:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T09:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T10:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T11:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T12:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T13:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T14:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T15:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T16:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T17:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T18:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T19:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T20:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T21:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T22:30:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:00:00+00:00', 'cumulative_cost': nan}, {'period_start': '2024-02-05T23:30:00+00:00', 'cumulative_cost': nan}]}}
2024-02-04 16:45:00.868084 WARNING HASS: Code: 400, error: {"message":"Invalid JSON specified."}
2024-02-04 16:45:00.869726 INFO pv_opt: Output written to sensor.pvopt_opt_cost
2024-02-04 16:45:00.872653 INFO pv_opt: Output written to sensor.pvopt_charge_start
2024-02-04 16:45:00.874917 INFO pv_opt: Output written to sensor.pvopt_charge_end
2024-02-04 16:45:00.877569 INFO pv_opt: Output written to sensor.pvopt_charge_current
  loc = pd.Timestamp.now(tz="UTC") + pd.Timedelta(f"{offset}H")
  locs = [loc.floor("30T"), loc.ceil("30T")]
2024-02-04 16:45:00.880875 INFO pv_opt: Output written to sensor.pvopt_soc_h1
2024-02-04 16:45:00.883835 INFO pv_opt: Output written to sensor.pvopt_soc_h4
2024-02-04 16:45:00.887897 INFO pv_opt: Output written to sensor.pvopt_soc_h8
2024-02-04 16:45:00.892167 INFO pv_opt: Output written to sensor.pvopt_soc_h12
2024-02-04 16:45:00.892605 INFO pv_opt: Read only mode enabled. Not querying inverter.
  .ceil(f"{self.get_config('optimise_frequency_minutes')}T")
2024-02-04 16:45:00.896813 INFO pv_opt: Optimiser will run every 10 minutes from 16:50 or on PV_OPT Event
2024-02-04 16:45:00.897390 INFO AppDaemon: App initialization complete
SzosszeNET commented 9 months ago

That looks like it's working to me

"2024-02-04 16:45:00.896813 INFO pv_opt: Optimiser will run every 10 minutes from 16:50 or on PV_OPT Event 2024-02-04 16:45:00.897390 INFO AppDaemon: App initialization complete"

Did you add the dashboard and checked what it does?

SzosszeNET commented 9 months ago

Were the sensors created?

assuming you added the logging filters it's in the main log

20:46:33 INFO AppDaemon: Loading app pv_opt using class PVOpt from module pv_opt 20:46:33 INFO AppDaemon: Calling initialize() for pv_opt 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_optimiser_elapsed created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_unit_cost_today created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_base_cost created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_opt_cost created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_charge_start created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_charge_end created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_charge_current created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_soc_h1 created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_soc_h4 created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_soc_h8 created in namespace: default 20:46:45 INFO AppDaemon: pv_opt: Entity sensor.pvopt_soc_h12 created in namespace: default

mergwyn commented 9 months ago

I'm confused by the logs as well. I don't see any created messaged in the logs, but I do see this:

2024-02-04 16:45:00.670913 INFO pv_opt: Output written to sensor.pvopt_optimiser_elapsed
2024-02-04 16:45:00.728390 INFO pv_opt: Output written to sensor.pvopt_unit_cost_today
2024-02-04 16:45:00.802500 INFO pv_opt: Output written to sensor.pvopt_base_cost
2024-02-04 16:45:00.869726 INFO pv_opt: Output written to sensor.pvopt_opt_cost
2024-02-04 16:45:00.872653 INFO pv_opt: Output written to sensor.pvopt_charge_start
2024-02-04 16:45:00.874917 INFO pv_opt: Output written to sensor.pvopt_charge_end
2024-02-04 16:45:00.877569 INFO pv_opt: Output written to sensor.pvopt_charge_current
2024-02-04 16:45:00.880875 INFO pv_opt: Output written to sensor.pvopt_soc_h1
2024-02-04 16:45:00.883835 INFO pv_opt: Output written to sensor.pvopt_soc_h4
2024-02-04 16:45:00.887897 INFO pv_opt: Output written to sensor.pvopt_soc_h8
2024-02-04 16:45:00.892167 INFO pv_opt: Output written to sensor.pvopt_soc_h12

These are the sensors in HA - pvopt_base_cost and pvopt_cost are missing:

Screenshot 2024-02-04 at 17 19 48

And this is what the dashboard shows:

Screenshot 2024-02-04 at 17 17 51
SzosszeNET commented 9 months ago

"pv_opt: Output written to sensor.pvopt_soc_h12" these entries are from "pv_opt.log" the create messages I shared are from "main.log"

Also might worth looking into error.log there since the HASS entry is warning only

mergwyn commented 9 months ago

Those lines are in main.log after a reboot of HA, but the entities are not created in HA as per the screenshots. error.log is empty.

If I use a different export tariff (eg. E-1R-AGILE-OUTGOING-19-05-13-F) it works - so confusing!

SzosszeNET commented 9 months ago

Well, must be something with the tariff that case.

fboundy commented 9 months ago

That's not a tariff that I've looked at when testing so I'll need to see how Octopus format the output from the API.

fboundy commented 9 months ago

Hi

I've not been able to replicate this simply by switching to this tariff.

The problem is that there are NaN's in the calculated cumulative cost which HA won't accept as an attribute. I've put a fix in 3.7.2 to replace the NaN with 0 but the cumulative shouldn't be zero or NaN so it suggests there's something else going on.

Please can you try 3.7.2 and let me know what you find?

mergwyn commented 8 months ago

Thanks for this =- the fix helped in so much that pv_opt no longer throws an error and the charge plan is produced. However, the costs are not passed through and do not appear in the cost summary. For example: tariff = E-1R-AGILE-OUTGOING-19-05-13-F

Screenshot 2024-02-09 at 10 43 18

tariff = E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F

Screenshot 2024-02-09 at 10 44 13

Let me know if you want any logs.

fboundy commented 8 months ago

That’s what I expected. Odd that it works fine on my system.

Can you provide a copy of a section of pv_opt.log? I may have to add some more detailed looking just for this tariff to get to the bottom of what’s going on. On 9 Feb 2024 at 12:26 +0000, mergwyn @.***>, wrote:

Thanks for this =- the fix helped in so much that pv_opt no longer throws an error and the charge plan is produced. However, the costs are not passed through and do not appear in the cost summary. For example: tariff = E-1R-AGILE-OUTGOING-19-05-13-F Screenshot.2024-02-09.at.10.43.18.png (view on web) tariff = E-1R-OUTGOING-LITE-FIX-12M-23-09-12-F Screenshot.2024-02-09.at.10.44.13.png (view on web) Let me know if you want any logs. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mergwyn commented 8 months ago

Thanks - I have a workaround for now manually selecting a different outgoing tariff and not using discharge optimisation, so not an urgent fix for me.

fboundy commented 8 months ago

This was because there was only 1 entry for this in the OE API JSON response. Should be fixed in 3.7.4

fboundy commented 8 months ago

Closing this as I believe it to be fixed. Please re-open if needed