HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
233 stars 35 forks source link

Daylight Savings Time #238

Closed AtomBrake closed 1 year ago

AtomBrake commented 2 years ago

Hi,

I've noticed that all of my data is 1 hour out (energy used between 7pm and 8pm BST is showing up as being used between 8pm and 9pm, and 0 energy used between midnight and 1am) - I suspect this is because HA is recognising daylight savings time, but the smart meters are not?

Thanks

Tom

systeq commented 2 years ago

Yes it is daylight savings time, if you wait a few months the problem will be resolved :)

It's not an issue with the integration, it's the metering system itself. It uses UTC all year round.

ColinRobbins commented 2 years ago

The integration should cope with the UTC/DST conversion. The delay is because the Glow API presents data 30 minutes delayed. They also implement some form of rate limiting, so sometime you only get an update once per hour.

systeq commented 2 years ago

That's not what I see. During winter we see a zero reading at midnight as expected when the days counter resets. During Sumner (daylight saving) we see the counter reset at 1am.

This is consistent every time the clocks change and lasts throughout daylight savings. The readings are always 1 hour out. Again I don't believe this is the integration specifically, I think the system always uses UTC.

ColinRobbins commented 2 years ago

The code makes a UTC/DST calculation glow.py line 139.

it’s working correctly for me… 6DF9F848-6F6F-462D-AD79-347EA2F465AC

HandyHat commented 1 year ago

The library that this integration uses as of v1.0.0 should account for the shift in daylight savings and so this issue should not occur any more. If it persists, please say!