Files
casa/README.md
2024-12-29 21:49:33 +00:00

6.4 KiB

homesrv01.dev.lan

Welcome to homesrv01.dev.lan git page.

This repository serves to document and maintain the server where the home assistant runs.

The goal was to create a server with docker where it would be possible to isolate, services and communications related to home automation at network level.

The server itself is on its own vlan (Vlan: homesrv) but requires communication with the others Vlans:

  • IOT

Table of Contents

Services

myInfra stack

docker, Portainer, promtail and telegraf maintained on myInfra repo.

SSH

Deployed and maintained by ansible role myInfra.dev.homesrv1.

nginx

Docker Compose

All sites configurations set during docker build.

Home Assistant

Git Repo

Lyrion Music Server (LMS)

Check git repo for more information how to setup Lyrion Music Server docker container. Or git repo for more information about home assistant integration.

Requires docker plugin rclone and s3 bucket volume.

Mosquitto

Git Repo

Wyoming

A peer-to-peer protocol for voice assistants (basically JSONL + PCM audio)

{ "type": "...", "data": { ... }, "data_length": ..., "payload_length": ... }
<data_length bytes (optional)>
<payload_length bytes (optional)>

Used in Rhasspy and Home Assistant for communication with voice services.

This is an open standard of the Open Home Foundation.

For more information about home assistant integration check home assistant repo.

docker compose file.

Links:

Zigbee2mqtt

Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridges

SONOFF Universal Zigbee 3.0 USB Dongle Plus attached on proxmox host.

Patch security on proxmox host. (usb passthrough to lxc container)

#on proxmox hosting server
chown 100000:100020 /dev/ttyUSB0
chown 100000:100020 /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0

docker compose

Links

Proxmox - lxc container

Currently hosted on a proxmox ubuntu container.

#   cat /etc/pve/lxc/105.conf
arch: amd64
cmode: shell
cores: 2
features: fuse=1,keyctl=1,nesting=1
hostname: homesrv01
memory: 1500
net0: name=eth0,bridge=vmbr0,firewall=1,ip6=dhcp,...,type=veth
onboot: 1
ostype: ubuntu
protection: 1
rootfs: local-lvm:vm-105-disk-0,size=32G
swap: 1500
unprivileged: 1
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 none bind,optional,create=file
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file

lxc.cgroup2.devices.allow and lxc.mount.entry identification

# identify usb pen
lsusb 

# example 
# Bus 001 Device 008: ID 10c4:ea60 Silicon Labs CP210x UART Bridge


#replace with bus and device id
ls -l /dev/bus/usb/001/008

#example result
# crw-rw-r-- 1 root root 189, 7 May 17 15:56 /dev/bus/usb/001/008

# so

#lxc.cgroup2.devices.allow: c 189:* rwm
#lxc.mount.entry: usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 none bind,optional,create=file

ls -l /dev/serial/by-id/
# example result
#lrwxrwxrwx 1 root root 13 May 17 15:56 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 -> ../../ttyUSB0

ls -l /dev/ttyUSB0
#example result
#crw-rw---- 1 root dialout 188, 0 May 17 15:56 /dev/ttyUSB0

#so

#lxc.cgroup2.devices.allow: c 188:* rwm
#lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file

Operating System

# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

# uname -r
6.8.4-3-pve

Development, Maintenance and Deployment

Using visual studio code, docker, ansible and gitea actions.

Docker context

# create context to homesrv01 docker on development devices
docker context create homesrv01 --docker host=ssh://admin@homesrv01.dev.lan
# check auto update scripts logs
journalctl -r -t auto-update

docker

rclone plugin

https://rclone.org/docker/

sudo apt-get -y install fuse
sudo mkdir -p /var/lib/docker-plugins/rclone/config
sudo mkdir -p /var/lib/docker-plugins/rclone/cache

cat <<EOF >/var/lib/docker-plugins/rclone/config/rclone.conf
[s3-hot-storage]
type = s3
provider = Minio
access_key_id = ???
secret_access_key = ????
endpoint = https://????
EOF


docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions
docker plugin list