jpulakka / nordpool_diff

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

Triangular filter #6

Closed jpulakka closed 2 years ago

jpulakka commented 2 years ago

Currently the filter is "block-shaped", e.g.

[-1, 1]
or
[-1, 0.5, 0.5]

It's good default, very easy to understand ("price for the current hour is subtracted from the average price for the next few hours").

Optionally, a triangular filter might be cool, something like

[-1, 0.67, 0.33]
or
[-1, 0.5, 0.33, 0.17]

Either right triangle (which corresponds to average of _diff_2..._diff_N, doesn't it?), or exponentially decaying, or...

Maybe with this kind of filter we would combine virtues of short and long filters?

(Could also be arbitrary, user-definable?)

jpulakka commented 2 years ago

Done in https://github.com/jpulakka/nordpool_diff/commit/3880ef3c60633044368b2719272e182ae27a47e0