DIY Open Source Smart Home with a Raspberry Pi
Hi and thanks for your interest!
I have summarized the current status of my smart home in a video:
Video overview of the DIY open source smart home with a Raspberry Pi
Automated installation with the script
The script was made because of the need to offer more flexibility and customization options than a Hass.io installation.
A Hass.io image makes it easy for you, which is great, but simplicity usually comes with restrictions.
If you want to expand your system yourself without running another Raspberry Pi in parallel, this script will help.
First, necessary and useful programs and frameworks such as Docker, Python etc. are installed on the raw Raspbian OS.
Then NodeRED is installed natively (not as a Docker container). This brings some additional features and a simpler configuration without annoying workarounds.
In addition, Log2Ram (less SD card writing – longer life for SD cards), RTL_SDR software for e.g. 433Mhz sensors and rpiClone for simple backups can be installed directly.
Currently the script offers automated installation for the following programs – They come preconfigured and with some addons (your own extension is of course possible):
- NodeRED the following Nodes
- Essential programs, frameworks and libraries:
- Mosquitto MQTT
- ei23 App-Dashboard (nginx)
Selectable at initial installation
- SDR DVB-T Stick (433Mhz Receiver)
- Nextcloud (official)
As docker-compose templates included
- HomeAssistant-Supervised (Installation possible with
ei23 ha-supervised) -> not recommended / maintained
I myself do not use some of the programs. For example IOBroker, FHEM, HomeBridge or Openhab. So please don’t expect any answers from me on that..
Status November 2021
You want to build your own smart home?
Subscribe to the ei23-newsletter to get exclusive content like the installation script and stay up to date.
There a 3359 installations worldwide – The last successful installation on a new device was 25 hours ago
But even if you just want to set up a data storage cloud (Nextcloud) for your home, it is possible with it.
Amazon Partner Links
If you get to Amazon.de via this page, ei23.de receives a small commission on your purchase.
With this you can support the ei23 project, without the purchase becoming more expensive!
Directly to Amazon.com
Raspberry Pi & Equipment
- Raspberry Pi 4 – 2GB RAM
- Raspberry Pi 4 – 4GB RAM (some bits more)
- Raspberry Pi Power Supply
- Raspberry Pi 4 Armor Case
- SSD to USB 3.0 Adapter
- SSD Flash Disk (1TB)
- Cat.6 Ethernet Cable
Links for 433Mhz Sensors
- RTL-SDR Stick / DVB-T Stick (maybe cheaper from AliExpress)
- Radarsensor 433Mz (maybe cheaper from AliExpress or Ebay)
- (without Tutorial) Sonoff RF 433Mhz Bridge
Links for smart Devices
AliExpress Affiliate Links
[I get a small commission on your purchase, so you can support the project without it costing you more.]
- Browse on AliExpress
- Raspberry Pi 4 Armor Case
- SSD tp USB 3.0 Adapter
- 433Mhz Window Sensor (GS-WDS07)
- 433Mhz Wireless Rain Gauge
FAQ – Answers to frequently asked questions
>> Program XY does not work, how do I reset it without reinstalling?
Portainer is reset, for example, with the following command (this also works with all other programs except with the ei23 dashboard, Home Assistant, Mosquitto and NodeRED):
cd ei23-docker/; docker-compose stop portainer; docker-compose rm -f portainer; sudo rm -r volumes/portainer/; docker-compose up -d
For example, if NodeRED does not work, there is probably another problem. See “Which devices and operating systems are supported?”
>> Which devices and operating systems are supported?
Officially, I only test and develop for the Raspberry Pi 4 (2GB or more) with a fresh installed Raspberry Pi OS. It may also work on other systems, but I cannot offer any help for that. If the ei23 script has been installed on an existing installation on which you or an installation program has already installed other services and programs, problems can also arise that I cannot narrow down due to the almost infinite possibilities.
I do not offer any help or solutions for this either, because it is and will remain a DIY project and not a service with warranty claims.
>> I installed a program myself, now another one no longer works!
Maybe a double usage of network ports? Have a close look at the docker-compose.yml (in home/pi/ei23-docker).
Basically anything that is not installed via the script or a ei23 tutorial can cause problems (also there surely can be problems). DIY applies here!
>> I can’t find NodeRED and the software for the RTL-SDR DVB-T stick in Docker-Compose.yml or in the templates!
That’s right. NodeRED and the software for the RTL-SDR DVB-T stick are installed natively during the initial installation, it is not a Docker container. Not installing NodeRED is not an option with the ei23 script, as NodeRED should usually be used anyway. It’s just must have.
>> Can you also include program XY in the script?
Possibly, if there are no conflicts with other programs and I find the time, yes.
However, it is recommended not to have all programs running at the same time, although the script offers it. There will be almost no one who needs OpenHAB, IOBroker, FHEM and HomeAssistant at the same time and then the Pi won’t have such a hard time 😉
>> How do I change the passwords and usernames?
You can do that with the script. Just run bash ei23.sh.
>> Which weather stations and 433Mhz can I integrate with the RTL-SDR DVB stick?
You can find a list on the project page .
Most unencrypted 433Mhz devices should work.
>> Is the transmission over unencrypted 433Mhz secure? What is the range?
No, unencrypted 433Mhz should be used for temperature sensors, weather stations, or for contact sensors in uncritical areas and you should be aware that the neighbor can theoretically log or clone / falsify signals.
So: know your neighbor 😉
The big advantage are prices and the wide range of products.
The connection quality of 433Mhz devices, most of the time, is only slightly better than WiFi with 2.4Ghz.
Wifi, on the other hand, is usually encrypted, but requires more power (when operated on batteries) and its more expensive.
>> Where can I find the Home Assistant configuration files?
The folder with the configuration files and the Home Assistant database has the path:
If Home Assistant does not start correctly, for example because “automations.yml” is missing, you can create the file with the following command line command and restart Home Assistant.
sudo echo ""> /home/pi/ei23-docker/volumes/homeassistant/config/automations.yml; cd ei23-docker/; docker-compose restart homeassistant; cd ~
>> How do I integrate cameras into MotionEYE and which cameras work
At ispyconnect there is a list of cameras with the corresponding URL for the video stream. This URL must be inserted in MotionEYE.
If there is a URL to the video stream, the probability is very high that the camera can also be integrated into MotionEYE.
There are good instructions on how to do this on the net, but I’ll also make a video about it soon.
>> Why don’t you create an image, wouldn’t that be easier?
Easier yes, but the script has many advantages:
- An image download creates a much higher traffic on my server
- The script automatically installs the latest updates and you can set your own passwords directly (higher security)
- You can individually choose what should be installed.
- If I change something, I can make it available to everyone directly without having everyone to reinstall everything.
>> I cannot configure Nextcloud or it does not start!
See above (program XY does not work) and Nextcloud Pi Docs . If that’s not helpful, video is coming soon.
>> When is a video about voice control / Axel coming!
In short: I’m working on it.
The voice control runs locally without internet, but it has its limits compared to Alexa / Siri / Google
For example all commands have to be predefined. That means sentences like: “Turn on the living room light” must be entered in Rhasspy and then “Turn on the light in the living room” would still not be understood. This requires NLP (Natural Language Processing).
Another problem is that connecting a Bluetooth speaker to the Raspberry Pi means a lot of manual configuration in Linux and Rhasspy and that for most probably means a big “STOP, NO TRESPASSING” sign.
I’m definitely making a video, but I’d like to improve it and it takes time.
About the used software
Software on the Raspberry Pi:
- Node-RED – a fantastic visual programming tool(nodered.org)
- Grafana – to visualize data (grafana.com)
- Home Assistant – homeautomation software in addition to Node-RED (home-assistant.io)
- InfluxDB – specialised database for time based data (influxdata.com)
- Mosquitto – an MQTT broker, which is important for the data exchange between devices (mosquitto.org)
- PiVPN – easy install VPN (pivpn.io)
- PiHole – adblocker and DNS-Server (pi-hole.net)
- NextCloudPi – your own data storage service (NextCloudPi Docker Image)
Heating control software (Viessmann Heaters):
Software for DVB-T Stick and 433Mhz:
- VSCodium – text editor and IDE (VSCodium)
- Arduino IDE – IDE for firmware for ESP8266, ESP32 and Arduino
- PlatformIO – alternative IDE for firmware for ESP8266, ESP32 and Arduino, runs in VSCodium
- Firefox – Yes! Node-RED and Grafana are running in the browser and please use Firefox, not Chrome.
Software for Sockets:
- Tasmota Firmware: https://github.com/arendst/Tasmota
- Supported Devices: https://templates.blakadder.com/eu.html