Automation Help please: Trigger when multiple sensors are below a thershold FOR 10mins

Hi!

I can’t see how to do this in a simply way: I have an automation to close the awnings of my house if my weather station detects rain, wind or wind gusts over a certain threshold. Also I have an automation to restore the position of the awnings if the bad weather conditions expired, to do so I have this automation:

alias: Toldos - Restaurados por buen tiempo
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.pws_wind_speed
    below: input_number.toldos_viento_minimo
  - platform: numeric_state
    entity_id: sensor.pws_wind_gust
    below: input_number.toldos_viento_minimo
  - platform: numeric_state
    entity_id: sensor.pws_rain_rate
    below: "0.1"
condition:
  - condition: numeric_state
    entity_id: sensor.pws_wind_speed
    below: input_number.toldos_viento_minimo
  - condition: numeric_state
    entity_id: sensor.pws_wind_gust
    below: input_number.toldos_viento_minimo
  - condition: numeric_state
    entity_id: sensor.pws_rain_rate
    below: "0.1"
action:
  - service: input_boolean.turn_off
    entity_id: input_boolean.toldos_mal_tiempo
...

With this automation I can detect when all the tree sensors are below a threshold but I would like to add the “for” funcionality. I mean, that the actions perform only if all the three sensors are below its thresholds <<<for 10 minutes>>>. However, I can’t find the way to do so: any ideas??

Thanks in advance!

Is this because you don’t want the awnings going up and down all the time? If so, it might help to use threshold helpers for your triggers. These allow you to set hysteresis - a sort of margin for error on either side of the trigger value when nothing happens.

For example, my fridge monitor is set to send an alert when the temperature goes above 5C, but a hysteresis of 1 avoids false alarms when the temperature is hovering around that figure.

Hi @Stiltjack!

I have already two max and min input_numbers that make the thresholds, one for close the awnings and another to open them. I would like to add the “for”, basically for the wind gusts that are very variable.

I think that if I combine the threshold sensors (true/false as they are binary sensors) and group them into a single sensor I could make an automation with this sensor that triggers with the for!

I’ll keep you updated! Thanks for the hint!

Ok, it’s done! It has a BUT: with the input_numbers as thresholds I can edit the values in a card in lovelace (I show the current wind and the min and max input_numbers and I can edit easily the values). Now with the threshold helpers I can’t use a input_number to set the threshold so I can’t edit it in a card in lovelace.

The only way I see to edit the threshold is creating it in the comfiguration.yaml file. I can’t find the way to do it if you create the threshold via the UI

Problem solved!