BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
535 stars 49 forks source link

Target state sensor with -02:00:00 offset only fired 2 minutes early #829

Closed billmichell closed 1 month ago

billmichell commented 2 months ago

Describe the bug

My “charge the battery for 2 hours before the peak rates” sensor only fired at 15:58:00, only 2 minutes before the peak rate.

I thought I saw there is a BST bug since fixed, but this only caused a 1 hour error.

Left me without enough battery to cover the 3 hour peak period.

Reproduction steps

name: expensive_import_upcoming hours: 3 type: Continuous mpan: 200000XXXXXXX rolling_target: false last_rates: false target_invert_target_rates: true start_time: 23:00 end_time: 23:00 offset: -2:00:00 kind: target_rate account_id: A-XXXXXXXX is_target_export: false rates_incomplete: false target_times:

target_times_last_evaluated: 2024-04-08T18:30:15.466869+00:00 overall_average_cost: 0.31762 overall_min_cost: 0.278145 overall_max_cost: 0.34125 current_duration_in_hours: 0 current_average_cost: null current_min_cost: null current_max_cost: null next_time: null next_duration_in_hours: 0 next_average_cost: null next_min_cost: null next_max_cost: null last_evaluated: 2024-04-08T18:53:15.466489+00:00 device_class: power icon: mdi:camera-timer friendly_name: Expensive import hours coming soon

Expected behaviour

On at 14:00:00, 2 hours prior to peak rate

Tariff Code

E-1R-AGILE-23-12-06-H

Integration Version

10.2.0

Home Assistant Version

core_2024.4.1

Fresh Install?

After upgrading

Home Assistant Logs

Not sure what would be helpful

Confirmation

BottlecapDave commented 2 months ago

Hello, sorry that you're encountered this issue.

The integration should be re-evaluating every minute based on callbacks from HA. If HA fails to update the underlying data or call the entity, then the state won't be evaluated and therefore won't change.

Had you done any restarts around the time it should have gone off? Do you know what the target rates were before, during and after firing?

If you're in debug mode, logs between 14:00 and 16:00 of the offending day might help give a clue.

github-actions[bot] commented 1 month ago

This issue has become stale because it has been open for 30 days with no activity. If you still think it's an issue, please respond soon.

github-actions[bot] commented 1 month ago

This issue has been closed because it has been inactive for 14 days since being marked as stale. This is done to help keep on top of active issues. If you still think it's an issue, please respond to this issue