Please note: this page has been translated automatically. If you can, you should read it in one of these languages:

Link Domoticz-Alexa : ha-bridge

ha-bridge is a software that simulates a bridge zigbee Philips Hue on your computer.

Installation of ha-bridge

We will install with the user domotiko previously created.

Prerequisites:

sudo su - domotiko
mkdir ha-bridge
cd ha-bridge
wget https://github.com/bwssytems/ha-bridge/releases/download/v5.4.1RC1/ha-bridge-5.4.1RC1.jar -O ha-bridge.jar
exit

We will install with the previously created user.

We will install with the previously created user ha-bridge .

sudo bash
cat > /etc/systemd/system/ha-bridge.service <<!

[Unit]
Description=HA Bridge
Wants=network.target
After=network.target

[Service]
Type=simple

WorkingDirectory=/home/domotiko/ha-bridge
ExecStart=/usr/bin/java -jar -Dserver.port=8082 -Dconfig.file=/home/domotiko/ha-bridge/data/habridge.config /home/domotiko/ha-bridge/ha-bridge.jar
User=domotiko
RuntimeDirectory=domotiko
LogsDirectory=domotiko
Restart=on-abort
PIDFile=/var/run/domotiko/ha-bridge.pid

[Install]
WantedBy=multi-user.target
!

sudo systemctl daemon-reload
sudo systemctl start ha-bridge.service
sudo systemctl enable ha-bridge.service

Ha-bridge is now accessible to: http: // address_du_pi: 8082 /

Optional but recommended: Set up a user.

Connect to the interface: http: // address_du_pi: 8082 Click «Update Security Settings»

Customize apache for relay port 80 to the 8082 port

Customize_Google Home_ for relay port 80 to the 8082 port

The necessary modules are activated and launched the editor nano to change the default web site settings:

sudo a2enmod proxy proxy_http headers
sudo nano /etc/apache2/sites-enabled/000-default.conf

In the editor, now it is necessary to add the lines below after the line “<Virtuadhost *: 80>’:

        ProxyPass         /api  http://localhost:8082/api nocanon
        ProxyPassReverse  /api  http://localhost:8082/api
        ProxyRequests     Off
        AllowEncodedSlashes NoDecode

        # Local reverse proxy authorization override
        # Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)
        <Proxy http://localhost:8082/api*>
                  Order deny,allow
                  Allow from all
        </Proxy>

Save the file with Ctrl-X

(1) is activated, and stimulated:

sudo systemctl enable apache2
sudo systemctl stop apache2
sudo systemctl start apache2

You can now customize the link Alexa-Domoticz : See article Amazon Alexa

You can now customize the link: See articleAmazon Alexa

You can now customize the link pi : See article bullseye__Amazon Alexa _apache

Sep 23 17:45:24 localhost apachectl[500]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 192.168.24.103:80
Sep 23 17:45:24 localhost apachectl[500]: no listening sockets available, shutting down
Sep 23 17:45:24 localhost apachectl[500]: AH00015: Unable to open logs
Sep 23 17:45:24 localhost apachectl[449]: Action 'start' failed.
Sep 23 17:45:24 localhost apachectl[449]: The Apache error log may have more information.

You can now customize the link sudo systemctl start apache2 : See articleAmazon Alexa

Restart=on-failure
RestartSec=10

Now the first start of apache fails, but a second attempt automatically gets 10 seconds later.