HA to ask me a question, wait for my reply, and execute

I was wondering if this is possible with tts and a google mini speaker?

Let’s say that it’s 22:30 and the front door is not locked.

Is it possible for ha to ask if it should lock the door and wait for my reply and execute?

“Hello. The front door is not locked, should I lock it?”
[Wait for my reply: yes/no]
Close front door if I say “yes” - don’t do it if I say “no”

Is this possible?
And if so - how to?

/Me

As far as I know interactive dialog is not supported in the built-in assistant yet.

I don’t know if there is a way with Google speakers but there is a custom integration for the Amazon Echo that can do that.

Not yet with Voice assistant, but you could do it with TTS in a notification.

How?
Could you please give me an example on how to do this?

      - service: notify.mobile_app_pixel_8_pro
        data:
          message: TTS
          data:
            tts_text: Garden Gate Alarm. Someone just opened the Garden Gate!
            priority: high
            ttl: 0
            media_stream: alarm_stream

Thats for the TTS.

For the automation - this is one of my triggers:

  - platform: event
    event_type: notification_response_action
    event_data:
      response_action: media_mode_livingroom
    id: media_mode_enable

And for the notification that sends the buttons:

          - service: notify.mobile_app_pixel_6
            data:
              message: >-
                Activate movie mode for "{{ media_title | default(media_app) }}"
                in the Living Room?
              title: Media Mode
              data:
                actions:
                  - action: media_mode_livingroom
                    title: "Yes"
                  - action: noop
                    title: "No"
                tag: media_mode_livingroom
                channel: media_mode
                priority: high
                ttl: 0
                timeout: 300
                visibility: public
                notification_icon: mdi:movie-open-play

As you can see in the third block of code, the important part is using the action parameter to create an action that when pressed will be fired into the Home Assistant event bus.

So in this case, when I get the notification that a movie is playing on the TV and asking if I want to activate movie mode.

The first block of code, has a trigger that intercepts that event notification_response_action and triggers if the data is response_action: media_mode_livingroom

This should be adaptable for your use case.

You just need an automation that triggers at 22:30, and sends the notification and include an action like -action: garage_door_auto_close then intercept that in the same automation with a trigger. You’ll notice I use a 300 second timeout on my notification which will automatically dismiss the notification if I haven’t responded within 5 minutes. Because I’m obviously not interested in starting movie mode if I haven’t responded in that time. It’s up to you whether you want to keep that, change it to a longer period or omit it entirely.

1 Like

In case that fits your needs.

1 Like

Well, yes. This is off course possible and I have done something simulare to this …