Created
January 28, 2024 02:31
-
-
Save Didgeridrew/e785381356fc09a6d76ca86bd3ee5fa5 to your computer and use it in GitHub Desktop.
HA - When item added to ToDo list, send item in notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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