519b6ef703
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 7m23s
- Implementato array parsing per INVERTER_DEVICES (separatore ':') - Refactoring mqtt-push.sh con funzione process_inverter() - Topic MQTT separati per ogni inverter (voltronic, voltronic2, voltronic3, ecc.) - Aggiornate tutte le 33 metriche con devicename dinamico - Fix parsing JSON con filtro grep per messaggi [POLL] - Documentazione ENV variable INVERTER_DEVICES in docker-compose.yml Esempio configurazione: INVERTER_DEVICES=/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2
74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
services:
|
|
voltronic-mqtt:
|
|
# Build locale per test
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.multiarch
|
|
|
|
# Immagine custom da Gitea registry (decommentare quando pronta)
|
|
# image: gitea.home-nas-ds.org/alessio/docker-voltronic-homeassistant:latest
|
|
|
|
container_name: voltronic-mqtt
|
|
|
|
privileged: true
|
|
restart: always
|
|
|
|
# Environment variables - configurano automaticamente mqtt.json e inverter.conf
|
|
environment:
|
|
# Device configuration
|
|
- INVERTER_DEVICE=/dev/ttyUSB0
|
|
|
|
# Multi-inverter support: separare device con ':'
|
|
# Esempio: INVERTER_DEVICES=/dev/ttyUSB0:/dev/ttyUSB1
|
|
# Se non specificato, usa INVERTER_DEVICE sopra
|
|
# - INVERTER_DEVICES=/dev/ttyUSB0:/dev/ttyUSB1
|
|
|
|
# MQTT Broker configuration (questi valori sovrascrivono mqtt.json all'avvio)
|
|
- MQTT_SERVER=192.168.1.37
|
|
- MQTT_PORT=1883
|
|
- MQTT_TOPIC=homeassistant
|
|
- MQTT_DEVICENAME=voltronic
|
|
- MQTT_USERNAME=mqtt_user
|
|
- MQTT_PASSWORD=3tUhCpuDs43e#@k
|
|
|
|
# Auto-discovery options
|
|
# Force auto-discovery on every container start (default: false)
|
|
# Set to "true" to re-run discovery even if previous results exist
|
|
- FORCE_DISCOVERY=false
|
|
|
|
# Skip auto-discovery completely (default: false)
|
|
# Set to "true" to use only values from inverter.conf
|
|
- SKIP_DISCOVERY=false
|
|
|
|
volumes:
|
|
# Configurazione persistente (buffer sizes, calibration factors)
|
|
- ./config/:/etc/inverter/
|
|
|
|
# Cache discovery per evitare re-discovery ad ogni restart
|
|
- voltronic-cache:/cache/
|
|
|
|
devices:
|
|
# USB Port Mapping
|
|
- /dev/bus/usb:/dev/bus/usb:rwm
|
|
- /dev/ttyUSB0:/dev/ttyUSB0:rwm
|
|
- /dev/ttyUSB1:/dev/ttyUSB1:rwm
|
|
|
|
# Serial Port Mapping (optional, se usi RS232 nativo)
|
|
- /dev/ttyS0:/dev/ttyS0
|
|
- /dev/ttyS1:/dev/ttyS1
|
|
- /dev/ttyS2:/dev/ttyS2
|
|
|
|
# Used to auto-update images as we release new versions...
|
|
# watchtower:
|
|
# image: containrrr/watchtower
|
|
# container_name: watchtower
|
|
# restart: always
|
|
# privileged: true
|
|
# volumes:
|
|
# - /var/run/docker.sock:/var/run/docker.sock
|
|
# command: --interval 500
|
|
|
|
volumes:
|
|
voltronic-cache:
|
|
|