Trying to make an automation for dog feeding und reminding

Hey guys

I hope you can help me out with a small project i´m working on at the moment. Usually my dog gets his food at 7 o’clock pm. Sometimes my wife and me are really busy, so we´re not able to feed him in time. Often it´s not clear who will give the dog food und sometimes it´s not clear if the dog was already fed. My goal is to achieve a method to be reminded, if the dog hasn´t been fed and to visualize this in the dashboard.

As an example:

  1. There is an actionable notification on my wifes and my phone with the question: Has the dog been fed at 7 o´clock? Answers: Yes and No.
  2. Simultaneously my Echo in the living room aks me the same question
  3. The notifications should repeat every 30 minutes as long as the answer was no or there was no responding
  4. If the answer is yes, it should show up in the dashboard → Dog was fed in the evening + a notification on our smartphones + the notification loop should end

Please help me finding a way to accomplish this. I have advanced knowledge of HA as I have been using it for 2 years.

Thank you!

I tried around a bit myself and have now arrived at a solution that almost works. Only the routine termination via mobile device does not seem to work yet. Do you have a tip for me, how this could be solved?

For this to work i had to make 6 automations and 2 scripts:

AUTOMATION: MAIN AUTOMATION (Trigger)

alias: Alexa Actionable Sammy Feeding
description: 'automation.alexa_actionable_sammy_feeding'
trigger:
  - platform: time
    at: '18:05'
condition: []
action:
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    target:
      entity_id: media_player.echo_plus_wohnzimmer
  - service: script.activate_alexa_actionable_notification
    data:
      text: Was Sammy already fed in the evening?
      event_id: actionable_notification_sammy_feeding_evening
      alexa_device: media_player.echo_plus_wohnzimmer
  - delay:
      hours: 0
      minutes: 0
      seconds: 4
      milliseconds: 0
  - service: media_player.volume_set
    data:
      volume_level: 0.3
    target:
      entity_id: media_player.echo_plus_wohnzimmer
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.sammy_fed
  - service: input_select.select_option
    target:
      entity_id:
        - input_select.sammy_evening
    data:
      option: No
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.wife
                state: home
        sequence:
          - service: script.alexa_actionable_mobile_notifiction_sammy_feeding_wife
    default: []
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.me
                state: home
        sequence:
          - service: script.alexa_actionable_mobile_notifiction_sammy_feeding_me
    default: []
mode: single

AUTOMATION: ACTIONABLE NOTIFICATION ECHO RESPONSE NO

alias: Alexa Actionable Sammy Feeding Response No
description: ''
trigger:
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: actionable_notification_sammy_feeding_evening
      event_response_type: ResponseNo
condition: []
action:
  - service: notify.alexa_media_echo_show_wohnzimmer
    data:
      message: >-
        {{ [ "Feed Sammy!", "Sammy is waiting!" ]|random}}
      data:
        type: tts
  - delay:
      hours: 0
      minutes: 30
      seconds: 0
      milliseconds: 0
  - service: automation.trigger
    target:
      entity_id: automation.alexa_actionable_sammy_feeding
mode: single

AUTOMATION: ACTIONABLE NOTIFICATION ECHO RESPONSE NONE

alias: Alexa Actionable Sammy Feeding Response None
description: ''
trigger:
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: actionable_notification_sammy_feeding_evening
      event_response_type: ResponseNone
condition: []
action:
  - service: notify.alexa_media_echo_show_wohnzimmer
    data:
      message: >-
        {{ [ "Did you forget Sammy?", "I will remind you in 30 minutes!" ]|random}}
      data:
        type: tts
  - delay:
      hours: 0
      minutes: 30
      seconds: 0
      milliseconds: 0
  - service: automation.trigger
    target:
      entity_id: automation.alexa_actionable_sammy_feeding
mode: single

AUTOMATION: ACTIONABLE NOTIFICATION ECHO RESPONSE YES

alias: Alexa Actionable Sammy Feeding Response Yes
description: ''
trigger:
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: actionable_notification_sammy_feeding_evening
      event_response_type: ResponseYes
