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 rate sensors ignore day-light saving time #815

Closed andrey-yantsen closed 2 months ago

andrey-yantsen commented 2 months ago

Describe the bug

This Sunday, the UK switched the clocks from UTC(+0:00) to BST(+1:00). Today I noticed that one of my target rate sensors, which is supposed to be triggered between 16:00 and 22:00, was enabled from 21:30 to 23:00.

P.S. I did reboot the HA instance today, just to be sure that everything sees BST.

Reproduction steps

  1. Set the system timezone to Europe/London (British Summer Time specifically)
  2. Ensure the time is correct
  3. Set up a target rate sensor for running between 16:00 and 21:00 — most likely the sensor will be still active between 21:00 and 22:00.
image

Expected behaviour

The target rate sensor uses the local time when checking the minimum/maximum time.

Tariff Code

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

Integration Version

10.1.4

Home Assistant Version

2024.3.3

Fresh Install?

After upgrading

Home Assistant Logs

n/a

Confirmation

seanmaskey commented 2 months ago

Similar here. Agile target rate sensors seemed to come back up at 23:00 last night 1st April- I could see valuess set in attributes- But are all unavailable again since early this morning.

isteel commented 2 months ago

+1 The timings for cheapest periods are an hour out since the shift to BST. This is preventing use of the automation atm.

BottlecapDave commented 2 months ago

Hello and sorry for the late response.

I think I've found the issue, so will get a fix out within the next few days.

BottlecapDave commented 2 months ago

The underlying issue should now be fixed in v10.2.1 which should result in the sensor turning on/off during the requested times.

andrey-yantsen commented 2 months ago

Thank you, @BottlecapDave! It works like a treat!