JaccoR / hass-entso-e

Integration for Home Assistant to fetch day ahead energy prices from European countries via ENTSO-e Transparency Platform
159 stars 25 forks source link

have the latest available 48h of data present in the prices attribute #53

Closed sfstar closed 1 year ago

sfstar commented 1 year ago

As mentioned in #41 having the prices attribute not contain a static amount of data makes it more difficult to create automations. This PR requests the last 72hours worth of data and selects the newest values to populate the prices(and tomorrow/today) attributes. Eventually the entity attributes need to be re-examined since (for example) currently there is a lot of duplication in the attributes/across sensors. Perhaps an issue topic needs to be opened with an help wanted requesting what data people would want to have for automating with the entso-e data.

I could imagine for example that an attribute only containing current and future prices could be handy. (This would have a record removed every hour and at 13:00 get 24 records added). So that users are easily able to determine when to place a load based on only future pricing.

JaccoR commented 1 year ago

Good fix, will test this today. Thanks!

Eventually the entity attributes need to be re-examined since (for example) currently there is a lot of duplication in the attributes/across sensors.

You're right. I am currently consulting devs to see what the best option would be. Lets hope devs are going to work on a way to implement future values (see this discussion for more info on this). For now only one entity should contain the attributes. Even then the attributes would hog the DB though.