Migliora discovery e pubblicazione MQTT per inverter in cascata
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 9m22s

This commit is contained in:
Pi Developer
2026-02-10 21:59:47 +01:00
parent 61567e3326
commit 9e72d4f5a7
6 changed files with 696 additions and 128 deletions
+15 -3
View File
@@ -236,7 +236,11 @@ fi
echo ""
echo "=== Starting MQTT Bridge Services ==="
echo "Using parallel inverter mode (2 inverters)"
if [ -n "$INVERTER_DEVICES" ]; then
echo "Using multi-device mode (INVERTER_DEVICES=${INVERTER_DEVICES})"
else
echo "Using parallel inverter mode (2 inverters)"
fi
echo ""
# Wait a bit for the device to be ready
@@ -267,7 +271,12 @@ echo "✓ MQTT discovery topics initialized"
# Init the mqtt server every 5 minutes (300 seconds)
# This will re-create the auto-created topics in the MQTT server if HA is restarted...
echo "Starting MQTT initialization service (every 5 minutes)..."
watch -n 300 "$MQTT_INIT_SCRIPT" > /dev/null 2>&1 &
(
while true; do
"$MQTT_INIT_SCRIPT" > /dev/null 2>&1
sleep 300
done
) &
# Run the MQTT Subscriber process in the background (so that way we can change the configuration on the inverter from home assistant)
echo "Starting MQTT subscriber for commands..."
@@ -280,4 +289,7 @@ echo "✓ All services started successfully!"
echo " Logs will appear below..."
echo ""
watch -n 30 "$MQTT_PUSH_SCRIPT" > /dev/null 2>&1
while true; do
"$MQTT_PUSH_SCRIPT" > /dev/null 2>&1
sleep 30
done