Skip to main content
loading
By Michal Novotný
December 19, 2025
Voice control of the house

In this article, we will connect the Amazon Echo Dot voice assistant with open source home automation. We won't be using OpenHAB Cloud, so everything runs locally. In this case, a few additional settings are necessary, but the result is worth it!

Hardware

Pi-Home - if you don't have it, see the section How to do it

Alexa Echo Dot

Software

OpenHAB 3

 

Procedure:

1) Connect to Raspberry via SSH and install nginx to redirect traffic from port 8080 to port 80 (default port for HTTP traffic)

 sudo apt-get update && sudo apt-get install nginx

 

2) Then edit the configuration file by command below and insert the following code into the file:

sudo nano /etc/nginx/sites-enabled/default

server{ 
 

listen 80; 
 listen [::]:80;


 location / { 
   proxy_pass http://127.0.0.1:8080/; 
   proxy_set_header Host $http_host; 
   proxy_set_header X-Real-IP $remote_addr; 
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
   proxy_set_header X-Forwarded-Proto $scheme; 
 } 

 location /api { 
   proxy_pass http://localhost:8080/api/; 
 } 
}

 

Save by pressing Ctrl+o and close the nano editor (Ctrl+x).

 Check if the configuration is correct with the command:

sudo nginx -t

If it says OK, restart nginx

sudo service nginx restart

 

3) Now enter your OpenHAB IP address in the browser. You should reach OpenHAB on default port 80. To connect with Alexa, we will use the "Hue emulation" binding. Install it in the Bindings section:

 

 After installation, click Settings -> then at the bottom right, expand Other services and click on Hue Emulation.

Check Show advanced. Fill in at least 120 seconds for the pairing time. If you have an older Alexa, also check the option

Pairing: Temporarily Emulate V1 Hue Bridge and manually enter the Unique Bridge ID.
 
Enter a value in the format: 00:ec:81:51:63:1a:cc:56. You can change it as desired. Do not leave the long automatic code. It may not work.
 
 
After changing the Unique Bridge ID, you need to restart the Raspberry Pi.
 
After the restart, click on Settings -> then at the bottom right in Other services, expand Hue Emulation and check Device pairing and click Save. Now try entering the following address in your browser:
http://your_openhab_address/api/status.
 
You should see something similar.
 
 
 
Finally, connect Alexa to the same Wi-Fi range as your OpenHAB. Now connect to Alexa either through the web interface: https://alexa.amazon.com/ or through the mobile app and select Smart Home -> Devices -> Scan. Meanwhile, start Device pairing in OpenHAB again, which will run for the set 120 seconds. Alexa should automatically detect objects with the tags "Switchable," "ColorLighting," or "Lighting".
 
In OpenHAB 3, you only need to add the "Switchable" tag to the items you want to control.
 
 
 
Alternatively, you can insert/update Items in text format.
 
Switch  TestSwitch      "Kitchen Switch" [ "Switchable" ]    {channel="..."}
Color   TestColorBulb   "Bathroom"       [ "ColorLighting" ] {channel="..."}
Dimmer  TestDimmer      "Hallway"        [ "Lighting" ]      {channel="..."}

 

Final note:

Alexa currently only works in a few world languages, so you can use English or German. Therefore, in some cases, a change in the names of lights may be required. For example, turn on a light by saying: "Alexa, turn on living light" (Turns on a light named living light).

Tip:

The goal is, of course, to have as many functions as possible. In OpenHAB, create new dump Switch items, such as "Alarm" and add tag "Switchable". Then add a rule, for example, to arm the house after 60 seconds. When leaving, simply say to Alexa: "Alexa, turn on Alarm".

Note: Of course, it doesn't make sense to turn off the alarm by voice for security reasons ;) For that, we use an application or NFC tag. They are secure.

 

Tags

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.