Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Created January 28, 2024 02:31
Show Gist options
  • Select an option

  • Save Didgeridrew/e785381356fc09a6d76ca86bd3ee5fa5 to your computer and use it in GitHub Desktop.

Select an option

Save Didgeridrew/e785381356fc09a6d76ca86bd3ee5fa5 to your computer and use it in GitHub Desktop.
HA - When item added to ToDo list, send item in notification
alias: Notify recently added todo
description: ""
trigger:
- platform: state
entity_id:
- todo.chores
condition:
- condition: template
value_template: "{{ trigger.to_state.state|int > trigger.from_state.state|int }}"
action:
- service: todo.get_items
metadata: {}
target:
entity_id: todo.chores
response_variable: todo_list
- variables:
recent: >
{{ (todo_list['todo.chores']['items'] | map(attribute='summary') |
list)[-1] }}
- service: persistent_notification.create
metadata: {}
data:
message: "{{ recent }}"
title: Recently Added ToDo - Chores
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment