Ich habe einen Blueprint für einen Timer,
der in meinem Fall einen Teichpumpenautomatik steuert. Er wird in diesem fall zur Laufzeitbegrenzung eingesetzt
Automatik start Timer - Timer ist z.b. auf 5 Stunden gesetzt nach Ablauf der zeit wird Teichpumpenautomatik gesperrt und der Timer wird entweder zur eingestelleten Zeit oder Standard (00:01) Tagesreset zurückgesetzt
Es werden passende Helper benötigt
z.B. in meine Fall
input_boolean.teich_timer_start
input_boolean.teich_timer_stop
input_boolean.teich_timer_running
input_boolean.teich_timer_done
dadurch kann man den Blueprint mehrfach verwenden
Dann Zuordnung im Blueprint:
Start Trigger →
input_boolean.teich_timer_start
Stop Trigger →
input_boolean.teich_timer_stop
Running →
input_boolean.teich_timer_running
Done →
input_boolean.teich_timer_done
Dauer →
“05:00:00”
Features
Zeitformat hh:mm:ss
Start (Taster)
Stop (optional)
Restart-safe (mode: restart)
Status running
Ergebnis done
Reset-Zeit frei einstellbar
Fallback → 00:01:00 wenn leer
Multi-Instance safe
Race-Condition geschützt
Trigger Auto-Reset
Stop während Laufzeit möglich
I have a blueprint for a timer,
which, in my case, controls an automatic pond pump. In this instance, it is used to limit the running time
Automatic start timer – the timer is set to 5 hours, for example; once the time has elapsed, the automatic pond pump is disabled and the timer is reset either at the set time or at the standard (00:01) daily reset
Suitable helpers are required
e.g. in my case
input_boolean.teich_timer_start
input_boolean.teich_timer_stop
input_boolean.teich_timer_running
input_boolean.teich_timer_done
This allows the blueprint to be used multiple times
Then mapping in the blueprint:
Start Trigger →
input_boolean.teich_timer_start
Stop Trigger →
input_boolean.teich_timer_stop
Running →
input_boolean.teich_timer_running
Done →
input_boolean.teich_timer_done
Duration →
‘05:00:00’
Features
Time format hh:mm:ss
Start (button)
Stop (optional)
Restart-safe (mode: restart)
Status: running
Result: done
Reset time freely adjustable
Fallback → 00:01:00 if empty
Multi-instance safe
Race condition protected
Trigger auto-reset
Stop possible during runtime
Translated with DeepL.com (free version)
blueprint:
name: V3 Ultimate Timer (Multi-Instance, Reset flexibel)
description: >
Universeller Timer mit Start/Stop, Status, Ergebnis und frei definierbarer Reset-Zeit.
Multi-Instance fähig und robust gegen Race Conditions.
domain: automation
input:
start_trigger:
name: Start Trigger (Taster)
selector:
entity:
domain: input_boolean
stop_trigger:
name: Stop Trigger (optional)
selector:
entity:
domain: input_boolean
duration:
name: Laufzeit (hh:mm:ss)
default: "00:05:00"
selector:
text: {}
target_boolean:
name: Ergebnis (DONE)
selector:
entity:
domain: input_boolean
running_boolean:
name: Status (RUNNING)
selector:
entity:
domain: input_boolean
reset_time:
name: Reset Zeit (hh:mm:ss)
description: Leer lassen für Standard 00:01:00
default: ""
selector:
text: {}
mode: restart
max_exceeded: silent
variables:
reset_time_final: >
{% if (reset_time | string | length) > 0 %}
{{ reset_time }}
{% else %}
00:01:00
{% endif %}
trigger:
- id: start
platform: state
entity_id: !input start_trigger
to: "on"
- id: stop
platform: state
entity_id: !input stop_trigger
to: "on"
- id: reset
platform: template
value_template: >
{{ now().strftime('%H:%M:%S') == reset_time_final }}
condition: []
action:
- choose:
# 🌙 FLEX RESET
- conditions:
- condition: trigger
id: reset
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input target_boolean
- !input running_boolean
# ⏹️ STOP
- conditions:
- condition: trigger
id: stop
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input running_boolean
- !input stop_trigger
# ▶️ START
- conditions:
- condition: trigger
id: start
sequence:
# Start zurücksetzen (Tasterverhalten)
- service: input_boolean.turn_off
target:
entity_id: !input start_trigger
# Status setzen
- service: input_boolean.turn_on
target:
entity_id: !input running_boolean
# Ergebnis zurücksetzen
- service: input_boolean.turn_off
target:
entity_id: !input target_boolean
# Warten oder Stop
- wait_for_trigger:
- platform: state
entity_id: !input stop_trigger
to: "on"
timeout: !input duration
continue_on_timeout: true
- choose:
# ⏹️ STOP erkannt
- conditions:
- condition: state
entity_id: !input stop_trigger
state: "on"
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input running_boolean
- !input stop_trigger
# ⏱️ TIMER FERTIG
- conditions: []
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input target_boolean
- service: input_boolean.turn_off
target:
entity_id: !input running_boolean
# Start sicher zurücksetzen
- service: input_boolean.turn_off
target:
entity_id: !input start_trigger
Code translated for Community
blueprint:
name: Ultimate Timer V3 (Multi-Instance, Flexible Reset)
description: >
Universal and reusable timer blueprint with start/stop control,
running state, completion state, and configurable daily reset time.
Designed for multi-instance usage and robust against race conditions.
domain: automation
input:
start_entity:
name: Start Trigger (Button)
description: Entity used to start the timer (momentary button behavior recommended)
selector:
entity:
domain: input_boolean
stop_entity:
name: Stop Trigger (Optional)
description: Entity used to stop the timer before completion
selector:
entity:
domain: input_boolean
duration:
name: Duration (hh:mm:ss)
description: Timer duration in hh:mm:ss format
default: "00:05:00"
selector:
text: {}
done_entity:
name: Completion State (DONE)
description: Will be turned ON when the timer finishes
selector:
entity:
domain: input_boolean
running_entity:
name: Running State (RUNNING)
description: Indicates if the timer is currently active
selector:
entity:
domain: input_boolean
reset_time:
name: Daily Reset Time (hh:mm:ss)
description: Time when states are reset daily. Leave empty for default (00:01:00)
default: ""
selector:
text: {}
mode: restart
max_exceeded: silent
variables:
reset_time_final: >
{% if (reset_time | string | length) > 0 %}
{{ reset_time }}
{% else %}
00:01:00
{% endif %}
trigger:
- id: start
platform: state
entity_id: !input start_entity
to: "on"
- id: stop
platform: state
entity_id: !input stop_entity
to: "on"
- id: reset
platform: template
value_template: >
{{ now().strftime('%H:%M:%S') == reset_time_final }}
condition: []
action:
- choose:
# 🌙 DAILY RESET
- conditions:
- condition: trigger
id: reset
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input done_entity
- !input running_entity
# ⏹️ STOP HANDLING
- conditions:
- condition: trigger
id: stop
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input running_entity
- !input stop_entity
# ▶️ START HANDLING
- conditions:
- condition: trigger
id: start
sequence:
# Reset start trigger (momentary button behavior)
- service: input_boolean.turn_off
target:
entity_id: !input start_entity
# Set running state
- service: input_boolean.turn_on
target:
entity_id: !input running_entity
# Reset completion state
- service: input_boolean.turn_off
target:
entity_id: !input done_entity
# Wait for stop or timeout
- wait_for_trigger:
- platform: state
entity_id: !input stop_entity
to: "on"
timeout: !input duration
continue_on_timeout: true
- choose:
# ⏹️ STOP detected
- conditions:
- condition: state
entity_id: !input stop_entity
state: "on"
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input running_entity
- !input stop_entity
# ⏱️ TIMER COMPLETED
- conditions: []
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input done_entity
- service: input_boolean.turn_off
target:
entity_id: !input running_entity
# Ensure start trigger is reset
- service: input_boolean.turn_off
target:
entity_id: !input start_entity
