Time_pattern not working with helper

I guess I can’t do that?

platform: time_pattern
minutes: ‘/{{ states(“input_number.licht_timeout”) | int }}’

results in “Invalid Time Pattern Minutes”

Correct you can’t do that. If the documentation does not mention templates then you can’t use them.

You can do this:

trigger:
  - platform: template
    value_template: "{{ now().minute % states('input_number.licht_timeout') | int == 0 }}"

% is the modular arithmetic operator. So if the current minutes divided by your timeout leaves no remainder the trigger will fire. Same as the time pattern trigger you attempted.

Also in future please format your pasted config correctly for the forum. See: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

formatting: will do

But the above results in:

and

“Message malformed: required key not provided @ data[‘trigger’][2][‘platform’]”

something missing?

Look at my post again. I had to do a sneaky edit as your unformatted config had fancy quotes, also I forgot to,change them to single quotes as I am using double quotes outside the template.

still the same (using copy to clipboard):

Sorry I don’t use the UI editor. And I am not sure what you think is wrong now?

here the full picture.

the trigger above uses the fixed value, that’s what I wanted to replace, but error on the top stays.

Just paste these two lines into the Template Trigger you created in visual mode.

I’ve created a new entry, now this:

I can’t see any difference.

Review my post above. Look carefully at the screenshot showing exactly what you need to put into the Template Trigger field of the Automation Editor.

from scratch:

  • add trigger
  • select template
  • switch to yaml
  • paste

get’s me this:

Remove the line “trigger:”

Remove the “-”.

Make it look like Tara’s posted picture.

You’re not following the instructions I have provided you.

You only need this in the Template Trigger field:

platform: template
value_template: "{{ now().minute % states('input_number.licht_timeout') | int == 0 }}"

Every screenshot you have posted shows you are adding this:

trigger:
  - platform: template
    value_template: "{{ now().minute % states('input_number.licht_timeout') | int = 0 }}"

I see, stupid me, but:

Yeah that’s just due to a typo in the original suggestion.

Replace = with == as shown below:

platform: template
value_template: "{{ now().minute % states('input_number.licht_timeout') | int == 0 }}"
1 Like

that was it, awesome.
thanks a lot and sorry for my stupidity

You’re welcome but I suggest you mark tom_l’s post with the Solution tag, instead of mine, because it was the first to correct the original mistake.

sure, although his a still one “=” :slight_smile:

Fixed.