Dynamic Repeat Time for Alert


i’m trying to make get an dynamic alert repeat time based on an input number. The alert is used to remind me to close a window if is open for the repeat time. The time should be dynamic based on the outside temperature. Setting the inputer_number dynamically works fine but i don’t know how to set the repeat time in the alert function to the input_number.

the following does not work

  name: "Schlafzimmer Fenster offen"
  message: "Das Schlafzimmerfenster ist noch offen"
  entity_id: binary_sensor.og_schlafzimmer_schiebetur_verschlussuberwachung
  state: "on"   # Optional, 'on' is the default value
  repeat: input_number.schlafzimmer_fenster_alert
  can_acknowledge: true  # Optional, default is true
  skip_first: true  # Optional, false is the default
    - telegramfah

i get this errot

Invalid config for [alert]: expected float @ data['alert']['schlafzimmer_fenster']['repeat'][0]. Got 'i'. (See /config/configuration.yaml, line 38).

any help is appreciated

Configuration options do not support templates unless they explicitly state they do, like this:

Screenshot 2021-11-06 at 22-49-13 RESTful Sensor

Now look at the alert docs again, repeat: only supports an integer or a list of integers:

Other places you can always use templates are under any of the following in automations or scripts:


For future reference with other templates, if repeat did support a template (it doesn’t so don’t try this), you would have formatted it this way:

repeat: "{{ states('input_number.schlafzimmer_fenster_alert') }}"

More here.

Hi Tom, thanks for the help and explanation. I now understand why the template didn’t work :wink: I think it would be great if repeat would suppor templates. The alert integration is very usefull and dynamic repeat would make it even better!

thanks for the hint - done!