fsaris / home-assistant-zonneplan-one

Unofficial Zonneplan integration for Home Assistant
https://github.com/fsaris/home-assistant-zonneplan-one
MIT License
105 stars 17 forks source link

Highest_yield_at value should be a date (and read in CET) #3

Closed tvandergeer closed 3 years ago

tvandergeer commented 3 years ago

Currently the highest_yield_at value is presented as a date. In our case:

2021-04-10 22:00:00+00:00

At first I thought that the highest recorded value was at April 10 around 22:00, but actually April 10 was a very bad day (in terms of solar energy production). Turns out that you should read this value as a date. The timestamp is in UTC time and the CET time (with DST) is +2 hours. In this case it would be 2021-04-11 00:00:00. And that is correct. Up until now April 11 2021 was the best day.

image

fsaris commented 3 years ago

Need to give it a look later. As this value is returned directly with this timezone by zonneplan.

fsaris commented 3 years ago

Think I will go for the same approach as HA does for sensor.date https://www.home-assistant.io/integrations/time_date/

Will assume the date we get from the api should be in the Europe/Amsterdam timezone and format the timestamp to a date based on that

tvandergeer commented 3 years ago

Yes, that looks like a good solution! Is this something that each user needs to do manually or is it possible to make this part of the integration?

fsaris commented 3 years ago

Current main should give better dates https://github.com/fsaris/home-assistant-zonneplan-one#installing-mainbeta-version-using-hacs

fsaris commented 3 years ago

ok, https://www.home-assistant.io/integrations/sensor/#device-class timestamp works better :)