briis / weatherbit

The weatherbit integration adds support for the weatherbit.io web service as a source for meteorological data for your location.
MIT License
33 stars 7 forks source link

Observation time is in UTC #60

Closed lymanepp closed 2 years ago

lymanepp commented 2 years ago

Observation time is in UTC. Normally that would be fine, but Lovelace displays that as an offset from the current local time instead of displaying the actual time.

image

briis commented 2 years ago

I now removed the DEVICE_CLASS TIMESTAMP from the sensor, and converted the time to Local time. Could you download sensor.py from this Github and replace the same file in custom_components/weatherbit and then restart HA, to see if that fixes your issue?

briis commented 2 years ago

And just to make sure you know - This DateTime tells when WEATHERBIT has last updated the data for that location, not the last time this Integration has pulled data from WeatherBit. Som locations only update once a day.

lymanepp commented 2 years ago

Your commit changed the display format, but the time was still off by the UTC offset.

image

I submitted a PR for py-weatherbit to fix the root cause. With that fix, you can probably revert the changes in https://github.com/briis/weatherbit/commit/05903401fb0c6abfd238c98593331c1ab402e24c

briis commented 2 years ago

Released 1.0.8, where this is fixed. Please check and close if you agree.

lymanepp commented 2 years ago

The time is correct now! But I'd still prefer to see the observation time as a timestamp instead of a string (i.e., revert changes in https://github.com/briis/weatherbit/commit/05903401fb0c6abfd238c98593331c1ab402e24c).

briis commented 2 years ago

OK, I will revert it to a Timestamp. Try an download the sensor.py file, and overwrite as before. Then give the final go that this still shows the correct time.

lymanepp commented 2 years ago

Thanks Bjarne! It looks good to me.

image

briis commented 2 years ago

Wonderful. Just keep the file you downloaded and that will then be in the next release.