ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
336 stars 48 forks source link

Add a custom time period over which to calculate the temperature derivative. #211

Open Migelo opened 4 months ago

Migelo commented 4 months ago

This PR adds a parameter period_for_derivative_calculation that uses the last 1h (by default) to calculate the derivative value. I developed this for myself as my thermostat is sending readings every 2s which made the default derivative quite meaningless due to noise in the temp measurement. I tried playing around with sampling_period but I did not find it to my satisfaction.

Please have a look and let me know if you think we should add this. I can add a toggle to make this behavior optional, but I will only do that and add the documentation if you think we should go ahead with this.

I've been using this with my water floor heating for the past 2 winters and it worked nicely.