Alexa Proactive Mode & Triggering a Routine

Hi,
Having problems creating an Alexa routine triggered by a Home Assistant state change.
I’ve got Alexa Smart Home API working, account linking is fine. Alexa can reliably control switches & lights and read temperature values from sensors.

But when I try create a routine triggered by a ‘Smart Home’ event, none of my devices show in the list in the Alexa app (New routine -> When something happens -> Smart Home -> Choose Device). I’ve got a binary sensor exposed to Alexa as a test but although the device is discovered by Alexa, it doesn’t allow it to be used to trigger a routine.

I’ve got ‘Send Alexa Events’ enabled, account is linked and I think I’ve got the config right.

alexa:
  smart_home:
    endpoint: https://api.eu.amazonalexa.com/v3/events
    client_id: !secret alexa_client_id
    client_secret: !secret alexa_client_secret

haconf1.jpg
haconf2.jpg

There is nothing in the log to indicate a problem.

Pretty stuck now.

Thanks for any suggestions.

I don’t quite follow. I thought to trigger something via an Alexa Route in HASS you had to use a script? (Scripts show up as Scenes to Alexa)

I’m pretty sure that’s what I did ages ago.

It should be possible to trigger an Alexa routine from HA using the smart home skill (https://www.home-assistant.io/integrations/alexa.smart_home/) so Alexa can say something when an event happens in Home Assistant.

Alexa can control all the devices via the smart home setup, but the sending of events back to alexa doesn’t seem to work???

After extensive googling finally got it going!!!

What the instructions don’t say is that Alexa will only recognise binary sensors with these device classes as triggers for a routine…

door; garage_door; opening; window

From https://ledstripsandcode.blogspot.com/2019/01/how-to-trigger-alexa-routines-with-home.html

Early tests are all good!!!

So what exactly does this do?

It means that home assistant can trigger Alexa to say or do something.

So I have it set up so that Alexa will announce that the heating is being turned on off (as I control my heating with HA). But you could have it used like a door bell so Alexa will say ‘there’s somebody at the door’, when the doorbell is pushed.

I have the exact same problem.
But it doesn’t work for me changing the device_class.
Can you show me your customize.yaml or have you done it with the WebUI.

This is my customize.yaml

binary_sensor.vibration_postbox:
  device_class: motion
binary_sensor.openclose_44:
  device_class: door
binary_sensor.openclose_45:
  device_class: window

I edit the customize.yaml file. This works for me…

  binary_sensor.lounge_heater_off_presence_binary_sensor:
    device_class: door

Does your lamba test event work OK?

Yeah, my lambda Function looks correct.
Here is a part of it:

},
    "payload": {
      "endpoints": [
        {
          "capabilities": [
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa",
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "binary_sensor.openclose_44 via Home Assistant",
          "displayCategories": [
            "CONTACT_SENSOR"
          ],
          "endpointId": "binary_sensor#openclose_44",
          "friendlyName": "Fenster Patrick",
          "manufacturerName": "Home Assistant"
        },

Hey @Mourkain!
Did you solve your problem?
I tried to relink the acount and setting the device_class to door, but nothing seems to work :-/
The list in the routine is empty.

sadly not. I found a workaround for my use case but I couldn’t solve the Problem with Sensors not showing up for Triggering a Routine :confused: