Enhancement for TREND Binary Sensor

I’ve been using the trend sensor to monitor direction of temperature in the house for a while now.

I’ve observed that when the monitored value does not change for a while, the gradient and therefor the sensor value does not change (i.e. if the temperature has been dropping and trend was “on” for cooling, once the AC turns off - for a while the temperature would stay at it’s current value before raising again at which point the trend would switch to OFF.

I can understand why it’s like that, we wouldn’t want to trend to fluctuate too much if a value remains the same for a short while but I would like for it to be configurable.

Something like another parameter like Consider_after_samples which I can set as 10 for example - after 10 consecutive samples of same value the trend would change to off.

Alternatively / in addition - Consider_after_duration which I can set as 120 for example - after 120 seconds of same value the trend would change to off.