The stack contains everything to run FHEM on a Docker host. Mosquitto is used as message broker. SIRI functions are realized with the help of a homebridge container. The complete stack runs on x86 as well as arm architectures. It is very easy to clone its complete productive environment and has a simple way to build a test system.
- Todo
- Requirements
- Installation raspberrypi
- Container
- Configuring Raspbian for RaspBee
- ctop
- Known Issues
- Accessing the docker container via remote
- Contributing to fhemdocker
- Mosquitto user-/groupid problem
- Grafana integration
- docker
- docker-compose
Download the image of your choise: Raspian Download Unzip the image and install it with:
sudo dd bs=4M if=2021-10-30-raspios-bullseye-armhf-lite.img of=/dev/mmcblk0 conv=fsync
sync
Eject the card and insert it again to mount the filesystems boot & rootfs. Touch a blank file ssh to enable sshd daemon on first boot.
sudo touch /media/boot/ssh
sync
umount /media/boot
umount /medua/rootfs
Eject the card and insert into your raspberrpi. After that power on the rpi and login with the known user pi and password raspberry.
ssh pi@raspberrypi4
Change your password with the command
pi@raspberrypi:~ $ passwd
Changing password for pi.
Current password:
New password:
Retype new password:
passwd: password updated successfully
pi@raspberrypi:~ $
sudo apt-get update
sudo apt-get dist-upgrade
sudo dpkg-reconfigure tzdata
-
Expand the root filesystem (A1 / Advanced Options)
-
Update raspi-config
sudo raspi-config sudo reboot
sudo dphys-swapfile swapoff && \
sudo dphys-swapfile uninstall && \
sudo systemctl disable dphys-swapfile
sudo apt-get install wget git apt-transport-https vim telnet zsh zsh-autosuggestions zsh-syntax-highlighting ntp ksh logwatch
sudo vi /etc/ntp.conf
Disable all pool server and add your local time server
server 192.168.1.1
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
apt update
apt install log2ram
ssh-keygen -t rsa -b 8192
After installation put your user pi into the docker group.
curl -sSL https://get.docker.com | sh
sudo systemctl enable docker
sudo systemctl start docker
sudo apt-get install docker docker-compose
sudo usermod -aG docker pi
sudo reboot
Note: Please run the startup.sh script after cloning.
cd
git clone https://github.com/stormmurdoc/fhemdocker.git
cd fhemdocker
./startup.sh
FHEM tmux session inside the container
Further details about the influxdb module can be found here. FHEM Wiki influxdb
Default User: admin Default Passwort: admin
deCONZ Image Container Integration
Raspbian defaults Bluetooth to /dev/ttyAMA0 and configures a login shell over serial (tty). You must disable the tty login shell and enable the serial port hardware, and swap Bluetooth to /dev/S0, to allow RaspBee to work properly under Docker.
To disable the login shell over serial and enable the serial port hardware:
- sudo raspi-config
- Select Interfacing Options
- Select Serial
- “Would you like a login shell to be accessible over serial?” Select No
- “Would you like the serial port hardware to be enabled?” Select Yes
- Exit raspi-config and reboot To swap Bluetooth to /dev/S0 (moving RaspBee to /dev/ttyAMA0), run the following command and then reboot:
echo 'dtoverlay=miniuart-bt' | sudo tee -a /boot/config.txt
This will exchange the UART and the Mini-UART so the Mini-UART is connected to the bluetooth and the UART to the GPIO pins.
On Raspberry Pi 4 verify that file /boot/config.txt does NOT contain a line "enable_uart=0". If the line exists remove or comment (#) this line.
After running the above command and rebooting, RaspBee should be available at /dev/ttyAMA0.
This container automatically update all running container within a given time interval.
https://containrrr.github.io/watchtower/
ctop is a commandline monitoring tool for linux containers
ctop is available in AUR, so you can install it using AUR helpers, such as YaY, in Arch Linux and its variants such as Antergos and Manjaro Linux.
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.5/ctop-0.7.5-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.5/ctop-0.7.5-linux-arm -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
If you're not able to login. Please check the permissons of the .htpasswd file in
./fhemdocker/reverseproxy/config/.htpasswd
Set the right to 644 with
chmod 644 ./fhemdocker/reverseproxy/config/.htpasswd
If you want to commit a FHEM command via the local telnet daemon you can use the script fcmd.sh. Note: Please change the hostname accordingly.
Username: pi
Hostname: raspberrypi4 (replace it with your hostname)
fcmd.sh <FHEM Command>
Contributions are encouraged and welcome!