condition: []
action:
  - service: notify.alexa_media_echo_show_wohnzimmer
    data:
      message: >-
        {{ [ "Nice!", "Well done!", "Now Sammy is happy!" ]|random}}
      data:
        type: tts
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.sammy_was_fed
  - service: input_select.select_option
    target:
      entity_id:
        - input_select.sammy_evening
    data:
      option: Yes
  - service: automation.turn_off
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_response_no
  - service: automation.turn_on
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_response_no
  - service: automation.turn_off
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_mobile_listener_no
  - service: automation.turn_on
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_mobile_listener_no
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.wife
                state: home
        sequence:
          - service: notify.mobile_app_wife_pocox3
            data:
              message: Sammy has been fed!
              title: Info
    default: []
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.me
                state: home
        sequence:
          - service: notify.mobile_app_mi_9t_pro
            data:
              message: Sammy has been fed!
              title: Info
    default: []
mode: single

AUTOMATION: ALEXA ACTIONABLE SAMMY FEEDING MOBILE LISTENER NO

alias: Alexa Actionable Sammy Feeding Mobile Listener No
description: ''
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: QUESTION_SAMMYFEDNO
condition: []
action:
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.sammy_was_fed
  - service: input_select.select_option
    target:
      entity_id:
        - input_select.sammy_evening
    data:
      option: No
  - delay:
      hours: 0
      minutes: 30
      seconds: 0
      milliseconds: 0
  - service: automation.trigger
    target:
      entity_id: automation.alexa_actionable_sammy_feeding
mode: single

AUTOMATION: ALEXA ACTIONABLE SAMMY FEEDING MOBILE LISTENER YES

alias: Alexa Actionable Sammy Feeding Mobile Listener Yes
description: ''
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: QUESTION_SAMMYFEDYES
condition: []
action:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.sammy_was_fed
  - service: input_select.select_option
    target:
      entity_id:
        - input_select.sammy_evening
    data:
      option: Yes
  - service: automation.turn_off
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_response_no
  - service: automation.turn_on
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_response_no
  - service: automation.turn_off
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_mobile_listener_no
  - service: automation.turn_on
    target:
      entity_id: automation.alexa_actionable_sammy_feeding_mobile_listener_no
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.me
                state: home
        sequence:
          - service: notify.mobile_app_mi_9t_pro
            data:
              message: Sammy has been fed!
              title: Info
    default: []
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: person.wife
                state: home
        sequence:
          - service: notify.mobile_app_wife_pocox3
            data:
              message: Sammy has been fed!
              title: Info
    default: []
mode: single

SCRIPT: ALEXA ACTIONABLE MOBILE NOTIFICATION SAMMY FEEDING ME

alias: Alexa Actionable Mobile Notifiction Sammy Feeding Me
sequence:
  - data:
      message: Was Sammy already fed in the evening?
      title: 'Attention! '
      data:
        actions:
          - action: QUESTION_SAMMYFEDYES
            title: Yes
          - action: QUESTION_SAMMYFEDNO
            title: No
    service: notify.mobile_app_mi_9t_pro
mode: single

SCRIPT: ALEXA ACTIONABLE MOBILE NOTIFICATION SAMMY FEEDING WIFE

alias: Alexa Actionable Mobile Notifiction Sammy Feeding Wife
sequence:
  - data:
      message: Was Sammy already fed in the evening?
      title: 'Attention! '
      data:
        actions:
          - action: QUESTION_SAMMYFEDYES
            title: Yes
          - action: QUESTION_SAMMYFEDNO
            title: No
    service: notify.mobile_app_wife_pocox3
mode: single

My problem is that the responses on the Alexa Echo (Response YES/NO/NONE) work, but the responses via Mobile Device do not. If I respond “Yes” to the mobile actionable notification, the main automation is still triggered and we constantly receive reminders if we are not at home. By the way: I have changed the feeding time to 6 pm in the meantime. :slight_smile: