How to trigger Alexa routines from Home Assistant

I’m having similar problems. Using Nabu Casa Cloud to talk to Alexa. Alexa sees and controls my exposed devices perfectly (“Alexa, turn on the lights”). Now want to trigger a routine.

Created an input boolean and exported it to alexa as a contact sensor:

     - input_boolean.cat_feeder_alert_go
      name: Cat Feeder alert
      display_categories: CONTACT_SENSOR

(only relevant portions left in)

Added to Alexa. On the “all devices” screen in the Alexa iOS App, the sensor is there, and responds to changes in HA, although on its detail screen it displays a “There was a problem” banner. Nonetheless, it works.

There are probably 20-30 other devices visible under “all devices”.

However, when I go to create a routine, on the “When this Happens” -> “Smart Home”, I get “No devices found. To start a routine with a smart home device, add one in the Devices section of the Alexa app.” Absolutely no devices show up here at all.

The devices is also visible in the Alexa web app, but the web app doesn’t have routines…

Anyone have any ideas?

1 Like

Hey everyone!
I set up everything so far, but I am completely new to home assistant and I usually need some time too get comfy with all this.
I need help setting up a device tracker to be a template binary sensor for triggering alexa routines.
Can someone help me? I currently have the HA app on my phone and a ping setup for device presence, planning on going deeper into this later, so if you can provide me a little walkthrough of the code to create a template binary sensor with the required door class, that would be amazing. Thanks!

Nevermind figured it out. I have my binary sensor now in the Alexa app, working perfectly, reporting the open or close state, because device class is a door. But I can’t get it to trigger routines. I can set it as trigger for a routine, but it won’t trigger the routine.
I am not using Home Assisant Cloud, I saw someone suggested using the debugging tool in the alexa developer console, but I can’t get my head around this, need detailed instructoins please. I followed the tutorial carefully, went over it a few times now, everything is as it should be. No idea what to do. please help.

I’m having the same problem. The Alexa app discovers the boolean switch as a contact sensor but displays “There was a problem” when I attempt to utilize it? Did you ever sort this out?

1 Like

Just for the record: I gave up on this approach and am just using the AlexaRemote palette in NodeRed. I’m not a fan of NodeRed, but this just works…

You can’t use an input_boolean, nor a switch, only binary_sensor.

As noted in bold in the first post:

Please note that the Alexa component will only recognise binary sensors that have one of the following device classes: door, garage_door, opening, window.

You must use a binary_sensor entity, with one of those class types (or the CONTACT_SENSOR display category). But (as noted in the first post), it needs to be a binary_sensor.


@abmantis - I’m trying to use an input_boolean configured as a contact_sensor as noted below in my config…I was under the impression this would work?

        name: Security Switch
        display_categories: CONTACT_SENSOR

Is there another way to accomplish this?

See the comment above yours.
I’m not sure why people are trying to use input_booleans for this :sweat_smile: please let me know if there’s some place or docs that says that so I can update it.

This may or may not be relevant as I am not sure if you are using Emulated Hue or the Nabu Casa thingy…
At one time you could expose input_booleans to Alexa using emulated hue, when that stopped working I created a template light based on my input_boolean, those can be exposed… also I have a “Virtual Light Bulb” as one of the threads linked above references… Alexa can set the brightness which HA watches… so you now have 100 possible brightness levels to trigger different things… you make an Alexa routine, which then sets the brightness, and HA responds accordingly based on the brightness level that Alexa set the bulb to

1 Like

That is a different use case.
This is to trigger alexa routines from HA, and not to call HA actions from alexa.

I’m new to HA, so I’m still learning and perhaps I’m not going about this the way I should. My ultimate goal is to be able to press a toggle button and turn on/off a virtual switch (boolean_switch) that triggers an Alexa Routine. I was able to accomplish this in Hubitat through a virtual contact sensor device driver.

I assumed that if I created an input boolean and configured it as a contact sensor in the Alexa environment that it would see the open/close (or on/off) and trigger the routine accordingly.

Any suggestions how I might accomplish this?

You just need to create a template binary_sensor for example, and map it to the input boolean. Then expose the binary_sensor in alexa instead of the boolean.


Thanks…I’ll play with it tonight! Appreciate the help!

Has there been any success with this? I have a binary sensor classed as opening and an Alexa routine that should send a notification to my phone when the sensor switches to open. I can view the sensor in the Alexa app and watch it change from close to open back to close but the routine never triggers. I have disabled re-enabled the haaska skill multiple times I even disabled, cleared all devices and re-enabled and re add devices. The send events to alexa is enabled. I am lost as to what to try next.

Yes, It is working fine.
On the Alexa developer console, open your skill, go to the Test tab and enable de Device log widget. Check if anything appears on that log when the binary_sensor changes states.
Also, is there any error on the alexa app?

The event log does not show anything when the state changes. The app gives no error and it allows me to save the routine with the sensor as the trigger.

Can you post here how you are defining the sensor and how you are exposing it in the Alexa integration?

I solved it, I had the client id and secret in quotes in the configuration.yaml. everything works perfectly now.

Finally got round to looking at this. After some effort the solution is really simple.

The Nasa Casa alexa cloud now exposes binary sensors. all you have to is ensure the binary senor you want to expose to the alexa routines is in the correct device class ( I use motion).

I have a number of leak sensors , which are in the device class moisture. The alexa app sees these devices , but cannot trigger routines with them ( which would really useful for alexa to scream danger danger ! when activated)

so you simply change the device_class to motion using the customisation’s option in the configuration menu. Select the entity, pick an attribute to override, select other :-

attribute name device_class attribute value motion

enjoy :slight_smile:

I am still having an issues with Alexa routines and my motion sensors. I am using philips hue motion sensors that are linked to HA via Phoscon integration. Sensors work great in HA but i need them to work in Alexa and the motion sensor is just not picking up.

I have verified the sensor is setup as “motion”, configuration below:
‘on’: true
friendly_name: Kitchen
device_class: motion

When i select the motion sensor under devices in the Alexa app, it says the device is unresponsive.

Any help to troubleshoot would be great.