Alexa Actionable Notification - My fourth one now but using responses other than Yes/No/NoResponse

image

Me: Alexa, I bought coffee filters
Alexa: How many coffee filters did you buy?
Me: 100

image

The default actionable notification script:

alias: Activate Alexa Actionable Notification
sequence:
  - service: input_text.set_value
    data:
      entity_id: input_text.alexa_actionable_notification
      value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
  - service: media_player.play_media
    data:
      media_content_type: skill
      media_content_id: amzn1.ask.skill.6b2071e3-0f30-4fcf-b3d3-xxxxxxxxxxxx
      entity_id: '{{ alexa_device }}'
mode: single
description: Activates an actionable notification on a specific echo device
fields:
  text:
    description: The text you would like alexa to speak.
    example: What would you like the thermostat set to?
  event_id:
    description: Correlation ID for event responses
    example: ask_for_temperature
  alexa_device:
    description: Alexa device you want to trigger
    example: media_player.new_white_echo_dot

Alexa routine:

Name: I bought Coffee Filters
When You Say: Alexa, I bought coffee filters
Alexa Will: SCENE: Alexa I bought Coffee Filters

HA script triggered:

alias: Alexa - I Bought Coffee Filters
sequence:
  - service: script.activate_alexa_actionable_notification
    data_template:
      text: How many coffee filters did you buy?
      event_id: actionable_notification_coffee_filters
      alexa_device: '{{ states.sensor.last_alexa.state }}'
mode: single

Automation routine:

alias: Actionable Notification - I Bought Coffee Filters
description: ''
trigger:
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: actionable_notification_coffee_filters
condition: []
action:
  - service: input_number.set_value
    entity_id: input_number.coffee_filter_count
    data_template:
      value: >-
        {{ trigger.event.data.event_response|int +
        states('input_number.coffee_filter_count')|int}}
mode: single
2 Likes

That’s a great idea!

Now I just have to figure out where I can use it. :laughing:

For the finale…

image
image

This is the state when the smart power plug switch is turned off…

image

I just another idea pop into my head. I will work on it later.
I have a Good Night script that Alexa activates. I recently modified it with a hard-coded value for transitioning the bedroom lights to off. I was going to set up an input number so I could adjust it from the UI rather than editing the script. Then I thought, why not have Alexa tell me “The lights will transition to off in xx seconds. Is that okay?” If “Yes” or no answer proceed with the input_number value. If “No” then have her prompt me for the transition time. Could be seconds or minutes, or even hours (possible but unlikely}. I’ll start with just a simple number for now as seconds…

2 Likes