Blueprint templated time patern trigger based on input

Hi guys,

I’m having some troubles to create a blueprint to send external temperature measurement to my zigbee radiator valves.

Most of the job works except a minor time parameter feature.
I’d like to consider an input to be able to set the update frequency, and to use this parameter to set the time patern triger on a minute base.

I tried the folowing with no parameters, it works :

trigger:

  - platform: time_pattern

    id: temp_update

    minutes: "/5"

Then I tried to expand to this, which doesn’t works :

  input:
    update_frequency:
      name: Update frequency
      description: Update frequency
      default: 5
      selector:
        number:
          min: 5
          max: 30
          unit_of_measurement: min
          mode: slider

variables:
  update_frequency_var: !input update_frequency

trigger:
  - platform: time_pattern
    id: temp_update
    seconds: >-
      {{ '/' + (update_frequency_var | string) }}

I also tried a variety of templates but I had no more success.
Any help would be welecome, I’m still not that comfortable with the jinja things :confused:

Could someone also explain me why we should sometimes use a variable between the input and the automation use?

Thanks! :slight_smile:

Did you found any solution for this problem?

Use a text selector.

input:
  update_frequency:
    name: Update frequency
    description: Update frequency
    default: "/5"
    selector:
      text:

trigger:
  - platform: time_pattern
    id: temp_update
    minutes: !input update_frequency

This is what I’m doing now. It would be great if the user just have to input the value (without the “/”)

As @glamirand already mentioned it doesn’t seems to be possible to achieve this with a template.

It’s not because time_patterns don’t allow templates. Your only option is to use text. The value from the selector needs to match what the field requires, there’s no way around that.

1 Like