diff --git a/automations/to-do_chore_notifications/to-do_chore_notifications.yaml b/automations/to-do_chore_notifications/to-do_chore_notifications.yaml index 3f9fbd4..10af0a8 100644 --- a/automations/to-do_chore_notifications/to-do_chore_notifications.yaml +++ b/automations/to-do_chore_notifications/to-do_chore_notifications.yaml @@ -43,15 +43,18 @@ blueprint: description: Select the To-do list you want to create Chore notifications from. selector: entity: - domain: todo + multiple: false + filter: + domain: todo input_notify_devices: name: Mobile App Devices to Notify description: What mobile_app devices do you want to receive the notifications? default: [] selector: device: - integration: mobile_app multiple: true + filter: + - integration: mobile_app section_advanced_notification: name: Advanced Notification Options description: More advanced options that add complexity and flexibility for less typical setups. @@ -118,15 +121,15 @@ variables: list_check_frequency: !input input_list_check_frequency trigger_variables: list_check_frequency: !input input_list_check_frequency -trigger: - - platform: time +triggers: + - trigger: time at: !input input_notification_time id: Notify - - platform: template + - trigger: template id: TimeNotify value_template: "{{ now().minute % list_check_frequency == 0 }}" enabled: !input input_use_todo_time - - platform: event + - trigger: event event_type: mobile_app_notification_action id: Mark event_data: {} @@ -142,7 +145,7 @@ action: entity_id: !input input_todo_list above: 0 sequence: - - service: todo.get_items + - action: todo.get_items metadata: {} data: status: needs_action @@ -209,13 +212,17 @@ action: repeat: for_each: "{{ notify_action_full_names }}" sequence: - - service: "{{ repeat.item }}" + - action: "{{ repeat.item }}" data: title: | {{ 'Chore - ' ~ chore.summary }} message: > {{ chore.description | default('You have a chore to complete!') }} data: + # url for ios, clickAction for Android + # https://companion.home-assistant.io/docs/notifications/notifications-basic/#opening-a-url + url: "{{ 'homeassistant://navigate/todo?entity_id=' ~ selected_todo_list }}" + clickAction: "{{ 'homeassistant://navigate/todo?entity_id=' ~ selected_todo_list }}" actions: - action: "{{ selected_todo_list ~ ' ' ~ chore.uid }}" title: Mark Done! @@ -251,7 +258,7 @@ action: {% else %} {{ trigger.event.data.tag }} {% endif %} - - service: todo.update_item + - action: todo.update_item metadata: {} data: item: "{{ todo_item }}" @@ -262,7 +269,7 @@ action: repeat: for_each: "{{ notify_action_full_names }}" sequence: - - service: "{{ repeat.item }}" + - action: "{{ repeat.item }}" data: message: clear_notification data: