TL;DR How to catch subtle falling temperatures that happens over a some hours? Help setting up trend sensor as I can’t really get the hang on it.
Hey, so our landlord is pretty bad when it comes to heating. They use some old hay burner to keep our houses warm but it comes with a catch… it needs to be refilled and so sometimes we are left out with falling temperatures and need to notify them to get heating up. With a newborn this situation is not ideal and therefore we do keep asking for a better solution.
But in the meantime, how can I catch the falling temperature? I’ve tried with the trend sensor and derivative binary sensor but I don’t know how to set it up correctly to catch the subtle but falling temperatures that occur when the heating starts to fail.
Here it how it looked last night (not sure what to do with the spikes, this is an min_max sensor with all my indoor temp sensors.):
As you can see it happens over a long period of time and is falling slowly. And you can also tell when it starts to work again. The outside temperature at the time was between +4C and -1C so it was not that cold outside. A windy or cooler day the fall is more rapid.
Set up your trend sensor. Wait until the temperature starts falling. Then look at the trend sensor attributes in Developer Tools / States or by looking in the more info pop-up when you click on the trend entity in a Lovelace card.
Look at the current gradient attribute. Say it is -63e-6 °C/s (equal to -2.4°C / 10 hours). You need to set min_gradient to slightly less than this for the binary sensor to turn on when the temperature starts falling faster than this rate. Say -65e-6.
Set the sample duration to 3600s (1 hour) to reduce the chance of the small drops in temperature from triggering the sensor.
Set the max_samples to 120. This allows you to collect from a sensor that updates every 30 seconds for 1 hour without losing any samples.
If you measure the temperature directly at the intake pipe, then you should see steeper curves and sooner, which combined with tom_I’s solution should give a earlier alarm.
Say it is -63e-6 °C/s (equal to -2.4°C / 10 hours).
Hmm I don’t follow here sorry. What is -63e?
It seems that the changes are so small that of -0,2/h and that can occur normally ass well so If I just look at a sample duration of an hour would it not trigger the false positives?
Alright. I’ve been using my math far to rarely I see, thanks for the clarification.
In your example with -2,4°C over 10h, would I not be needing to set the sample duration the match 10h as well then? Or is the sample duration just looking if in that hour of samples, if in that rate it will hit -2,4°C over 10h?
EDIT: So in my case, it seems like I have a drop around -1°C in 10h so I could use a min_gradient: -0.000027? You said to set it a little lower, so around -0.00003?