Get notified when a to-do task is due on Home Assistant
- Install
Local to-do
https://www.home-assistant.io/integrations/local_todo/ - Create an automation
alias: To-do Reminder
description: ""
triggers:
- trigger: time_pattern
minutes: /1
conditions: []
actions:
- action: todo.get_items
metadata: {}
data:
status: needs_action
target:
entity_id: todo.to_do
response_variable: respond
- variables:
due_items: >
{% set items = respond['todo.to_do']['items'] | default([]) %} {% set ns
= namespace(due=[]) %} {% for item in items %}
{% if item.due is defined and item.due is not none and as_datetime(item.due) <= now() %}
{% set ns.due = ns.due + [item] %}
{% endif %}
{% endfor %} {{ ns.due }}
- condition: template
value_template: "{{ due_items | length > 0 }}"
- action: script.tts
metadata: {}
data:
message: |
{{ 'Time to ' + (due_items | map(attribute="summary") | list | join(", ")) }}
- repeat:
sequence:
- action: todo.remove_item
metadata: {}
data:
item: "{{ repeat.item.summary }}"
target:
entity_id: todo.to_do
for_each: "{{ due_items }}"
mode: single
It run every minute, check if a task is due, concatenate the task name, and TTS.