Skip to content

Instantly share code, notes, and snippets.

@Vincenius
Last active February 25, 2026 13:41
Show Gist options
  • Select an option

  • Save Vincenius/d28ec51e3f1e1a06cad63bf4ccdbb3d9 to your computer and use it in GitHub Desktop.

Select an option

Save Vincenius/d28ec51e3f1e1a06cad63bf4ccdbb3d9 to your computer and use it in GitHub Desktop.
reoccuring tasks home assistant
blueprint:
name: Reoccuring TODOs
description: >
Removes completed tasks and adds optional new tasks.
Runs every X days starting from a chosen start date.
domain: automation
input:
tasklist:
name: Todo List
description: The to-do list entity to manage.
selector:
entity:
filter:
- domain:
- todo
multiple: false
start_date:
name: Start Date
description: Date from which the repetition cycle should begin.
selector:
date:
frequency_days:
name: Frequency (Days)
description: Run every X days (e.g., 1 = daily, 7 = weekly, 14 = biweekly).
default: 7
selector:
number:
min: 1
max: 365
mode: box
unit_of_measurement: days
task_1_name:
name: Task 1 Name (Optional)
selector:
text:
default: ""
task_2_name:
name: Task 2 Name (Optional)
selector:
text:
default: ""
task_3_name:
name: Task 3 Name (Optional)
selector:
text:
default: ""
task_4_name:
name: Task 4 Name (Optional)
selector:
text:
default: ""
task_5_name:
name: Task 5 Name (Optional)
selector:
text:
default: ""
trigger:
- platform: time
at: "01:00:00"
- platform: time
at: "01:05:00"
- platform: event
event_type: manual_trigger
variables:
tasklist: !input tasklist
start_date: !input start_date
frequency_days: !input frequency_days
tasks:
- name: !input task_1_name
- name: !input task_2_name
- name: !input task_3_name
- name: !input task_4_name
- name: !input task_5_name
condition:
- condition: template
value_template: >
{% if trigger.platform == 'event' %}
true
{% else %}
{% set start = strptime(start_date, "%Y-%m-%d") %}
{% set today = now().replace(hour=0, minute=0, second=0, microsecond=0) %}
{% set delta = (today - start).days %}
{{ delta >= 0 and (delta % frequency_days == 0) }}
{% endif %}
action:
# Remove completed items
- service: todo.remove_completed_items
target:
entity_id: "{{ tasklist }}"
# Get existing open tasks
- service: todo.get_items
target:
entity_id: "{{ tasklist }}"
data:
status:
- needs_action
response_variable: todos
- alias: Add new tasks if not already present
repeat:
for_each: "{{ tasks | selectattr('name', '!=', '') | list }}"
sequence:
- variables:
taskname: "{{ repeat.item.name }}"
- condition: template
value_template: >
{{ taskname not in todos[tasklist]['items'] | map(attribute='summary') | list }}
- service: todo.add_item
target:
entity_id: "{{ tasklist }}"
data:
item: "{{ taskname }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment