TL;DR:
- Home Assistant Cloud to control HomeAssistant from Alexa.
- Alexa Media Player to control Alexa from HomeAssistant.
- This is not valid for all.
Documentation gets outdated quickly. Worse, a lot of blogs and articles in the web don’t even give a date. I investigated how to integrate Alexa with HomeAssistant. This posting can’t be comprehensive. I hope to address the key questions. Where I am wrong please make it more precise. This is still a work in progress.
Directions of action
In general there are two directions to consider. Alexa controlling HomeAssistant and HomeAssistant controlling Alexa, depending at what end the devices are connected. This targets simple getting and setting of the values of the devices.
Then there may be the option to trigger scripts aka routines on the other end. Alternatively both ends may also act as observer and trigger themselves. Finally there is the very powerful option to send full text commands to Alexa, like you would command Alexa by voice.
Each of the mentioned tools does only cover a part of this. HomeAssistant is still limited in controlling devices connected to Alexa. In general I would connect my hardware devices to HomeAssistant. Nonetheless, there are features built into echo devices, you may want to use, temperature, media player etc.
Scripts and routines
Alexa routines are set up by the use of forms, no backup, no versioning, no sharing. Hence, it best to keep scripts on the HomeAssistant end, but there are situations you will decide to use routines.
To cloud or not to cloud
Should the interaction go by cloud or stay in the house? Alexa depends on the cloud anyway. Interaction by cloud in general has some latency. It creates dependencies. Typically additional expenses are involved.
Amazon scaling down
Amazon devices don’t earn money so far. Amazon is already scaling down. Lay-offs and deterioration of music streaming in Prime are examples. Prime video is getting boring. They tear down the web based administration. You depend upon a smartphone. Automations are not that future-proof as they seem to be.
Zigbee
The zigbee of the echo device neither does integrate into the HomeAssistant zigbee network, nor does it work as an extender. It wants to control the zigbee network itself. I don’t know any an option to control zigbee devices connected to echo from the end of HomeAssistant. The Alexa media player team is working on this feature at least.
Hue bridge emulation
HomeAssistant can emulate a hue bridge. It works well within the intended range of hue. That is switching lights connected to home assistant. Beyond it is hacking. It may be worth to exploit those hacks. It is fully in-house. One of those hacks, is to exploit input_boolean
to trigger a routine within Alexa or an automation within HomeAssistant.
It is an official API and is less likely to break in the future. Nonetheless, it did break for the google voice assistant, according to the docs.
Alexa media player
This component is very powerful. The name is misleading. It does not only play media. It can send all kind of commands to Alexa and start routines.
Meanwhile the media player can also get some devices connected to echo, but not all. For example it does not get a Wifi switch connected to the echo device. It does get the built-in temperature, timers, alarms, etc.
The media player tool registers as an Alexa app like those on the Smartphone and should have a similar level of security. As an Alexa app, we can expect it to become full featured in the future.
Disadvantage is, that it is using “the unofficial Alexa API”. You don’t know, when Amazon will break it. Powerful, yet a game of luck.
Amazon Alexa integration
This is the “HomeAssistant official” way to go.
Without the HomeAssistant Cloud:
From the docs:
“An AWS account is needed if you want to use the Smart Home Skill API. A part of your Smart Home Skill will be hosted on AWS Lambda. However, you don’t need to worry about costs; AWS Lambda is free for up to 1 million requests and 1GB of outbound data transfer per month.”
It’s not that easy. First of all AWS requires a credit card, even if you want to use the free plan. Credit cards are very US and not without costs themselves. It is ugly at least, to involve a credit card, where you just want to communicate within your own walls.
With the HomeAssistant Cloud:
All the issues above may be reasons, to better go with the HomeAssistant Cloud at Nabu Casa. The costs are 6.50 USD plus taxes per month or a similar value in other currencies. Depending on your income, it is a number.
Both
Triggering routines
So far I have discovered only one hack to customise the official tool to trigger Alexa routines. This is by creating in input_boolean
. When creating a routine within Alexa, the boolean shows up under Smart Home in the trigger selection. This way a script within HomeAssistant can trigger a routine of Alexa by changing the boolean value.