feat: Replicazione parametri comuni QPIRI su tutti gli inverter
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 7m36s
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 7m36s
- Parametri configurazione (QPIRI) ora pubblicati per inv1_* e inv2_* - Separata pubblicazione runtime (QPGS) da configurazione (QPIRI) - QPIRI letto una volta e replicato su tutti gli inverter - 17 parametri runtime per inverter + 9 parametri config condivisi - Total: 26 parametri per inverter (17 runtime + 9 config) Parametri comuni replicati su entrambi gli inverter: - Battery_recharge_voltage - Battery_under_voltage - Battery_bulk_voltage - Battery_float_voltage - Max_charge_current - Max_grid_charge_current - Out_source_priority - Charger_source_priority - Battery_redischarge_voltage
This commit is contained in:
@@ -244,8 +244,10 @@ echo ""
|
|||||||
echo "Getting shared configuration (QPIRI)..."
|
echo "Getting shared configuration (QPIRI)..."
|
||||||
QPIRI_RAW=`$SUDO_CMD "$INVERTER_BIN" -r "QPIRI" 2>&1 | grep "Reply:" | cut -d: -f2- | xargs`
|
QPIRI_RAW=`$SUDO_CMD "$INVERTER_BIN" -r "QPIRI" 2>&1 | grep "Reply:" | cut -d: -f2- | xargs`
|
||||||
|
|
||||||
|
QPIRI_SUCCESS=false
|
||||||
if [ ! -z "$QPIRI_RAW" ] && [ "$QPIRI_RAW" != "NAK" ]; then
|
if [ ! -z "$QPIRI_RAW" ] && [ "$QPIRI_RAW" != "NAK" ]; then
|
||||||
echo "✓ QPIRI retrieved successfully"
|
echo "✓ QPIRI retrieved successfully"
|
||||||
|
QPIRI_SUCCESS=true
|
||||||
# Parse QPIRI: Grid rating, Grid rating, AC output rating, AC output frequency,
|
# Parse QPIRI: Grid rating, Grid rating, AC output rating, AC output frequency,
|
||||||
# AC output current, AC output apparent power, AC output active power,
|
# AC output current, AC output apparent power, AC output active power,
|
||||||
# Battery rating, Battery recharge, Battery under, Battery bulk, Battery float,
|
# Battery rating, Battery recharge, Battery under, Battery bulk, Battery float,
|
||||||
@@ -330,7 +332,23 @@ for i in $(seq 1 $PARALLEL_COUNT); do
|
|||||||
pushMQTTData "$i" "AC_charge_on" "$AC_CHG_ON"
|
pushMQTTData "$i" "AC_charge_on" "$AC_CHG_ON"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Configuration data from QPIRI (shared, 8 parameters)
|
echo " ✓ Published 17 runtime parameters for inverter #$i"
|
||||||
|
echo " (QPGS data + calculated PV_watts + status flags)"
|
||||||
|
echo " ⚠ Missing 5 params: PV_watthour, Load_watthour, Bus_voltage, Heatsink_temp, Warnings"
|
||||||
|
|
||||||
|
else
|
||||||
|
echo " ✗ QPGS$QPGS_IDX failed (NAK or empty)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Publish shared configuration parameters for ALL inverters (replicate QPIRI data)
|
||||||
|
if [ "$QPIRI_SUCCESS" = true ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Publishing shared configuration to all inverters..."
|
||||||
|
|
||||||
|
for i in $(seq 1 $PARALLEL_COUNT); do
|
||||||
|
echo " Replicating QPIRI config to inverter #$i..."
|
||||||
|
|
||||||
[ ! -z "$BATT_RECHARGE" ] && pushMQTTData "$i" "Battery_recharge_voltage" "$BATT_RECHARGE"
|
[ ! -z "$BATT_RECHARGE" ] && pushMQTTData "$i" "Battery_recharge_voltage" "$BATT_RECHARGE"
|
||||||
[ ! -z "$BATT_UNDER" ] && pushMQTTData "$i" "Battery_under_voltage" "$BATT_UNDER"
|
[ ! -z "$BATT_UNDER" ] && pushMQTTData "$i" "Battery_under_voltage" "$BATT_UNDER"
|
||||||
[ ! -z "$BATT_BULK" ] && pushMQTTData "$i" "Battery_bulk_voltage" "$BATT_BULK"
|
[ ! -z "$BATT_BULK" ] && pushMQTTData "$i" "Battery_bulk_voltage" "$BATT_BULK"
|
||||||
@@ -341,14 +359,9 @@ for i in $(seq 1 $PARALLEL_COUNT); do
|
|||||||
[ ! -z "$CHARGER_SOURCE_PRIORITY" ] && pushMQTTData "$i" "Charger_source_priority" "$CHARGER_SOURCE_PRIORITY"
|
[ ! -z "$CHARGER_SOURCE_PRIORITY" ] && pushMQTTData "$i" "Charger_source_priority" "$CHARGER_SOURCE_PRIORITY"
|
||||||
[ ! -z "$BATT_REDISCHARGE" ] && pushMQTTData "$i" "Battery_redischarge_voltage" "$BATT_REDISCHARGE"
|
[ ! -z "$BATT_REDISCHARGE" ] && pushMQTTData "$i" "Battery_redischarge_voltage" "$BATT_REDISCHARGE"
|
||||||
|
|
||||||
echo " ✓ Published 28 parameters for inverter #$i"
|
echo " ✓ Published 9 shared config parameters to inv$i"
|
||||||
echo " (19 runtime + 8 config + 1 calculated)"
|
|
||||||
echo " ⚠ Missing 5 params: PV_watthour, Load_watthour, Bus_voltage, Heatsink_temp, Warnings"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo " ✗ QPGS$QPGS_IDX failed (NAK or empty)"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Fallback: use standard mode with full JSON output
|
# Fallback: use standard mode with full JSON output
|
||||||
if [ "$PARALLEL_SUCCESS" = false ]; then
|
if [ "$PARALLEL_SUCCESS" = false ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user