Domoticz is a free and open source home automation server very simple to install and configure on a Raspberry Pi 3 (or 2). In this article we will discover how to install and configure it. To write this article I used a Raspberry Pi 3 equipped with a Micro SD board 8GB class 10. We will see how to configure the WiFi connection of the new Raspberry Pi 3 if you do not have an ethernet plug nearby.
Equipment used
The Raspberry Pi 3 is very well adapted to the realization of a home automation box 100% Domoticz. Here is a typical configuration.
That is a budget of about €65.
Installation of Domoticz on Raspbian
Let’s start by updating the system
sudo apt-get update sudo apt-get upgrade sudo reboot
Then we check that the file system is extended and that the whole place of the SD board is available. run
sudo raspi-config
Then go to 1 Expand Filesystem
Restart the RPI with sudo reboot to complete the operation.
Create the Domoticz user
Even if it is not necessary, it is best to create a domoticz user. Run the following command and fill in the requested information (the account name and password at a minimum). For security, give a password different from that of the user pi.
sudo adduser domoticz
The new user is added to the sudo group to allow it to use this command.
sudo adduser domoticz sudo
Change user
su domoticz
Then, you modify the configuration to allow the user to execute sudo commands without entering the password.
sudo visudo
At the end of the file, insert this new line
domoticz ALL=(ALL) NOPASSWD: ALL
Save with Ctrl + X then Y.
Installing Domoticz
Now that everything is ready, change account and run the installation with this curl command.
sudo curl -L install.domoticz.com | bash
This simple command will take care of everything. From the installation of the dependencies to the configuration via small configurators that will appear as the installation.
Configuration start
You can activate change the HTTP and HTTPS ports
Change the destination folder
Installation is completed
Once the installation is complete, close the last window and wait for the Domoticz service to start before you connect from a browser to your new smart home box.
Configure the keyboard
Then run sudo raspi-config to run the configuration utility. Go to option (5) Internationalization Options then Change Local. Choose your language into the list then validate (2 times).
When done, go back to Internationalization Options and go to Change Keyboard Layout. In the list select PC Generic (intl) then in the keyboard layout English – French (variant). If you do not know which model to choose do not change anything to the following options.
You can now quit raspi-config and reboot your Pi so that the settings apply with the command
sudo reboot
Configure the Wi-Fi connection
Start raspi-config and go to option (5) Internationalization Options then Change Wi-Fi Country. In the list choose FR France. Confirm and exit raspi-config
We will now verify that there is a wlan0 connection. Normally it is already pre-configured on Raspbian.
sudo nano /etc/network/interfaces
You should have the following lines in the configuration. If not, add the following lines.
allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf (dans certain tutos on trouve également les options "iface default inet dhcp")
Press CTRL+X then Y to save and exit nano.
Now you need to set up authentication to the WiFi network. Type
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Your configuration file should look like this
country=FR ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="SSID" psk="PASSWORD" key_mgmt=WPA-PSK }
Save and exit nano and then apply the changes by restarting your Pi (sudo reboot).
You can also manually restart the WiFi interface like this. The wlan0 interface is turned off.
sudo ifdown wlan0
Restart
sudo ifup wlan0
After restarting (or doing ifdown / ifup), type ifconfig. If your configuration is correct, on the 2nd line of the block wlan0 is the ip address of your Domoticz server (it also appears at startup).
Enable SSH connection
Enabling the ssh connection will allow you to access your Domoticz server from another machine without the need to connect a keyboard and a screen to your Raspberry Pi.
To enable ssh, go to option (8) Advanced Options then (A4) SSH. Validate Enable.
Now you can access your Raspberry from Windows using Putty or from the Terminal under Mac OS X and Linux using the command
ssh pi@IP_PI
Librairie libssl.so.1.0.0 absent on Raspbian Stretch
The error was pointed out to me by Philippe in the comments. Several libraries (libssl.so.1.0.0, libcrypto ..) are absent on Raspbian Stretch (version of August 2017), which prevents the start of Domoticz. When you launch Domoticz, you will get the following message
./domoticz: error while loading shared libraries: libssl.so.1.0.0: can not open shared object file: No such file or directory
Here is how to install the library (thanks to Philippe who found the solution on the official forum of Domoticz).
The Linux ldd command verifies that all necessary libraries are installed. Run the following command by changing the path if necessary.
ldd /home/domoticz/domoticz
The command returns the list of required libraries and indicates the installation path. If a library is missing, the message not found is shown next to it. for example
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f73000) libusb-0.1.so.4 => /lib/arm-linux-gnueabihf/libusb-0.1.so.4 (0xb6f47000) libssl.so.1.0.0 => not found libcrypto.so.1.0.0 => not found librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6f30000) libresolv.so.2 => /lib/arm-linux-gnueabihf/libresolv.so.2 (0xb6f0b000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6ee2000) libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6ebb000) libcurl.so.4 => /usr/lib/arm-linux-gnueabihf/libcurl.so.4 (0xb6e3f000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6e2c000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6dad000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c6e000) /lib/ld-linux-armhf.so.3 (0xb6f88000) .....
To manually install the libssl.so library, we will already download it
wget http://ftp.nl.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
Then install it
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
And here, Domoticz will start normally.
Libssl.so.1.0.0 obsolete library on Raspbian Stretch, updated November 2017
Since the beginning of November 2017, the libssl.so.1.0.0 library seems to no longer be integrated into the Raspbian Strech repository. Here’s how to install the library. A big thank you to Guillaume for the tip.
We will already start by adding the library to the list of sources file. Open it
sudo nano /etc/apt/sources.list
And add this line at the end of the file
deb http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
Save it with CTRL + X, Y. Then run these two commands to install the library
sudo apt-get update sudo apt-get install libssl1.0.0
And that’s it, everything should be in order
Access the Domoticz server from a web browser
Now that our server is ready, we can access it from any web browser, including from a tablet by entering the following URL:
http://IP_domoticz:8080
- Install Domoticz on NAS Synology DS718+ with Docker or virtual machine under Debian Buster
- Use the plugins on Domoticz. Manual installation or via Python Plugin Manager
- CloudMQTT test, free online MQTT broker. Control Domoticz with the JSON API
- Securing Domoticz with Let’s Encrypt certificate, access from HTTPS internet
- Xiaomi Mijia Honeywell Smoke Detector Test with Domoticz, Emergency Notification with PushOver
- Test Zigbee2MQTT gateway. Part 2, include Xiaomi Aqara or Mijia accessories to Domoticz with Node-RED
Bonjour, supprimer les espaces avant et après le + :
sudo dpkg -i libssl1.0.0_1.0.1t-1 + deb8u6_armhf.deb
devient :
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
Merci beaucoup Olivier. C’est corrigé !
Could you tell me how to add the repository line to sudo nano /etc/apt/sources.list?
Hello Peter, just copy/past or type this line at the end of the file.
getting a message when trying to run ldd that ./domoticz is not regular file. any suggestions?
“GPIO INIT ERROR” when i try to choose Pin. Can somebody help me with configure RPi ?
@projetsdiy:disqus What are the steps to uninstall?
I think I installed it to the wrong user due to:
Change user
su domoticz
Then, you modify the configuration to allow the user to execute sudo commands
without entering the password.
…
…
Installing Domoticz
Now that everything is ready, change account and run the installation with this
curl command.
…
This gave the impression I should change back to my original login account.
I figured the cleanest thing would be to uninstall and try installing again, thoughts?
@projetsdiy:disqus I ran the install command again as the correct user, it offered to reconfigure the install (nice!)
However, I don’t seem able to hit upon the correct username / password combination for the web interface – where can I look?
Hello Joe and thank you for your feedback. The user you just created his Raspbian and different from the user created by the Domoticz server from the settings panel.