jdejaegh / irm-kmi-ha

Home Assistant weather provider using data from Belgian IRM KMI 🇧🇪 🇱🇺 🇳🇱
MIT License
40 stars 0 forks source link

[Question] Timezone in `get_forecasts` #26

Closed khenderick closed 4 months ago

khenderick commented 4 months ago

First of all, thanks for making this available!

Question

When I do call the get_forecasts service on the weather entity provided by this integration, the datetime fields don't include a timezone offset (see screenshot, taken at 20:06+02:00 / 18:06+00:00). I wonder whether I have to interpret the given datetimes as my local timezone (which would be +02:00, so the first forecast entry would be of 20:00+02:00) or as UTC (+00:00, where I still have to convert, so the first entry would be of 20:00+00:00 thus 22:00+02:00).

image

jdejaegh commented 4 months ago

Thanks for the feedback!

The API for the KMI / IRM does not specify any timezone but the forecast mainly makes sense for the related city. You can safely assume that all timestamps without timezone offset are in Brussels time (unless otherwise stated with a timezone offset). The first datetime attribute in your screenshot is equivalent to 2024-05-06T20:00:00+02:00

If you find values that should be in Brussels time but clearly are not, then it's a bug