Skip to content
Elmar Hinz edited this page Jan 3, 2023 · 14 revisions

Advanced Features

This is a place to add guides for enhanced functionality for the custom skill.

Person Detection

A guide for adding the ability for the skill to detect who responded to it via your Alexa Voice Profile

BIG DISCLAIMER: Do not expect this feature to be flawless, I've personally witnessed it not working in a few occasions. As such, I will be unable to provide support if it does not recognize you. So your mileage may vary.

Giving the custom skill Skills Personalization permissions.

  1. Navigate to https://developer.amazon.com/alexa/console/ask and login with the same credentials you use for your Alexa devices.
  2. Choose the custom skill you created during the initial setup of the Alexa Actions.
  3. In the bottom left of the page you'll see Permissions. Please click it.
  4. Once on the permissions page find 'Skills Personalization' and toggle it on.
  5. You're all done.

Download the latest code.

  1. Download the latest lambda_function.py (version 0.6.0 or newer)
  2. Setup as normal.
  3. Trigger an automation and respond as usual.
  4. You should now see event_person_id in the event payload. This can be used for automations.

Finding your Person ID

  1. Log into Home Assistant and go to Developer Tools
  2. Click on Events
  3. In the Listen to events section (you may need to scroll down put alexa_actionable_notification in the box and click start listening.
  4. Trigger the skill and provide a response, you should see JSON code popup when you respond to the actionable notification.
  5. In that response you should see event_person_id: followed by amzn1.ask.person.averylongstringofnumbersandletters this is the person_id for the detected person. Repeat this for all other voices to get all the IDs. Once you have them you can use them in your YAML or NodeRed automations.

Adding an automation

automation:
  - alias: Front door left unlocked for 5 mins
    trigger:
      platform: state
      entity_id: lock.front_door
      to: 'on'
      for:
        minutes: 5 

    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          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.living_room_echo'

  - alias: Lock the door via actionable notificaiton if specific person
    trigger:
      platform: event
      event_type: alexa_actionable_notification
      event_data:
        event_id: actionable_notification_lock_left_unlocked
        event_response: ResponseYes
        event_person_id: amzn1.ask.person.averylongstringofnumbersandletters
    action:
      - service: lock.lock
        entity_id: lock.front_door

Additional Text Responses

A guide for adding additional voice responses to the custom skill. Please ensure that you have a fully functional version of the custom skill and actionable notifications before continuing.

  1. Navigate to https://developer.amazon.com/alexa/console/ask and login with the same credentials you use for your Alexa devices.
  2. Choose the custom skill you created during the initial setup of the Alexa Actions.

Adding a new Slot Type

  1. Find under Slot Types Selections
  2. Click on it and add each of the things you would like to say to the slot type.
  3. Click Build Model

Adding an automation

automation:
  - alias: When the TV turns on, ask what you want to watch (Netflix, Hulu, YouTube) 
    trigger:
      platform: state
      entity_id: media_player.tv
      to: 'on'
    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          text: 'I noticed the TV was turned on, what would you like to play, Netflix, Hulu or YouTube?'
          event_id: 'alexa_notification_media_tv_select'
          alexa_device: 'media_player.living_room_echo'

  - alias: TV turned on and user wants Netflix
    trigger:
      platform: event
      event_type: alexa_actionable_notification
      event_data:
        event_id: alexa_notification_media_tv_select
    action:
      - service: media_player.select_source
        entity_id: media_player.tv
        data_template:
          source: "{{ trigger.event.data.event_response }}"