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

When are prices updated when changing the price modifier template? #99

Open woytekbode opened 1 year ago

woytekbode commented 1 year ago

I am trying to tweak the price modifier template but can't figure out when the changes take effect. Any change I make doesn't appear to result in different prices even after I reload/reinstall the integration and after I restart HA. Even with something simple as current_price + 1.0.

Anything I might be missing? Or ideas on how to force an update?

JaccoR commented 1 year ago

Am having the same issue. I have to look into this, did it not update after a while?

woytekbode commented 1 year ago

It did update after a while so I assume it updates with a new hourly price?

evading commented 1 year ago

I think the issue stems from the async_added_to_hass override in EntsoeSensor since that is called when the sensor is reloaded in hass at the end of reconfiguration. I have a commit that just removes that override and it seems to solve this issue.

I'm not sure yet why the EntsoSensorExtraStoredData is needed when all the data is in the coordinator. Couldn't the sensor just get everything from there?

MarcHagen commented 1 year ago

I think the issue stems from the async_added_to_hass override in EntsoeSensor since that is called when the sensor is reloaded in hass at the end of reconfiguration. I have a commit that just removes that override and it seems to solve this issue.

I'm not sure yet why the EntsoSensorExtraStoredData is needed when all the data is in the coordinator. Couldn't the sensor just get everything from there?

This (still) works for me now, Thanks!

scop commented 7 months ago

@evading appears to work for me, too. Maybe file a PR here with that change?