epaulsen / energytariff

HACS Integration for monitoring Norwegian grid tariff level
MIT License
28 stars 1 forks source link

More stable energy estimate #14

Closed sangvikh closed 4 months ago

sangvikh commented 11 months ago

Hi! Great project. Seems to contain most of the sensors I have created for myself. But i noticed your energy estimate graphs were fluctuating a lot.

I made an energy estimate that does not fluctuate wildly, which i use for controlling loads. Works perfectly for controlling electric car charging with a proportional controller.

Template: {{ states("sensor.energy_consumed_current_hour") | float 3700 / (now().minute60 + now().second + 100) }}

https://github.com/sangvikh/homeassistant-templates

Another idea would be to use the nordpool integration as a price source and calculate total cost including all tarriffs. Noticed that Glitre Nett have created an API for getting the tarrifs, which seems to change on a quarterly basis now, maybe that could be used?

https://www.glitrenett.no/kunde/nettleie-og-priser/api-for-nettleiepriser

epaulsen commented 4 months ago

Thanks for your feedback and sorry for the delayed response.

The energy estimate calculation seems fine. However, changing the behavior of something that people use should be done carefully, so I think that I don't want to fix that in this integration.

The recommended approach to use for controlling loads is the Available Power This Hour sensor.

I use this myself.
If the value is negative for more than 1 minute, I decrease the ampere on my EV charger proportionally so that the value of the sensor should become positive. Example: Sensor reports -500 W available power for more than 1 minute, decrease Easee charger amperes by 3 (3*230 = 600)

Oposite: If value is more than 300 W positive for more than 2 minutes and Easee charging not at 32 amps, increase amps by 1. (1 A * 230 V = 230 W power increase)

This works very well in my scenario. However, not all EV vehicles respond well to charger speed being changed a few times during a single hour.

As for calculating total energy prices, that is out of scope for this integration. It also requires an API key and works only for customers in the area where Glitre Nett are the power distributor.