Cześć
Na forum OH jest świetny temat opisujący proces instalacji i konfiguracji Docker-a i Portainer-a do obsługi
- Portainer środowisko graficzne do konfiguracji Dockera
- influxDB baza danych dla OH
- Duplicati kopia zapasowa
- Frontail viewer logów
- Mosquitto MQTT
- Samba - samba 😉
- wmbusmeters chyba zdalny odczyt wodomierzy itp. - ja to usunąłem bo nie potrzebuję
Dokładny opis jest tutaj:
Poniżej jest mój stack-definition code , który dodatkowo zawiera bramkę BT oraz ma usunięty wmbusmeters . Resztę robiłem wg. opisu z w/w linku.
U mnie całość działa na Rpi 4 4GB. Pytajcie może coś podpowiem 😉
version: '3.8' services: openhab: image: openhab/openhab:latest container_name: openhab depends_on: - influxdb - mosquitto restart: always privileged: true volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" - data_openhab_conf:/openhab/conf - data_openhab_addons:/openhab/addons - data_openhab_userdata:/openhab/userdata environment: TZ: ${TZ} OPENHAB_HTTP_PORT: ${OPENHAB_HTTP_PORT} OPENHAB_HTTPS_PORT: ${OPENHAB_HTTPS_PORT} CRYPTO_POLICY: "unlimited" EXTRA_JAVA_OPTS: "-Duser.timezone=${TZ}" USER_ID: 999 GROUP_ID: 994 # Test to run openHAB with German number format # Can be tested by entering "locale" after "docker exec -t -i openhab /bin/bash" LANG: uk_UK.UTF-8 LANGUAGE: uk_UK.UTF-8 LC_ALL: uk_UK.UTF-8 devices: - /dev/ttyACM0:/dev/ttyACM0 network_mode: host mosquitto: image: eclipse-mosquitto:latest container_name: mosquitto restart: always volumes: - data_mosquitto_config:/mosquitto/config - data_mosquitto_data:/mosquitto/data - data_mosquitto_log:/mosquitto/log ports: - ${MOSQUITTO_MQTT_PORT}:1883 - ${MOSQUITTO_MQTTS_PORT}:8883 environment: TZ: ${TZ} networks: app-nw: aliases: - mqtt influxdb: image: influxdb:1.8 container_name: influxdb restart: always volumes: - data_influxdb:/var/lib/influxdb - data_influxdb_config:/etc/influxdb ports: - ${INFLUXDB_DB_PORT}:8086 environment: - INFLUXDB_DATA_ENGINE=tsm1 - INFLUXDB_REPORTING_DISABLED=false - INFLUXDB_ADMIN_USER=${INFLUXDB_ADMIN_USER} - INFLUXDB_ADMIN_PASSWORD=${INFLUXDB_ADMIN_PASSWORD} - INFLUXDB_USER=${INFLUXDB_USER} - INFLUXDB_USER_PASSWORD=${INFLUXDB_USER_PASSWORD} - INFLUXDB_READ_USER=${INFLUXDB_READ_USER} - INFLUXDB_READ_USER_PASSWORD=${INFLUXDB_READ_USER_PASSWORD} - INFLUXDB_DB=${INFLUXDB_OPENHAB_DB} - TZ=${TZ} networks: app-nw: backend-nw: aliases: - db duplicati: image: duplicati/duplicati container_name: duplicati environment: - PUID=0 - PGID=0 - TZ=Europe/Warsaw - CLI_ARGS= #optional volumes: - /var/lib/docker/volumes/duplicati_config/_data:/config - /var/lib/docker/volumes/duplicati_backups/_data:/backups - /var/lib/docker/volumes/duplicati_source/_data:/source - /var/lib/docker/volumes/openhab_data_openhab_conf:/source/openhab_conf - /var/lib/docker/volumes/openhab_data_openhab_addons:/source/openhab_addons - /var/lib/docker/volumes/openhab_data_openhab_userdata:/source/openhab_userdata - /var/lib/docker/volumes/openhab_data_mosquitto_config:/source/mosquitto_config - /var/lib/docker/volumes/openhab_data_mosquitto_data:/source/mosquitto_data - /var/lib/docker/volumes/openhab_data_mosquitto_log:/source/mosquitto_log - /var/lib/docker/volumes/openhab_data_influxdb:/source/influxdb - /var/lib/docker/volumes/openhab_data_influxdb_config:/source/influxdb_config - /var/lib/docker/volumes/openhab_data_wmbusmeters_data:/source/wmbusmeters_data ports: - 8200:8200 restart: unless-stopped frontail: image: welteki/frontail-openhab:latest container_name: frontail restart: always ports: - "9001:9001" volumes: - /var/lib/docker/volumes/openhab_data_openhab_userdata/_data:/openhab/userdata:ro \ theengsgateway: image: maretodoric/theengsgateway-arm-v7:latest network_mode: host environment: MQTT_HOST: <host> MQTT_USERNAME: <user> MQTT_PASSWORD: <password> MQTT_PUB_TOPIC: home/TheengsGateway/BTtoMQTT MQTT_SUB_TOPIC: home/TheengsGateway/commands PUBLISH_ALL: true TIME_BETWEEN: 60 SCAN_TIME: 60 LOG_LEVEL: DEBUG DISCOVERY_TOPIC: homeassistant/sensor DISCOVERY_DEVICE_NAME: TheengsGateway DISCOVERY_FILTER: "[IBEACON,GAEN,MS-CDP]" SCANNING_MODE: active ADAPTER: hci0 volumes: - /var/run/dbus:/var/run/dbus samba: image: dperson/samba container_name: samba restart: always ports: - "137:137/udp" - "138:138/udp" - "139:139/tcp" - "445:445/tcp" healthcheck: disable: true environment: - TZ='Europe/Warsaw' - PUID=9001 - PGID=9001 - WORKGROUP=workgroup - PERMISSIONS=true - RECYCLE=false - USER1=pi;raspberry; - SHARE1=openhab_conf;/shares/openhab_conf;yes;no;yes; - SHARE2=openhab_addons;/shares/openhab_addons;yes;no;yes; - SHARE3=openhab_userdata;/shares/openhab_userdata;yes;no;yes; - SHARE4=mosquitto_config;/shares/mosquitto_config;yes;no;yes; - SHARE5=mosquitto_log;/shares/mosquitto_log;yes;no;yes; - SHARE6=theengsgateway_data;/shares/theengsgateway_data;yes;no;yes; - SHARE7=influxdb;/shares/influxdb;yes;no;yes; - SHARE8=docker;/shares/docker;yes;no;yes; - SHARE9=log;/shares/log;yes;no;yes; volumes: - data_openhab_conf:/shares/openhab_conf - data_openhab_addons:/shares/openhab_addons - data_openhab_userdata:/shares/openhab_userdata - data_mosquitto_config:/shares/mosquitto_config - data_mosquitto_log:/shares/mosquitto_log - data_theengsgateway_data:/shares/theengsgateway_data - data_influxdb:/shares/influxdb - /docker:/shares/docker - /var/log:/shares/log chronograf: image: chronograf:latest container_name: chronograf restart: always ports: - '8888:8888' volumes: - /var/lib/docker/volumes/openhab_data_influxdb/_data:/influxdb environment: - INFLUXDB_URL= http://db:8086 - INFLUXDB_USERNAME=$INFLUXDB_USER - INFLUXDB_PASSWORD=$INFLUXDB_USER_PASSWORD networks: app-nw: backend-nw: volumes: data_openhab_conf: data_openhab_addons: data_openhab_userdata: data_mosquitto_config: data_mosquitto_data: data_mosquitto_log: data_influxdb: data_influxdb_config: data_theengsgateway_data: networks: app-nw: internal: false driver: bridge driver_opts: com.docker.network.bridge.name: app-${PROJECT_NAME} backend-nw: internal: true driver: bridge driver_opts: com.docker.network.bridge.name: be-${PROJECT_NAME}
Nie mogę edytować powyższego postu - nie wiem dlaczego a zapomniałem dodać linka do tej bramki BT:
Jest to "odpowiednik" openmqttgateway z ESP32 działający bezpośrednio na rpi . Na rpi4 ( i pewnie na rpi3) nie wymaga dodatkowego sprzętu, działa na wbudowanym BT.
influxDB baza danych dla OH
Nie chcę być malkontentem, ale uruchamianie influxdb na raspberry, które zazwyczaj działa na karcie SD jest proszeniem się o problemy. Upewnijcie się że "duplicati" i backupy działają jak należy lub zaopatrzcie się w komputer z dyskiem ssd (lub stosowną przystawką dla RPI)!