ha-emporia-vue icon indicating copy to clipboard operation
ha-emporia-vue copied to clipboard

1D sensor reset at 01:00, not at midnight

Open DarkStar1973 opened this issue 1 year ago • 8 comments

Hi and thanks again for this great integration. I notice my 1D sensors reset at 01:00 and not at 00:00. I'm french, with daylight saving time, perhaps that is the problem ?

Logs:

2023-05-05 00:01:34.379 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-1,2,3-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.380 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-1-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.381 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-2-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.381 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-3-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.382 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-4-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.382 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-5-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.383 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-6-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00
2023-05-05 00:01:34.383 WARNING (MainThread) [custom_components.emporia_vue] Midnight happened recently for id 222716-7-1D! Timestamp is 2023-05-05 00:00:34+01:00, midnight is 2023-05-05 00:00:00+01:00, previous reset was 2023-05-04 00:00:00+01:00

image

DarkStar1973 avatar May 05 '23 07:05 DarkStar1973

Hum i think i have found, sorry for the noise ! My HA run into a container and i notice i forget to set the TZ env variable, so the container was 1 hour before my localtime. I set the right TZ and now my container have the good localtime. I will see if the reset is OK this night.

DarkStar1973 avatar May 05 '23 07:05 DarkStar1973

I am having this issue, How do I fix it?

Capture 2PNG

bubbarives avatar May 08 '23 22:05 bubbarives

Same here. Also means my daily totals in Energy Dashboard are off by up to 1kWh per day as it seems to pull the previous day's last hour into the current day.

Screenshot 2023-05-09 at 21 15 30

jonnewman85 avatar May 09 '23 18:05 jonnewman85

Since i fix TZ in my container i also have this issue on all entities:

Sans titre-2

DarkStar1973 avatar May 09 '23 18:05 DarkStar1973

Same here. Also means my daily totals in Energy Dashboard are off by up to 1kWh per day as it seems to pull the previous day's last hour into the current day.

Should note that my time zone in HA is reading as correct form my TZ (EAT or GMT+3) when I use 'date' command in Terminal.

jonnewman85 avatar May 09 '23 18:05 jonnewman85

And reset are still done at 01:00, not 00:00 :(

DarkStar1973 avatar May 09 '23 18:05 DarkStar1973

The reset is at the drop, the spike afterward that happens sometimes is because the Emporia API likes to give bad data for up to an hour or so after midnight. If you see the drop happen at midnight, which is based on the time info of the server running Home Assistant AND the timezone info set in the Emporia app for every individual device, then the reset is working as expected. You should also see a message like the following in your logs, check the timezone info on there to make sure it's all correct: Midnight happened recently for id 130639-1,2,3-1D! Timestamp is 2023-04-26 00:00:01-04:00, midnight is 2023-04-26 00:00:00-04:00, previous reset was 2023-04-25 00:00:00-04:00

If you're seeing the spike after the initial drop, that's a different and unrelated issue. I honestly am not sure which issue is tracking that, I need to do some cleanup because there are a lot of duplicates for both this midnight issue and the spike. The spike will either get fixed when Emporia fixes their API giving bad data, or I am able to code up something to completely ignore the API's data if it "looks bad" while not accidentally ignoring it if you happen to turn on a big appliance. As of right now I usually take the API as the source of truth even though it regularly gives completely bogus responses. There's definitely a fine line between this integration being a basic wrapper for the Emporia API and this integration manipulating the data it receives to give more sensical graphs.

magico13 avatar May 09 '23 19:05 magico13

Since i fix TZ in my container i also have this issue on all entities:

Sans titre-2

I had the same issue. I changed the Vue time zone which fixed it. Vue doesn’t seem to take into consideration winter/summer time. I had Mountain Time selected (UTC-7). I am in that time zone but right now we are in Daylight Time, which is UTC-6. So I selected the ‘wrong’ time zone but with correct UTC offset. This seem to help with this issue.

Bittabola avatar Jun 16 '23 16:06 Bittabola