I’d like to use a humidity sensor to detect if someone is showering. I’d like to check if the humidity is increasing fast in the last couple of minutes. Let’s say that if the humidity is increasing 10 percent units in 2 minutes I know someone is showering.
The gradient needs to be greater than 0.16 over the 2 minute duration. You can see the calculated gradient as an attribute in the trend sensor to debug it. If it’s not higher than 0.16, it won’t trigger.
Personally, I ended up making a derivative sensor to track the rate of change and made a simple trigger off that.
I want to use this approach, its a really nice job @petro could you tell me where do you use the start and the constant triggers in your template?
edit: Nvm I saw is for handle the unknown states and the reboots… I think jejeje
also do you mind explain me what this part of the code does?
{%- else %}
{%- set entity_id = 'binary_sensor.master_bathroom_humidity_status' %}
{%- if states(entity_id) in ['on', 'off'] %}
{{ is_state(entity_id, 'on') }}