Programmed trigger

And

https://jinja.palletsprojects.com/en/3.0.x/

Oops. Sorry. Fixed:

template:
  - binary_sensor:
      - name: "Stop Pump Trigger:
        state: "{{ (utcnow().strftime('%s') | float(0) > states('input_datetime.trigger_one_har_later') | float(0) ) }}"

No. The trigger will only occur when the template changes from false to true.

Can we use this forum entry for another automation question?

One night the gen started because the batteries where down because a pump was running that should not. Therefore i programmed a simple automation the sends out a warning message when the load supersedes a certain amount during a certain time.

alias: HA011 - High power usage warning
description: Send telegram message if power usage above nn watts for more than nn hh:mm. Helpers used for threshold and timer
trigger:
  - platform: numeric_state
    entity_id: sensor.load_watts
    for: input_timer.high_power_timer
    above: input_number.high_power_threshold
condition: []
action:
  - service: telegram_bot.send_message
    data:
      message: >-
        HA011 - Warning: High power usage! Load:
        {{states("sensor.load_watts")}}W
mode: single


I found in the logs a error entry saying that the format is not correct.

I use an entity card to manipulate the two helpers.

I cannot see anything wrong here…

If you want to use an entity in for: it has to be a template. See the last example here: https://www.home-assistant.io/docs/automation/trigger/#numeric-state-trigger

trigger:
  - platform: numeric_state
    entity_id: sensor.load_watts
    for:  "{{ states('input_timer.high_power_timer') }}"
    above: input_number.high_power_threshold

Except this will not work either. Look at the state of your timer. It is idle instead of being in the required format hh:mm:ss

You could use an input_number instead of a timer. Then do this:

trigger:
  - platform: numeric_state
    entity_id: sensor.load_watts
    for:  
      minutes: "{{ states('input_number.high_power_minutes') }}"
    above: input_number.high_power_threshold
1 Like

I changed to input_number.minutes, because on the card i use to set the values “time” helper is shown as “idle”. But numbers are shown.

That helped, thank you.