Tmbao / amberelectric-usages

MIT License
5 stars 1 forks source link

Adjust for time zone? #3

Closed simonpallister closed 4 months ago

simonpallister commented 7 months ago

I assume because I am in NSW which is currently on daylight savings time (so UTC+11), rather than the NEM time at UTC+10. Is there any way to fix to correct for time zone? I assume people in VIC/SA will have the same issue?

Btw, love this add-on

Tmbao commented 7 months ago

Hi Simon, thank you for your feedback. I wasn't sure if it's necessary, I'll try to make the timezone adjustable in my spare time, stay tuned!

Tmbao commented 6 months ago

Hi @simonpallister I just double checked the implementation today, I don't think there's anything that needs to be fixed here. The data was actually recorded in UTC timezone https://github.com/Tmbao/amberelectric-usages/blob/7c44e6ce552a907e6328dbc1d00fba0c9805d941/custom_components/amberelectric_usages/coordinator.py#L109-L111

However, you're probably getting the data stretching to 1AM of the following day like I am, I think it's because Amber reports the data via the NEM standard (which uses GMT+10), and the API uses the same data. So I understand this as the data will be reported at 1AM (the following day) during DST instead of 12AM when not in DST as usual, so you'll see a bit more data during DST