Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MarkWattTech/4884268d62b8f64925d3b124ee9bca63 to your computer and use it in GitHub Desktop.
Save MarkWattTech/4884268d62b8f64925d3b124ee9bca63 to your computer and use it in GitHub Desktop.
Alexa Actionable Notifications Video Code
Thanks for checking out my tutorial!
Dont forget to drop the video a like and hit that subscribe button for more!
====================================================================================
INPUT TEXT (Add it to your config.yaml or wherever you store input text)
===================================================================================
input_text:
alexa_actionable_notification:
name: Alexa Actionable Notification Holder
max: 255
initial: '{"text": "This is a test of the alexa actions custom skill. Did it work?", "event": "actionable.skill.test"}'
=================================================================================================================
====================================================================================
Marks Activate Alexa Actionable Notification Script
===================================================================================
activate_alexa_actionable_notification:
description: 'Activates an actionable notification on a specific echo device'
fields:
text:
description: 'The text you would like alexa to speak.'
event_id:
description: 'Correlation ID for event responses'
alexa_device:
description: 'Alexa device you want to trigger'
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.alexa_actionable_notification
value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
- service: media_player.play_media
data_template:
entity_id: "{{ alexa_device }}"
media_content_type: skill
media_content_id: amzn1.ask.yourskill
=================================================================================================================
====================================================================================
Dev Tools Demo Code - Testing the script
===================================================================================
service: script.activate_alexa_actionable_notification
data:
text: Should I turn off all the lights?
event_id: lights_Off_demo
alexa_device: media_player.kitchen_echo
=================================================================================================================
AUTOMATIONS
==========================
Actionable 1
=========================
alias: Alexa Actionable 1
description: ''
trigger:
- platform: sun
event: sunrise
condition: []
action:
- service: script.activate_alexa_actionable_notification
data:
text: >-
The front door has been unlocked for 5 mins, would you like me to lock
it?
event_id: actionable_notification_lock_left_unlocked
alexa_device: media_player.kitchen_echo
mode: single
=====================================
==================
Actionable 1 Response
=====================
alias: Alexa Actionable Response 1
description: ''
trigger:
- platform: event
event_type: alexa_actionable_notification
event_data:
event_id: actionable_notification_lock_left_unlocked
event_response_type: ResponseYes
condition: []
action:
- service: notify.mobile_app_marks_iphone_xs_max
data:
title: Alexa Actionable Notificiation
message: This is an Alexa Actionable Notification
mode: single
========================================
=============================
Actionable 2
==============================
alias: Alexa Actionable 2 (empty kitchen)
description: ''
trigger:
- platform: state
entity_id: binary_sensor.presence_12
to: 'off'
for: 'minutes: 30'
condition:
- condition: state
entity_id: light.kitchen_light
state: 'on'
action:
- service: script.activate_alexa_actionable_notification
data:
text: the kitchen has been empty for a while. Should I turn off the lights
event_id: actionable_notification_kitchen_lights
alexa_device: media_player.kitchen_echo
mode: single
=======================================
===========================
Actionable 2 Response
==========================
alias: Alexa Actionable Response 2 (empty kitchen)
description: ''
trigger:
- platform: event
event_type: alexa_actionable_notification
event_data:
event_id: actionable_notification_kitchen_lights
event_response_type: ResponseYes
condition: []
action:
- service: light.turn_off
target:
entity_id: light.light_1
mode: single
=========================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment