From 4d5ed5d84536d277df90b382433d1d093a21899b Mon Sep 17 00:00:00 2001 From: Pi Developer Date: Sun, 22 Feb 2026 14:20:30 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20Corregge=20calcolo=20PV=5Fin=5Fwatts=20i?= =?UTF-8?q?n=20modalit=C3=A0=20QPGS=20parallela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DATA[25] ('PV Input Current') nei reply QPGS è in realtà la corrente in uscita dal SCC (Solar Charge Controller) verso la batteria, a tensione batteria - NON la corrente ai pannelli PV a tensione PV. Bug: PV_WATTS = DATA[14] (PV voltage ~246V) * DATA[25] (SCC current ~55A) → valore ~4-5x troppo alto (es. 246.8 * 55 = 13574W per inverter) Fix: PV_WATTS = DATA[11] (battery voltage ~54V) * DATA[25] (SCC current) → valore corretto (es. 53.9 * 55 = 2964W per inverter) Identico al comportamento di QPIGS in main.cpp: pv_input_watts = scc_voltage * pv_input_current con commento: 'input current is going to battery at battery voltage (NOT at PV voltage)' --- sources/inverter-mqtt/mqtt-push-parallel.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sources/inverter-mqtt/mqtt-push-parallel.sh b/sources/inverter-mqtt/mqtt-push-parallel.sh index 16a14c9..0dd0ab9 100755 --- a/sources/inverter-mqtt/mqtt-push-parallel.sh +++ b/sources/inverter-mqtt/mqtt-push-parallel.sh @@ -514,9 +514,13 @@ for idx in "${!VALID_SERIALS[@]}"; do [ "${DATA[14]}" ] && pushMQTTData "$inv_id" "PV_in_voltage" "${DATA[14]}" [ "${DATA[25]}" ] && pushMQTTData "$inv_id" "PV_in_current" "${DATA[25]}" - # Calculate PV watts (V * A) - if [ ! -z "${DATA[14]}" ] && [ ! -z "${DATA[25]}" ]; then - PV_WATTS=`echo "${DATA[14]} ${DATA[25]}" | awk '{printf "%.1f", $1 * $2}'` + # Calculate PV watts using battery voltage (DATA[11]) * SCC output current (DATA[25]). + # NOTE: Like QPIGS, DATA[25] ("PV Input Current") is actually the current going to the + # battery FROM the solar charge controller at battery voltage (NOT at PV panel voltage). + # Using PV voltage (DATA[14]) here would give a value ~4-5x too high. + # This mirrors the QPIGS formula: pv_input_watts = scc_voltage * pv_input_current + if [ ! -z "${DATA[11]}" ] && [ ! -z "${DATA[25]}" ]; then + PV_WATTS=`echo "${DATA[11]} ${DATA[25]}" | awk '{printf "%.1f", $1 * $2}'` pushMQTTData "$inv_id" "PV_in_watts" "$PV_WATTS" fi