jpulakka / nordpool_diff

Transforms electricity spot price into thermostat control signal. Home Assistant custom component.
MIT License
63 stars 7 forks source link

Somewhat scale-free normalization #20

Closed jpulakka closed 1 year ago

jpulakka commented 1 year ago

Normalization made in https://github.com/jpulakka/nordpool_diff/issues/15 makes the result "totally scale-free", meaning that (when normalize: max_min is used) the output varies similarly no matter if the input varies between 1-2 cnt/kWh or 100-200 cnt/kWh.

This works as planned - making the the output magnitude independent of current overall electricity price (variation). But this also doesn't feel quite right. When prices are very cheap, there's no need to optimize targets as heavily as when the prices are very expensive. Real-world nonlinearities (heat pump efficiency, heat leak) could turn unnecessary variation into an anti-optimization.

Maybe "somewhat scale-free" normalization would be in place. So, the output wouldn't be linearly dependent of input scale, but it would still be somewhat dependent, so that 100-200 cnt/kWh variation would give bigger input than 1-2 cnt/kWh variation, but just not 100x bigger. Something to think about. Logarithmic dependency?

jpulakka commented 1 year ago

"sqrt_max" and "max_min_sqrt_max" are there now and will be included in 0.2.2 release.