Skip to content

last_reset occuring at 00:05 #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
silentnyte opened this issue Jan 27, 2025 · 9 comments
Open

last_reset occuring at 00:05 #348

silentnyte opened this issue Jan 27, 2025 · 9 comments

Comments

@silentnyte
Copy link

I read all the other issue posts talking about similar problems. Is there a work around for this, because it makes my energy overview almost unusable.

https://i.imgur.com/VEfAhTP.png

https://i.imgur.com/GntvEvu.png

�[32m2025-01-27 00:05:10.243 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.sub_panel_a_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.243 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.sub_panel_b_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.244 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.inverter_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.244 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.attic_fan_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.245 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.furnace_1_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.245 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.furnace_2_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.245 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.fridge_1_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.246 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.fridge_2_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.246 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.garage_plugs_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.246 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.internet_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.246 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.main_kitchen_lights_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.apt_kitchen_lights_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.apt_deck_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.smoke_detector_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.ev_charger_a_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.ev_charger_b_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.247 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.sub_panel_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
�[32m2025-01-27 00:05:10.248 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.ev_charger_energy_today, last_reset set to 2025-01-27T05:00:00+00:00 (old last_reset 2025-01-26T05:00:00+00:00)�[0m
@magico13
Copy link
Owner

Well you can't turn off the general reset because it's inherent to how the data works in the Emporia API: the daily sensor resets daily. The Energy Dashboard is built to handle this type of reset, the main way I've seen it act up is if the server's time zone is not set to the same time zone as the device in the Emporia app. Based on the logs it looks like you're in Eastern time but either your server is in the wrong time zone or you didn't set the device settings in the Emporia app to be Eastern time. Make them match and it should start behaving properly after a day or two.

@silentnyte
Copy link
Author

Thanks for the quick reply. They are both set to -5 EST. I originally hoped this was because I updated HA and rebooted. But it has continued to be an issue even without a reboot.

@silentnyte
Copy link
Author

Is there anywhere else that I can look to try and track down why I am getting this huge negative value after reset?

@jeffnhelen
Copy link

jeffnhelen commented Feb 5, 2025

Image

I have a similar, but different issue. Mine is resetting, then reverting a couple minutes later and finally correcting 15-20 minutes later. Unfortunately, even after the correction, my tariff sensor maintains the highest value. I'm currently running 2025.1.0b2

@hkeach
Copy link

hkeach commented Feb 15, 2025

I have the same issue and it occurs consistently in the 12:00 or 12:05 AM data point. It's definitely not a time zone issue.

What I see is a data point soon after midnight that reflects the previous day's total usage, not the expected few watts accumulated since the reset. I'm correcting it every day in statistics. I'm considering trying to wrap a template sensor around it and forcing the value to zero at midnight and a couple of periods after.

BTW, the integration is terrific. I'd be looking for an Emporia alternative without it.

@jeffnhelen
Copy link

I have the same issue and it occurs consistently in the 12:00 or 12:05 AM data point. It's definitely not a time zone issue.

What I see is a data point soon after midnight that reflects the previous day's total usage, not the expected few watts accumulated since the reset. I'm correcting it every day in statistics. I'm considering trying to wrap a template sensor around it and forcing the value to zero at midnight and a couple of periods after.

BTW, the integration is terrific. I'd be looking for an Emporia alternative without it.

What I ended up doing was creating an automation to check if the sensor is above a threshold value — something high enough to match what a daily total would be — every few 5 minute increments past midnight. That way if it doesn’t have an issue I’m not just forcing the value to zero every morning. I do a lot overnight EV charging so this could throw that tracking off rather quickly.

@hkeach
Copy link

hkeach commented Feb 16, 2025

I hadn't seen this exact situation before but I think this matches the issue jeffnhelen is reporting.

Image

@hkeach
Copy link

hkeach commented Feb 20, 2025

I've continued to investigate this problem as it is corrupting my energy dashboard every day. I developed a query against the statistics and short_term_statistics tables to be able to look at a longer period than I could see in the statistics editor in HA. These are what I found in the most recent 5 days. BTW, I have Vue's on 3 panels and am seeing the same thing on all 3.

SHORT_TERM_STATISTICS
Image

STATISTICS
Image

As you can see, it is consistently recording the previous day's total in the first bucket of the each new day. I've been trying to develop a filter to correct it but haven't had any luck so far.

Here's my query in case anyone's interested.

--long term statistics
SELECT datetime(st.created_ts, 'unixepoch', 'localtime') created, datetime(st.last_reset_ts, 'unixepoch', 'localtime') last_reset,
datetime(st.start_ts, 'unixepoch', 'localtime') start,
sm.statistic_id, st.state,
st.id, st.metadata_id
FROM statistics st
JOIN statistics_meta sm
ON st.metadata_id
WHERE
sm.statistic_id = 'sensor.garage_energy_today'
AND st.metadata_id = sm.id
AND st.state NOT IN ('unknown', '', 'unavailable')
AND datetime(created_ts, 'unixepoch','localtime') > '2025-02-18 00:00:00'
AND
( datetime(created_ts, 'unixepoch','localtime') like '%00:00:%'
OR datetime(created_ts, 'unixepoch','localtime') like '%01:00%'
OR datetime(created_ts, 'unixepoch','localtime') like '%23:00%')
ORDER BY st.created_ts

@muccitod
Copy link

muccitod commented Feb 27, 2025

Installed the integration a couple of weeks back and found it working great for a few days. Then had the glitch that I believe is being reported in this thread. The daily sensor "resets" on the Emporia side around midnight, then jumps back to the value from the prior day, then resets again. It's happening intermittently; I can't find the pattern. First time it occurred, it happened to be the day of the month I had the Vue set to reset my monthly metering, so I thought there might have been a correlation. But then it happened again about 5 days later, so that was proven false. It seems to affect all sensors, not just the panel mains. And I have Vues on two panels; both are affected at the same time. Definitely on the Emporia side, but I haven't found a way to adjust for it on the Home Assistant side. I'll be following here for updates.

Image

EDIT: It would seem there is an association with using a "helper" as I do - as the daily values are effectively self-correcting from Emporia as they change, while the helper values do not. Unfortunately I need that helper to sum the values of two panels to get a total daily/hourly energy for my home. Has anyone found a reliable way to sum two panel mains in to a single total daily energy value which changes as the value changes through the course of the day?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants