Help with Automation Actionable Actions

Hi,

I am facing some issues with an actionable notification in an automation. Basically I’m trying to get a notification that informs when the dryer/washing machine finishes, allowing me to mark that I took the clothes or either to remind again in 15 minutes.

However, with the code below, rif I choose the “Remind Later” option, the helper input that I have goes off and I do not get a notification again.

Can someone help to figure this one out?

alias: "[NOTIFY] Dryer Machine Finished"
description: ""
trigger:
  - entity_id: input_select.dryer_machine_status
    from: Running
    platform: state
    to: Finished
condition: []
action:
  - repeat:
      while:
        - condition: state
          entity_id: input_boolean.dryer_machine_full
          state: "on"
      sequence:
        - service: notify.ha_adm_notification
          data:
            data:
              actions:
                - action: EMPTY
                  title: Clothes Taken
                - action: LATER
                  title: Remind Later
            title: Dryer Machine Finished
            message: Your clothes are ready to be folded. Don't forget to grab them
        - wait_for_trigger:
            - platform: event
              event_type: mobile_app_notification_action
              event_data: {}
          timeout:
            hours: 0
            minutes: 0
            seconds: 30
            milliseconds: 0
        - choose:
            - conditions: "{{ wait.trigger.event.data.actionName == EMPTY }}"
              sequence:
                - service: input_boolean.turn_off
                  data: {}
                  target:
                    entity_id: input_boolean.dryer_machine_full
            - conditions: "{{ wait.trigger.event.data.actionName == LATER }}"
              sequence:
                - delay:
                    hours: 0
                    minutes: 0
                    seconds: 30
                    milliseconds: 0
mode: restart

I’ve already tried many ways of doing this, but it ends up always on the same. :expressionless:

Thanks

Well, after going through many attempts and troubleshooting, I was able to make it work.

I will leave it around in case someone finds it useful.

alias: "[NOTIFY] Dryer Machine Finished"
description: ""
trigger:
  - entity_id: input_select.dryer_machine_status
    from: Running
    platform: state
    to: Finished
condition: []
action:
  - variables:
      action_empty: "{{ 'EMPTY_' ~ context.id }}"
      action_later: "{{ 'LATER_' ~ context.id }}"
  - repeat:
      while:
        - condition: state
          entity_id: input_boolean.dryer_machine_full
          state: "on"
      sequence:
        - service: notify.ha_adm_notification
          data:
            data:
              actions:
                - action: "{{ action_empty }}"
                  title: Clothes Taken
                - action: "{{ action_later }}"
                  title: Remind Later
            title: Dryer Machine Finished
            message: Your clothes are ready to be folded. Don't forget to grab them
        - wait_for_trigger:
            - platform: event
              event_type: mobile_app_notification_action
              event_data:
                action: "{{ action_empty }}"
            - platform: event
              event_type: mobile_app_notification_action
              event_data:
                action: "{{ action_later }}"
          timeout:
            hours: 0
            minutes: 15
            seconds: 0
            milliseconds: 0
        - choose:
            - conditions: "{{ wait.trigger.event.data.action == action_empty }}"
              sequence:
                - service: input_boolean.turn_off
                  data: {}
                  target:
                    entity_id: input_boolean.dryer_machine_full
            - conditions: "{{ wait.trigger.event.data.action == action_later }}"
              sequence:
                - delay:
                    hours: 0
                    minutes: 15
                    seconds: 0
                    milliseconds: 0
mode: restart

This keeps reminding until the input-boolean is changed to ‘off’, either via the notification or usingthe NFC tag on the machine, to let HA know that it was emptied.

Cheers

1 Like