magico13 / ha-emporia-vue

Home Assistant Integration for Emporia Vue Energy Monitor
MIT License
485 stars 66 forks source link

Cannot reconcile any figures between the App and HA #140

Open ellerar opened 2 years ago

ellerar commented 2 years ago

I installed the Empoia_vue earlier this year and got it going with the integration almost immediatly so was very happy with the pretty energy dashboard in HA. I did not look very closely but the current cost of electricity has made me. I cannot reconcile anything in the dashboard to the app. The app seems to be about correct in that it more or less ties in with the meter readings.

I have a single phase supply so only one grid sensor in use and I have added four of the individual circuit sensors. vi The integration created six devices and 18 entities. The devices are

HomeBalance Home123 Home1 Home2 Home3 Home4

And then three entities for each device D,Mon and Min.

I had assumed that I would need to use the 'Min' sensor in the HA energy dashboard but that was not available and the only sensible one offered was Home 1,2,3 1D so I used that, I then added in as individual devices Home 1 1D, Home 2 1D, Home 3 1D and Home 4 1D.

As I say this all worked but I now realise the results are just rubbish! For Example, yesterday shows about three times more in HA than in the App. HA also shows an enormous usage between midnight and 1am, I actually spent last night with a clamp meter to look! (this was before I thought to look here)

So I think I have three issues, firstly, I am getting yesterdays consumption in total shown as an addition at midnight. Somehow I am doubling up everything else and cant see the minute sensor in the energy dashboard. I can see the midnight consumption issue posted here but I could not see a solution.

Sorry to be so stupid but some help would be much appreciated.

Many thanks

Screenshot 2022-08-29 161436

Screenshot 2022-08-29 161824

wildcard5 commented 2 years ago

Hi This is just a shot in the dark but is your timezones set correctly as it may be reading a whole days usage 1 hr into the following day if your using the 1 day sensor.

wildcard5 commented 2 years ago

Hi Again i think you may be missing some devices and intergrations. image and my devices shown below. image I use the mains from grid for my usage ( i know i have batteries and solar but that shouldn't matter)

ellerar commented 2 years ago

Thank you, home assistant is set to London time with daylight saving, emporia vue was set to GMT and I can’t see an option for daylight saving. I have set emporia do EST so at least they are now in sync which will probably sort it. I only have four sensors plugged in so I think that is why the unused ones are not detected, they are not on the emporia app. I will test tonight

magico13 commented 2 years ago

You probably had a spike where the API reported correctly after midnight, then reported the previous day in another update, then reported the correct day again. It's really obnoxious when it happens and I'm thinking of ways to throw out those bad values when the API reports it. But the simplest thing you can do is to swap to the current pre-release version of the integration which handles these bad events better. You'll have one big jump when you first install it but you can fix those bad statistics through Home Assistant.

ellerar commented 2 years ago

I am sorry for the delay in reporting back here, but I wanted to make sure it was reporting correctly so I let it run for a week. The times where a 'red herring', I think they were probably always correct. For me changing from using 'DAY' entity to the 'MON' entity has completely solved the issue. I am not sure why? I also checked to make sure it went over a month correctly AUG -SEP which it did with no problems

Many thanks

lhersman commented 2 years ago

@ellerar Did you change all sensors to MON? Or just the main ones

ellerar commented 2 years ago

I changed them all, I think I could have left the others on DAY but it seemed logical

lhersman commented 2 years ago

@ellerar Even though you were using MON (month) the daily/hourly charts still looked right?

ellerar commented 2 years ago

Yes, having changed to MON everything worked correctly and reconciled with the emporia app within a reasonable margin of error.

magico13 commented 2 years ago

The reason for this is likely because the monthly sensor updates less often and is subject to less noise from the API returning bad data. Because it updates less often the individual hours may not line up as well and the day could be off by a bit. Using the pre-release with the updated sensor class and other fixes will usually give exact parity between the app and Home Assistant, though API noise across an hour transition can cause one to be lower/higher than normal. If you're fine with the slower updates and the hours being a bit off then going with the monthly sensor should work fine.

At least on the pre-release build the monthly sensors update hourly, the daily sensor updates once a minute by integrating the data from the minute sensor and polls the API every 15 minutes.

lhersman commented 2 years ago

Well that seems fine to me, not sure I'd ever want more resolution than hourly anyways unless Im seeing how much a circuit draws when something is running.

spf13 commented 2 years ago

I'm having the same issue. Same time zone for HA & EE, wildly different results between what HA shows and the EE app.

Changing to MON seemed to fix everything.

I'll give the pre-release a try though and see if that improves things.

spf13 commented 2 years ago

I gave the latest pre-release a try and the same behavior persists in that release as well.

magico13 commented 2 years ago

The first time you swap to the pre-release there should be a big usage spike because the way the statistics is calculated is changed. You can fix that with the built-in statistics editor, but after that the numbers should behave better. I'd be curious to see what your main 1,2,3 1D history looks like if it's still not lining up.

spf13 commented 2 years ago

Spoke too soon. Must have some cache somewhere. Now with a fresh boot and cache refresh MON doesn't work (seems to be the actual monthly numbers) and 1D isn't working right either. Same as before, appears to be much higher than it is.

I'll give it a day I guess to see what it looks like tomorrow.

Built in stats editor?

Scope666 commented 2 years ago

I'm on the pre-release build, still using the DAY sensor, it seems pretty close between the app and what shows up in HA. The slight difference is probably from the time of day when I switched to the pre-release build on the 1st of the month:

189198238-9780aca4-64c5-4d51-a12a-be8560b275a1

magico13 commented 2 years ago

2022.4 added a built in statistics editor, see the release notes for it here: https://www.home-assistant.io/blog/2022/04/06/release-20224/#adjusting-long-term-statistics

spf13 commented 2 years ago

Ok. Thanks for all the help and fast responses.

Prior to upgrading to the latest beta I was using MON and it was accurate. Now I've switched to 1D and there were data spikes causing me to think it was inaccurate.

Editing the erroneous data points using the stats editor helped.

My total energy now matches the app

I'm also using it for tracking individual circuits and switched those to 1D. Even after fixing data points there it still is off, close to double what it should be. Oddly enough the actual sensor is exactly matching what the EE app says, but the chart at the bottom of the energy screen is closer to double. Maybe caching is having an impact here.

I'm optimistic that tomorrows chart will work as expected given what I've seen here.

Scope666 commented 2 years ago

@spf13 I've seen similar results with the individual items shown in HA, I still think they have some tweaking to do there. (on the HA side)

spf13 commented 2 years ago

Just following up.

Today things look correct. I concur that it was likely something on the HA side causing the odd behavior I saw post migration to the beta version.

Things seem to be very much aligned now between HA and the EE app (on the beta).

Thanks!!

LukeHersman commented 2 years ago

@spf13 Quick question were you using DAY or MON on the beta for the sensors

spf13 commented 2 years ago

Using DAY on beta.

MON didn't work on the beta (but did on the stable).

Message ID: @.***>