curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
cgroup_enable=memory cgroup_memory=1apt install dbus-broker systemctl enable dbus-broker.service --now systemctl disable dbus.service
http://<host>:8123pi@harpi:~ $ cat /home/pi/homeassistant/homeassistant.service [Unit] Description=Home Assistant Container After=docker.service Requires=docker.service [Service] Restart=always ExecStart=/usr/bin/docker run \ --rm \ --name homeassistant \ -e TZ=Europe/Prague \ -v /home/pi/homeassistant/config:/config \ -v /run/dbus:/run/dbus:ro \ -p 8123:8123 \ --network my-net \ ghcr.io/home-assistant/raspberrypi4-64-homeassistant:stable ExecStop=/usr/bin/docker stop homeassistant [Install] WantedBy=multi-user.target
docker exec -it homeassistant /bin/bash
wget -O - https://get.hacs.xyz | bash -
Funguje správně?
2025-01-17 10:18:08.734 WARNING (MainThread) [bluetooth_auto_recovery.recover] Getting Bluetooth adapter failed hci0 [D8:3A:DD:96:0B:D9] because the system cannot create a bluetooth socket: Unable to open PF_BLUETOOTH socket 2025-01-17 10:18:08.735 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not find adapter with mac address D8:3A:DD:96:0B:D9 or hci0 2025-01-17 10:18:08.735 WARNING (MainThread) [bluetooth_auto_recovery.recover] Closing Bluetooth adapter hci0 [D8:3A:DD:96:0B:D9] failed: 'NoneType' object has no attribute 'detach'
docker exec -it homeassistant /bin/bash hciconfig Can't open HCI socket.: Address family not supported by protocol python3 -c "import socket; socket.socket(socket.AF_BLUETOOTH, socket.SOCK_RAW, socket.BTPROTO_HCI)"
docker exec -it homeassistant /bin/bash bluetoothctl list Unable to open mgmt_socket Controller D8:3A:DD:96:0B:D9 harpi [default]
proč to píše to „Unable to open mgmt_socket“?
funguje divně
bluetoothctl scan on
hci0 (D8:3A:DD:96:0B:D9): Error stopping scanner: [org.bluez.Error.Failed] No discovery started
mkdir -p /home/pi/mosquitto/config /home/pi/mosquitto/data /home/pi/mosquitto/log
vim /home/pi/mosquitto/config/mosquitto.conf persistence true persistence_location /mosquitto/data/ log_dest file /mosquitto/log/mosquitto.log listener 1883 allow_anonymous false password_file /mosquitto/config/passwordfile
docker run -it --rm -v /home/pi/mosquitto/config:/mosquitto/config eclipse-mosquitto mosquitto_passwd -c /mosquitto/config/passwordfile z2m
pi@harpi:~ $ cat mosquitto/mosquitto.service [Unit] Description=Mosquitto MQTT Broker Container After=docker.service Requires=docker.service [Service] Restart=always ExecStart=/usr/bin/docker run \ --rm \ --name mosquitto \ -v /home/pi/mosquitto/config:/mosquitto/config \ -v /home/pi/mosquitto/data:/mosquitto/data \ -v /home/pi/mosquitto/log:/mosquitto/log \ --network my-net \ eclipse-mosquitto ExecStop=/usr/bin/docker stop mosquitto [Install] WantedBy=multi-user.target
cat /home/pi/zigbee2mqtt/zigbee2mqtt.service [Unit] Description=Zigbee2MQTT Container After=docker.service Requires=docker.service [Service] Restart=always ExecStart=/usr/bin/docker run \ --rm \ --name zigbee2mqtt \ --device=/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230221110549-if00:/dev/ttyACM0 \ -v /home/pi/zigbee2mqtt/data:/app/data \ -v /run/udev:/run/udev:ro \ -e TZ=Europe/Prague \ -p 8080:8080 \ --network my-net \ koenkk/zigbee2mqtt ExecStop=/usr/bin/docker stop zigbee2mqtt [Install] WantedBy=multi-user.target
configuration.yaml
serial: port: /dev/ttyACM0 adapter: ember baudrate: 230400
user: a password:mkdir -p unifi/db mkdir -p unifi/data mkdir -p unifi/db-init
vim unifi/db-init/init-mongo.js
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "YOUR_PASSWORD", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "YOUR_PASSWORD", roles: [{role: "dbOwner", db: "unifi_stat"}]});
vim unifi/container-vars.env PUID=1000 PGID=1000 MONGO_USER=unifi MONGO_PASS=YOUR_PASSWORD MONGO_HOST=unify-mongodb MONGO_PORT=27017 MONGO_DBNAME=unifi
vim unifi/docker-compose.yml
docker network create my-net
docker network ls