Trigger Template, How to...?

Hi!

I want to make an automation which triggers with a template, but I don’t know what I’m wrong… I want to do some actions, if timestamp is lower than 1 (which is not). But everytime I run the automation, I will still receive the message…

I have this code till now

alias: test
description: ''
trigger:
  - platform: template
    value_template: '{{ as_timestamp(now())|int < 1 }}'
condition: []
action:
  - service: notify.persistent_notification
    data:
      message: ok
mode: single

What are trying to.achirve with your template. When do you want it to trigger?

I want to trigger when the actual time - the time when a sensor changed it is higher than 3600 seconds and less than 600 seconds.

The sample from my post, it is not real, but if I will do that, I can do the real automation as well

Running the automation from the automation page bypasses the triggers, so you’ll always get the notification unless you add a condition.

Oh, I didn’t know that… But even so, I put the template into the condition… and it is still not working

it may even bypass the conditions, I cant remember. Either way, if you want to actually test the trigger, you need to cause the trigger to happen.

With script is the same?

That question doesn’t really make sense with the current context. Can you elaborate what you mean?

If you run the automation from the automation page, you said that it will bypass… I asked you if I run the script, it will bypass as well the conditions?

Are the conditions in the script? If no, then they’ll be bypassed.

Yea, the UI says “Run Actions”

1 Like

Well that settles it then!

I still dont understand what you want to do

Now I want to know how can I test templates into automation…

How to find out if is working or not… Till now, this is how I tested automations or scripts… But not with templates…

There’s a template.sandbox in the developer tools section.
Open your Home Assistant instance and show your template developer tools.

I know but it is not helping me… I just want to test the automation, without waiting for the real trigger, there is no way?

Set different times?

we wouldn’t be going in circles here if you just actually posted your automation or gave more information than the automation you posted. The automation you posted can easily be tested by checking the template in the template editor that @samnewman86 linked above.

But as you can see, I already did it…If you can help me solve that, I can solve my issue

I still dont know what the actual purpose of the template is. It seems like it could be replaced with state trigger and a for: ?