Hi all,
I have an automation that right now, works but doesn’t work well because of the trigger points. Simply creating an above or below numeric state trigger, makes it a bit sloppy in terms of start and stop times. The trend sensor has come up.
The automation is for a clothes dryer notification system, that also estimates time to completion. I simply put a temperature probe in the dryer vent and that data is being fed to HA via MQTT.
Here’s how the temperature changes for 2 loads of clothes drying.
The sensor updates every 61 seconds, and the gateway can take upto 16 seconds to send that to my mqtt server. So reporting time is 77 seconds at most.
One thing I’ve been able to calculate is that the temperature increases by at least 2 oC (when starting to dry) within a reporting interval (ie. max 77 seconds), so I would like to use this as my minimum gradient BUT what makes this more complicated is that even when the dryer temperature is plateauing, there is still ups and down temperature.
So, I’m thinking that I have to make some conditions where the information from the binary sensor is accepted for a warming process if the temperature is below 27oC and a second condition, accepted for a cooling process if the temperature is above 40oC.
Creating the conditions is easy, but I wanted to confirm that the below setup for the binary sensor makes sense that for:
temp_falling,
means a temperature drop of at least 2oC over the 320 second duration
temp_rising
is a temperature increase of at least 2oC over 120 seconds.
With the conditions mentioned above, I might be able to exclude the fluctuations of temperature during a drying cycles. OR maybe there is a better way for doing this?
binary_sensor:
- platform: trend
sensors:
temp_falling:
entity_id: sensor.dryer_vent
sample_duration: 320
max_samples: 4
min_gradient: -0.0111
device_class: cold
temp_rising:
entity_id: sensor.dryer_vent
sample_duration: 180
max_samples: 2
min_gradient: 0.0111
device_class: heat