My home server setup for home monitoring and non-cloud apps.
- Temperature and humidity monitoring
- Bitwarden password manager
- Raspberry Pi 4 Model B - 4 GB RAM
- 3 x ESP8266 NodeMCU
- Sensors
- 1 x DHT21 (Humidity Temperature Sensor)
- 3 x BME280 (Barometric Sensor)
- Enable SSH on a headless Raspberry Pi
- Add WIFI configuration
Mount sd-card and putwpa_supplicant.conf
intoboot
folderctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US network={ ssid="<wifi_ssid>" psk="<wifi_password>" }
- Add pre-config for dhcp within rootfs
(On macOS you can mount it with ext4fuse; https://piratefache.ch/mount-raspberry-pi-sd-card-on-mac-os/)
/etc/dhcpcd.conf
interface eth0 # or 'wlan0' or any other interface static ip_address=192.168.1.2/24 # static ip6_address=:::::/64 static routers=192.168.1.1 static domain_name_servers=8.8.8.8 1.1.1.1 192.168.1.1
- Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker Pi sudo apt-get -y install libffi-dev libssl-dev python3-dev python3 python3-pip sudo pip3 -v install docker-compose
- Insert the sd-card and boot up
- Login via ssh
- copy the config to the raspberry pi
- Create config folders (if config folders are changed, update
docker-compose.yaml
)mkdir /opt/homeassistant/config mkdir /opt/homeassistant/config mkdir /opt/mosquitto/config mkdir /opt/mosquitto/data mkdir /opt/mosquitto/log mkdir /opt/bitwarden/data mkdir /opt/certs
- Run
docker-compose up -d
in folderhome-assistant
- Add mosquitto password file
mosquitto_passwd
(TODO add detailed description) - Run the python script for raspberry sensors every 5 minutes.
- TODO; detailed
pip install
/dependency instructions - Add script to crontab
crontab -e */5 * * * * /.../send_data_raspberry_and_dht21.py
Setup inspired by home-assistant sample.
The 3 ESP8266 have each a BME280 sensor connected and are configured for MQTT auto-detection with home-assistant.
- Install Arduino IDE
- Adapt
esp8366.ino
- Write
esp8366.ino
to the controller - Plugin the controller
- Go to bitwarden folder
- Run
docker-compose up -d
- Detailed mosquitto and home assistant auto detection setup
- python script dependency installation
- ssl/tls config description
- nginx proxy