Skip to content

Instantly share code, notes, and snippets.

@jtaseff
Last active March 4, 2024 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtaseff/40cd47ffbecfa835ebc2b6c29ec25db3 to your computer and use it in GitHub Desktop.
Save jtaseff/40cd47ffbecfa835ebc2b6c29ec25db3 to your computer and use it in GitHub Desktop.
RemindMe engine for Home Assistant - actionable notification handler
alias: RemindMe - Actionable Notification Handler
description: >-
Handles action buttons from RemindMe notifications, marking complete and
snoozing for a time.
trigger:
- platform: event
event_type: mobile_app_notification_action
condition:
- condition: template
value_template: "{{ trigger.event.data.action[:9] == \"Reminder-\" }}"
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.event.data.action == \"Reminder-Complete\" }}"
sequence:
- service: todo.update_item
metadata: {}
data:
status: completed
item: "{{ trigger.event.data.tag }}"
target:
entity_id: todo.remind_me
- conditions:
- condition: template
value_template: "{{ trigger.event.data.action == \"Reminder-Snooze2hr\" }}"
sequence:
- service: todo.update_item
metadata: {}
data:
due_datetime: "{{ now() + timedelta(hours=2) }}"
item: "{{ trigger.event.data.tag }}"
target:
entity_id: todo.remind_me
- conditions:
- condition: template
value_template: "{{ trigger.event.data.action == \"Reminder-Snooze1day\" }}"
sequence:
- service: todo.update_item
metadata: {}
data:
due_datetime: >-
{{ as_datetime(trigger.event.data.origdue) + timedelta(days=1)
}}
item: "{{ trigger.event.data.tag }}"
target:
entity_id: todo.remind_me
enabled: true
- service: notify.reminder_notification_group
metadata: {}
data:
message: clear_notification
data:
tag: "{{ trigger.event.data.tag }}"
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment