jpulakka / nordpool_diff

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

Normalize filtered result #15

Closed jpulakka closed 1 year ago

jpulakka commented 1 year ago

Add option to scale/normalize fir filter output by e.g. max-min price (over all available hours?). This way output will be somewhat similar no matter if prices vary between 0..3 or 0...80 cent/h/kWh. Beware pitfall: if prices vary very little, scaling this way does not make sense. But we want, say, 3...10 cent and 2...100 cent, have roughly similar output, rather than 10x difference. How to solve well? Maybe scale only by max instead of max-min? It's difficult to articulate in precise terms what exactly is wanted, still it's intuitively somewhat clear.

Maybe just: normalize by max(prices of next filter_length hours) and that's it.