Recap - Control Alexa plugs or other Alexa only supported devices

Hi everyone,

I was investigating the options available to control Amazon Smart Plugs or other devices that might have supporting Alexa but not directly in HA.
I’ve done some experimentation and also discovered something new, I think, in the process, that I’d like to share here.

My goal:

  • control an Amazon Smart Plug from HA
  • control a cheap Led Strip made by Gosund that has Alexa support but that might not have yet support on HA
  • possible future stuff with closed source support on Alexa but does not have equivalent support in HA


  1. Use Alexa Media Player component to trigger an Alexa Routine
  2. Use Alexa Smart Home component to expose to Alexa virtual devices that can be used as triggers in routines.


  1. This is pretty straight forward. After you have Alexa Media Player configured you just need to invoke a service, passing as an input variable the same utternace you have configured in a corresponding Alexa routing voice activated:

Invoke service media_player.play_media with this data:

entity_id: media_player.MY_ECHO_HERE
media_content_type: routine
media_content_id: "UTTERANCE HERE"
  1. It’s more challanging and took me some good trial and error time to get it right.
    I’ve found the idea described first here and it’s also vaguely listed in the official docs here
    The idea is that if you have:
  • configured Alexa Smart Home integration and enabled pro-active events
    in Haaska custom Amazon Skill, you can create Template Sensors in HA, exposed them to Alexa, and then use their state as triggers to start an Alexa routine.
    This whole idea is also confirmed by Amazon support on this thread where they provide a longer list of options than those currently listed on Alexa Smart Home doc page.
    I’ve tried all of them, and I will give some example here. All of them, but the “Temperature Sensor” and the “Lock Sensor” worked for me.
    The most intresting aspect of my experiments has been that even stuff that was not supposed to work was indeed working!
    If you check this other official Amazon doc page some of the official API are supported only for specific languages. Well, I’ve discovered that some of the “unsuopported” ones are actually working if you just add your own language to the list of supported ones. To do so you have to patch the official HA Smart Home Components.
    Mind that I’ve performed this test only for the Italian language, this might not hold true for the other not officially supported languages.
    So, what I’ve managed to confirm is that, you can indeed use the following list of HA devices exposed to Alexa to be used as triggers for routines:
  • Motion Sensor
  • Contact Sensor
  • Doorbell Event
  • Security Panel

While I had issues with the following:

  • Temperature Sensor ( They were not even listed as possible Routines triggers in Alexa app)
  • Lock ( They were actually listed, but when selected an error message in the app says that they are not supported).

The interesting aspect in knowing that all those different kind of entities can be used is that they come with a different set of additional features (some of them are binaries, some are not. Doorbell for example allows you to ring a bell sound when activated in Alexa)

Below a sample list of partial configuration I’ve used to perform my tests. Mind that some of the templates are static and not fully dynamic. But you should be able to adjust them easily:

# Create first an helper input boolean to control the template sensors:
# input_boolean.amazon_smart_plug

# Binary sensors
- platform: template
      friendly_name: "Virtual Motion Sensor"
      device_class: motion
      value_template: "{{ is_state('input_boolean.amazon_smart_plug', 'on') }}"
      friendly_name: "Virtual Door Sensor"
      device_class: garage_door
      value_template: "{{ is_state('input_boolean.amazon_smart_plug', 'on') }}"
      friendly_name: "Virtual Door Sensor"
      value_template: "{{ is_state('input_boolean.amazon_smart_plug', 'on') }}"

# alarm control panel
  - platform: template
        code_arm_required: false
        value_template: "DISARMED"
          service: persistent_notification.create
            title: >-
            message: "Arm Away"
            notification_id: "virtual_alarm"
          service: persistent_notification.create
            title: >-
            message: "Arm Home"
            notification_id: "virtual_alarm"
          service: persistent_notification.create
            title: >-
            message: "Disarm"
            notification_id: "virtual_alarm"

# important: for this to work you need to specify the correct "display_categories" field for each of the specific entity that you enable in your "smart_home:" config
      name: Input Boolean
      description: Input Boolean
      display_categories: LIGHT
      name: Template Binary Sensor TEMPLATE LOCK
      description: Template Binary Sensor TEMPLATE LOCK
      display_categories: SMARTLOCK
      name: Virtual Motion Sensor
      description: Virtual Motion Sensor
      display_categories: MOTION_SENSOR
      name: Virtual Door Bell Sensor
      description: Virtual Door Bell Sensor
      display_categories: DOORBELL
      name: Virtual Alarm Control Panel
      description: Virtual Alarm Control Sensor
      display_categories: SECURITY_PANEL

If you do this and you take care that you specific language is enable for the corresponding sensor you want to use. ex. here you will be able to use the devices to trigger your Alexa routines and have access to every command you can trigger from there.

My plan is to open a PR to add the additional unofficial languages for the APIs I’ve tried directly.