Raspberry Pi
Introduction
The following page will give you an overview about how to load and run Domoticz on a Raspberry Pi. We will start with the things you will need and then go through the installation of all necessary software and hardware components.
Prerequisites
The following things are needed to install Domoticz and your chosen operating system successfully.
- Raspberry Pi 5, Pi 4, Pi 3 Model B.
- microSD card minimal 4GB class 10 (The original Model B requires a full-size SD card)
- Computer with a SD card reader to install the operating system to the SD card
- Display and HDMI cable
- USB keyboard and mouse
- 5V micro USB power supply (2A power supply is recommended, 2.5A for the Raspberry Pi 3)
- Ethernet cable (or USB WiFi adapter) connected to your home network. Note that the Pi 3B has an on-board WiFi adapter, hence no separate adapter is necessary.
(*) Display, HDMI, keyboard and mouse are NOT mandatory. If you have another computer, you can remote control your RPi via SSH. Just find the IP of your RPi (by examining your router/Home internet Box's DHCP lease table or running a local IP Address scan) and follow all the instructions without the first 'ifconfig' (because you already know its IP Address). Of course, remember not to disable SSH!
You can find some example systems in the Buyer's Guide
When using a Raspberry Pi 4 or 3 Model B, please consider to boot and run from an USB mass storage device instead of microSD card. In order to boot your RPi 3B from USB, you have to enable this function on a RPi3 (see [1]). Your RPi 4 will boot from USB if your EEPROM firmware is from September 2020 or later. For help, look here. Since running Domoticz from an USB stick it never crashes for me anymore.
Prepare your Pi
If you haven't done it already, you need to install a supported operating system on your Pi.
A guide to prepare your Pi for Domoticz can be found here.
WARNING: On some RPi OS'es there are some issues after an OS update causing installation of Domoticz to fail:
1. /dev/serial/by-id is gone resulting in problamatic USB drive assignments
2. Domoticz is seen as a 64 bit application on a 32 bit machine
For a solution check the following forum topic https://www.domoticz.com/forum/viewtopic.php?t=40536
Install Domoticz
The "easy" way
After setting up the operating system of your choice, you are now ready to install Domoticz. Assuming your Linux is Debian-based, like Raspbian or Ubuntu, installing Domoticz is extremely easy. Just open a terminal window and execute this command.
sudo bash -c "$(curl -sSfL https://install.domoticz.com)"
You will get an install dialog and some questions will be asked about HTTP/HTTPS enablement for WebUI and the related ports.
For extra options and instructions see the Installation on Linux page but in general the installation is finished.
Just point your browser to the IP address of your Raspberry Pi, and use the port specified during the installation script.
For example: http://192.168.0.10:8080
.
2023.1 Stable: By default Domoticz is now protected by a username (admin) and password (domoticz).
Now you can go on and visit the Getting started documentation area for more information.
The Docker container way
You can also install Domoticz as a Docker container. Go to wiki page Docker for the instructions
The "not so easy" way (Compiling from Source)
The other way to get Domoticz up and running is, to build it by yourself. You can find a detailed guide here.
Updating Domoticz
Use the Web Interface to update Domoticz (Menu Setup->Check for Updates) and accept the update proposal if available.
In menu Setup - Settings you can set your preference to automatically check for available updates (yes or no and beta or stable channel).
For Domoticz in Docker container check the docker hub update instructions: https://hub.docker.com/r/domoticz/domoticz
If this update through web interface fails for any reason (e.g. partial download giving segmentation fault) then you should manually update by:
Stable:
cd domoticz sudo ./updaterelease
Beta:
cd domoticz sudo ./updatebeta
Revert to backup after incorrect update
For updates (beta and stable) an automatic backup of the complete domoticz environment including scripts and plugins is created in domoticz/backups/domoticz_backup_yyyymmdd_hhmmss.tar.gz
by the update script.
To extract that backup:
- enter domoticz backup directory (where domoticz store a backup before upgrading)
cd ~pi/domoticz/backups
- run tar command to extract the backup (specify the right filename and correct domoticz folder)
tar xvzf domoticz_backup_yyyymmdd_hhmms.tar.gz -C /home/pi/domoticz
- restart domoticz
service domoticz restart
Raspberry Pi additional software installations
After the successful installation of Domoticz there are several other useful guides to follow:
- Persistent USB Devices (needed for USB dongles like RFXCOM and Z-Wave)
- Monitoring Domoticz (monit watchdog)
- Moving Log and Temporary Files To a RAM Drive
- Setup Raspberry Pi Watchdog
For remote connections:
- Installing a PPTP-VPN server on a Raspberry Pi
- Secure Remote Access
- Setup Fail2Ban (external IP ban)
Please follow at least Persistent USB Devices.
There are numerous forum posts from new users that can not connect to their RFXCOM or Z-Wave stick after a reboot.
By following the guide above this problem cannot happen anymore.
Uninstalling Domoticz
To uninstall Domoticz execute the following steps:
service domoticz stop
- remove the domoticz folder with binary and all subdirs
- remove folder /etc/domoticz
- remove file /etc/init.d/domoticz.sh
Z-Wave
It is highly recommended to use a USB Z-Wave controller (Z-Wave Plus)
The reason for this is that it is very portable and you can use it under Windows/Linux systems (that includes a Raspberry Pi)
Supported OpenZWave controllers
Domoticz Z-Wave documentation
Raspberry Pi General Purpose Input/Output (GPIO)
The Raspberry Pi 1 Model A and B boards have a 26-pin expansion header
The Raspberry Pi 1 Model A+ and B+ boards, and the Pi 2/ 3, have a 40-pin expansion header
Support for the standard GPIO is available in Domoticz from release 1726 and onwards.
Domoticz GPIO installation instruction
Raspberry Pi GPIO Domoticz forum thread
PiFace Digital
PiFace Digital is designed to plug on to the GPIO of your Raspberry Pi. With PiFace Digital you can detect the state of a switch, for example from a door sensor, a pressure pad or any number of other switch types. You can drive outputs to power motors, actuators, LEDs or anything you can imagine. PiFace Digital has eight digital inputs, eight open-collector outputs, eight LED indicators, two changeover relays and four switches.
The Piface Digital board is compatible with Raspberry Pi 2 Model B, Raspberry Pi Model B and A (26 pin connector)
The PiFace Digital 2 board is compatible with Raspberry Pi 2 Model B, Raspberry Pi Model B+ and A+ (40 pin connector)
Support for the PiFace Digital is available in Domoticz release 1045 and onwards.
Domoticz PiFace Digital installation instruction
PiFace Digital Domoticz forum thread
Pi-mote
The Pi-mote control board is is a low cost and a simple wireless controller, dedicated to the Raspberry Pi computer, and Energenie ENER002 RF controlled mains sockets. It is an extremely simple, transmit only, open loop system controlled by six GPIO pins in "out" mode on the Raspberry Pi. It plugs directly into a Raspberry Pi computer, and is powered from the Pi.
Pi-Mote Pi-mote installation instruction
Buyer's Guide
Following are some tips to configure and arrange your system. These are just suggestions, feel free to choose your shop and the final product.
Recommended
- Raspberry Pi 3 Model B
Click on the pictures to get product info and buy the product.
- 2,5A/5V Power Supply
- microSD card 16GB Class 10
Minimal
- Raspberry Pi Zero W
- 1,5A/5V Power Supply
- microSD card 4GB Class 10
Links
Raspberry Pi Foundation website
Raspberry Pi GPIO details
PiFace Digital website
RaZberry website
Pi-mote website