Toggle Lights and Switches with an Amazon Echo Button

I’ve been looking for a while for a button that I can use to integrate into my home automation. I was excited when Amazon announced the Echo Button, only to be disappointed to hear that it can’t toggle a light or a switch. They can be programmed to only turn something on or only turn something off. I’ve figured out a workaround to get it to toggle devices.

They recently had a price drop, so I figured I would just order them just to see if I could get any use out of them in other ways. My first thought after opening them is that they are larger than I had hoped for. However, after discovering that Amazon’s intention wasn’t just to use it as a way to trigger routines, but also play games, their size makes a little more sense. The best part is that I was actually able to figure out a fairly easy way(assuming you’re using Home Assistant), to toggle something using the Button.

You will need to setup the Echo and the Buttons. I’m not going to go into any detail on how to do that since there are tons of resources on it, and it’s pretty straightforward. If you do need help with it for some reason, post in the comments. The Buttons are pretty much telling Alexa you want to set them up, and she walks you through it.

Next, we need to setup Home Assistant(HASS). First, you need to setup the Emulated Hue Component. This component emulates Philips Hue devices, which can then be added to the Echo. Below is the yaml code I used. The IP addresses are just the IP of your HASS computer. The other settings are explained fairly well in the documentation link for this component. The most important is to have ‘script’ in the exposed_domains list and the ‘off_maps_to_on_domains:’ section.

Now, setup the script that will be called when the Button is pressed. The script just toggles a device. In this case, I am toggling my fireplace (because that’s still my favorite project). Of course, you will need to change the ‘alias’, ‘service’, and the line below ‘entity_id’.

Save the config and restart Home Assistant. Then go into your Alexa app. Tap Devices -> Plus button at the top right -> Add Device. Tap Philips Hue, and then “Philips Hue V1 bridge”. It will take just under a minute to search for the devices and it should find that script that you setup. Just follow the steps to finish adding it. After that, the script will show up in Alexa as a bulb that you can turn on or off. And whether you turn it off or on, it will just run that script in HASS.

Finally, we setup the Routine for the Button.

In the Alexa app, tap the menu button at the top left, and then ‘Routines’.