Help needed with actionable notifications

Hi Guys,

I am new to HA. Been using it for the last 1.5 months and loving it so far. This forum helped me a lot figuring out things. I have a bunch of automations in place and they are working as expected so far. But I am having trouble with an actionable notification based automation I want to implement.

Basically, I want HA to ask me every Wednesday evening if I have taken out trash. If I click ‘Yes’, nothing happens (may be HA gives me a thank you lol) and if I click ‘No’ - I want it to ask me again 30 mins later. So far, this is what I have:

- id: '1630534885179'
  alias: Garbage actionable reminder
  description: ''
  trigger:
  - platform: time
    at: '19:00:00'
  condition:
  - condition: and
    conditions:
    - condition: time
      weekday:
      - wed
  action:
  - service: notify.mobile_app_bill_s_iphone
    data:
      title: Tomorrow is garbage day!
      message: Have you taken out the trash?
      data:
        image: /local/misc_images/trash_day.jpg
        actions:
        - action: CONFIRM_YES
          title: 'Yes'
        - action: CONFIRM_NO
          title: 'No'
  - wait_for_trigger:
    - platform: event
      event_type: mobile_app_notification_action
      event_data:
        action: CONFIRM_NO
    - platform: event
      event_type: mobile_app_notification_action
      event_data:
        action: CONFIRM_YES
    timeout: 00:01:00
    continue_on_timeout: false
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ wait.trigger.event.data.action == CONFIRM_YES }}'
      sequence:
      - service: notify.mobile_app_bill_s_iphone
        data:
          message: Clicked Yes
    - conditions:
      - condition: template
        value_template: '{{ wait.trigger.event.data.action == CONFIRM_NO }}'
      sequence:
      - service: notify.mobile_app_bill_s_iphone
        data:
          message: Clicked No
    default:
    - service: notify.mobile_app_bill_s_iphone
      data:
        message: Clicked default
  mode: single

Right now I am just trying to send another notification to my phone based on what was clicked. But it is always going to the default.

Any help is greatly appreciated.

Ok found the issue. It was missing ' inside the template. Here’s the working automation if anyone is interested:

- id: '1630534885179'
  alias: Garbage actionable reminder v1
  description: ''
  trigger:
  - platform: time
    at: '19:00:00'
  condition:
  - condition: and
    conditions:
    - condition: time
      weekday:
      - wed
  action:
  - service: notify.mobile_app_bill_s_iphone
    data:
      title: Tomorrow is garbage day!
      message: Have you taken out the trash?
      data:
        image: /local/misc_images/trash_day.jpg
        actions:
        - action: CONFIRM_YES
          title: 'Yes'
        - action: CONFIRM_NO
          title: 'No'
  - wait_for_trigger:
    - platform: event
      event_type: mobile_app_notification_action
      event_data:
        action: CONFIRM_NO
    - platform: event
      event_type: mobile_app_notification_action
      event_data:
        action: CONFIRM_YES
    timeout: 00:01:00
    continue_on_timeout: true
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ wait.trigger.event.data.action == ''CONFIRM_YES'' }}'
      sequence:
      - service: notify.mobile_app_bill_s_iphone
        data:
          message: Thank you. I'll remind tomorrow to bring them in.
    - conditions:
      - condition: template
        value_template: '{{ wait.trigger.event.data.action == ''CONFIRM_NO'' }}'
      sequence:
      - service: notify.mobile_app_bill_s_iphone
        data:
          message: No problem. I'll remind again in 30 mins.
      - delay:
          hours: 0
          minutes: 30
          seconds: 0
          milliseconds: 0
      - service: automation.trigger
        data: {}
        target:
          entity_id: automation.garbage_actionable_reminder_v2
    default:
    - service: notify.mobile_app_bill_s_iphone
      data:
        message: No response received. I'll remind again in 15 minutes.
    - delay:
        hours: 0
        minutes: 15
        seconds: 0
        milliseconds: 0
    - service: automation.trigger
      target:
        entity_id: automation.garbage_actionable_reminder_v2
  mode: single
2 Likes

mind me asking, how is the automatiion_v2 defined ?
Is it defined live during the run of v1 automation ? I can’t seem to undeerstand that, and I need something similar :slight_smile:
and what is inside ?