MindFreeze / ha-sankey-chart

A Home Assistant lovelace card to display a sankey chart. For example for power consumption
MIT License
378 stars 20 forks source link

Offset option on entity to adjust for delayed reporting #165

Open kernel610 opened 7 months ago

kernel610 commented 7 months ago

Is your feature request related to a problem? Please describe. I receive my overall electricity consumption through my electricity provider using the Opower integration. This returns back what I assume is an unique dataset for historical usage (opower:coa_elec_XXXXXXXXXX_energy_consumption) and 6 entities for various usage metrics. The "Current bill electric usage" entity returns the kWh usage for the billing period. I can add this to my sankey chart as total consumption and it appears to work correctly by pulling the daily delta values, but the date is a day off due to when the data gets reported back through the integration. I've compared across the historical usage and my bill to confirm that the data I have in my sankey is correct and representative of the previous day. For example, filtering on February 15th will show 46kWh which actually represents the usage from February 14th. I've tried playing around with templates for this entity but can't adjust the historical data since the data is received on a delay.

Describe the solution you'd like It would be great to allow a delay or offset on specific entities to account for delayed reporting. I assume this would be an option within the entity setup since it should only apply to certain entities, most others are real-time reporting.

Describe alternatives you've considered I've looked into what I can do with the entity itself and adjustments by template but the problem is the data is coming in delayed and therefore cannot be adjusted back a day from statistics reporting.

MindFreeze commented 7 months ago

TBH, this doesn't sound easy at all. I'll think about it