How to trigger Alexa routines from Home Assistant

Since version 0.85, the Home Assistant's Alexa component supports proactive reporting of devices' states to Alexa. What this means is that when a device's state changes, Home Assistant will let Alexa know of that change. Previously, Alexa would only query devices states when you look at them on the Alexa app, or when you asked Alexa about a device.

While at first this doesn't look like something very useful, it opens up a new possibility: allowing Home Assistant to trigger Alexa's routines! With a routine you can make Alexa say something, play the Flash Briefing, tell the weather, change the volume of the Echos, and some more other actions that are supported by routines!

So, how can you do this? Its pretty simple, actually. First, make sure you've setup the SmartHome Alexa Component to allow proactive reporting (make sure you have endpoint and client_id/client_secret specified). Next you just need to expose a binary sensor (it can be a normal door sensor, or even a Template Binary Sensor) to Alexa, and ask Alexa to scan for devices. Finally, create a routine in the Alexa app, and on the "When this happens" choose "Device" and then choose the new device! You can then specify the actions for this routine as desired.

That's it! When the sensor changes to the state you specified on the routine, the routine will automatically trigger!

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

The Cloud Component does not support this as of version 0.85, but should support it soon.

Comments

Popular posts from this blog

Simple thermostat scheduler in Home Assistant

Home Assistant: Notify when a light was left on and no one is at home