How to trigger Alexa routines from Home Assistant

Weird. I’m doing the same thing (binary template) but never even seeing it show up in Alexa as a device.

I have several other template sensors that Alexa’s not seeing. Seems like Alexa only sees sensors created by my devices, not from templates.

Thanks for the info, though.

I disabled the Home Assistant Alexa skill and re-enabled it and my sensor showed up!

When the skill was re-enabled, Alexa did a “discover devices”. That might be the trick. I was expecting it to show up without that. I often get notifications from the Alexa app when a new device is added to Home Assistant.

edit: After doing this, I also had issues with Alexa not seeing my binary sensor update. A restart of HA fixed everything. I had been using the “template entities” reload on the server controls panel when I changed my binary sensor. I wonder if a full reboot triggers setup of that sensor with Alexa that a reload didn’t initiate.

1 Like

Oh - they’re not showing up at all…

Then in Home Assistant, go to Configuration > Home Assistant Cloud. Scroll down to your Integrations, then in the Alexa section, click Manage Entities. I bet your template sensors are all listed in the “Not Exposed Entities” list. For the entities you want to expose, click the red x, then select “expose entity”.

Up in the top right corner, there’s also a “Manage Domains” options. I have all of those turned off because I had way too many new entities showing up and cluttering Alexa. I find it’s a lot easier to just go in and manually expose new entities vs. deleting all entities I didn’t want.

1 Like

Yep - I checked the “manage entities” page each time I tried to get the info into Alexa - just to confirm that Alexa was being sent what I expected…

I have an odd situation where I cannot use home assistant sensors in routines. If I do not have the endpoint client id etc… in the config then the devices can be added to routines BUT the routines don’t actually trigger. If i have the config filled in then again the devices show but are no longer able to be used for routines.

Config:

alexa:
  smart_home:
    locale: en-GB
    endpoint: https://api.eu.amazonalexa.com/v3/events
    client_id: <redacted>
    client_secret: <redacted>

Devices are setup as binary sensors:

- platform: mqtt
  device_class: motion
  state_topic: "selfmon/vmod.090203/vrio/outputs/2041"
  name: "Kitchen"

- platform: mqtt
  device_class: door
  state_topic: "selfmon/vmod.090203/vrio/outputs/2042"
  name: "Kitchen Door"

Devices do show up in alexa and the states show and update.

Integration is using aws lambda, dev skill etc… following the guides. “Send Alexa Events” is enabled in the skill. Alexa see’s the door and motion as binary sensors of type Motion Sensor and Contact Sensor but neither one can be used in routines.

Any advice on where to check or what might be going wrong?

Thanks.

Thank you! I really appreciate that! Finally could get this working thanks to your detailed explanation!

Well, I’ve gone through this thread and cant see anything to help me out. I want HA to trigger Alexa routines.
I’ve had HA and Alexa linked for a couple of years now (not Nabu Casa) and can voice control my Tasmotized switches. I can also see lots of my HA entities in the Alexa app on my phone.
However, when i try to create a routine triggered by a Smart Home device, i’m told ‘no devices found’ despite having added device_class: door to an mqtt platform binary sensor and it being in the regular device list.
Any help appreciated.

1 Like

Hi, not sure if this may help you out? 2 options.

HA to Alexa
Create a script within HA for your device and test that it works.

On Alexa app, scan for new devices. Your script will show up as a Scene. From here you just configure it.

             *** OR ***

Alexa to HA
For an Alexa routine to be discoverable by HA, you could try using this.

All the best, let us know how you go with it :+1:

Sorry, missed that bit.

Nabu Casa makes it easier because there is an option for you to select which devices are discoverable.

The 1st option might be the way to go if Alexa cannot discover your devices :thinking:

Graham, can you explain exactly what it is that you are trying to do?

To me, that sounds like you want to have an automation or script in Home Assistant call a service to trigger an Alexa Routine. That is relatively easy to do using the Alexa Media Player custom integration available in HACS.

I have a Blitzwolf IR blaster that controls my telly and AV amp with voice commands to trigger Routines in Alexa. I haven’t found a way to integrate the blaster with HA so I want to HA to trigger those Routines. My reading of stuff so far is that Alexa should be able to see Entities that could trigger a Routine if the Entities were configured correctly. I tried with just one adding “device_class: door” but that does not appear in the the Smart Home Entity trigger list.

I’ve not done any Scripts yet.

I have this in my configuration.yaml file:

binary_sensor:
  - platform: mqtt
    name: "Boiler thermostat demand"
    state_topic: "tele/boiler"
    value_template: "{{value_json['Therm']}}"
    payload_on: "On"
    payload_off: "Off"
    force_update: true
    device_class: door

I picked that Entity because I already had it and was just trying to prove that it would work.

Since you have this already working with Alexa, I think option 2 should work for you.

With the scripts, my use case was sending a robovac to designated cleaning zones. Once I had this working reliably the rest was done in the Alexa app, such as the invocation to trigger them.

So with this entity, what would like to happen when the state changes? An announcement, or something else? You can also use Node Red to achieve this.

I have a Node Red flow, where Alexa notifies that a device needs charging. Once it reaches 80%, there would be another notification and the wall plug switched off.

And there is another option if this is your device ?

https://www.marrold.co.uk/2020/06/flashing-blitzwolf-bw-rc1-with-tasmota.html?m=1

Just how comfortable you feel with doing it. You would then have Tasmota flashed on it. If you are lucky, you may be able to Tuya convert OTA, if it doesn’t have the newer firmware.

Re Option 2, I will have a look at Voice Monkey Basic.

Re what I want to do with that entity state change, was to turn my Amp on or off. HA knows what state it is in so there would be no problem toggling it on when I wanted it off. Of course, it wouldn’t be the boiler entity, i picked that for now just to see if it worked. A lot of my HA entities appear in the All Devices list of the Alexa App, including the boiler one. But Nothing is listed when I try to create a new routine in alexa and pick (when this happens) Smart Home as the trigger.

Re flashing with Tasmota, the thing is working nicely with alexa ATM and I don’t want to lose any of the capability I already have. Flashing with Tasmota to re-create that will take a lot of effort. I’m not worried about the flashing bit as I’ve done that with 7 Sonoff S26 switches already and some ESP8266 devices I have. I have been experimenting with TasmotaIR/8266 but found it not to be that reliable and written my own sketches to read my IR controllers and replicate the codes. I’ve been a bit distracted of late with that project, but know I could do it with MQTT as the interface between my home made IR blaster and HA.

But I heard that Alexa routines could be triggered from HA and that’s what I am trying to do now.

Understood, just another option up your sleeve.

Try creating 2 scripts in HA to toggle the amp off/on. See if they get picked up in the Alexa app as scenes.

There’s a few options available. I’m sure you’ll achieve your end goal. Let us know how you get on.

Take care :+1:

You got me interested with this.

So when you click on All Devices, then your Boiler entity which is listed in Alexa, do you not get this option to create a routine at the bottom?

Like you said, the device wasn’t listed in Smart Home Skills, but I created a routine by selecting it from the All Devices list. Created a routine. Worked first shot. Or this didn’t work for you?

I do get that “Create a Routine” option on some of my devices but not the Boiler one. It just shows me the state (open or closed because I told it the class was door i guess!).
On the other devices where i do get that option, it just takes me to the Routine list, not into a Template for a creating a new one.
It’s probably something really simple that I’m just missing.
Are you using Nabu Casa?

In the Routines list there’s a + icon, top right to create a new one.