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

MainsFromGrid update frequency

Open filipers opened this issue 1 year ago • 2 comments

Hello there,

First, thank you very much for integration, I'm using it for a long time :)

Upon integrating a new home dashboard, I observed some inconsistencies in the hourly graph during the time I charge my electric vehicle (EV). To clarify, I have an energy tariff set from 02 to 06 AM for cost-effective EV charging (the EV charger ceases operation at 6AM). However, I detected elevated consumption between 06 to 07 AM as per the MainsFromGrid sensor. After probing further, I discovered that this was due to the update frequency of MainsFromGrid (approximately every 15 minutes), which resulted in the display of EV charging consumption even after 6AM.

Here is an example comparing with HOME,1,2,3: image

So, is there any way to increase the update frequency of MainsFromGrid? I tried using Home,1,2,3 but it causes issues with solar input.

Thank you very much!

filipers avatar Feb 21 '24 16:02 filipers

The issue stems from how I'm doing those updates, like you've observed those sensors all update from the API every 15 minutes, but when the 1 minute sensors are active the data from those gets added into the 1D sensors. The Home 1,2,3 has a corresponding 1 minute sensor but MainsFromGrid doesn't.

Emporia have asked us to keep the number of API calls fairly low, so I don't think I can just increase the frequency of those requests. I might be able to do that backwards and request the 1D data once per minute and use that to generate the 1 minute sensors. I'll have to think about the best way to handle it.

magico13 avatar Feb 22 '24 14:02 magico13

Perhaps Emporia should be calculating this on their site. Are they open to adding calculations at all?

richardcalgary avatar Jun 28 '24 13:06 richardcalgary