Skip to content

Commit

Permalink
utilize automatic script detection for second inverter in json module
Browse files Browse the repository at this point in the history
  • Loading branch information
yankee42 committed Sep 26, 2022
1 parent 7b5de2f commit 2626dd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
32 changes: 0 additions & 32 deletions modules/wr2_json/main.sh

This file was deleted.

15 changes: 9 additions & 6 deletions modules/wr_json/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ else
MYLOGFILE="${RAMDISKDIR}/nurpv.log"
fi

inverter_num=${1:-1}
[[ "$inverter_num" -gt 1 ]] && config_prefix="wr$1" || config_prefix="wr"
declare -n "config_url=${config_prefix}jsonurl"
declare -n "config_watt=${config_prefix}jsonwatt"
declare -n "config_kwh=${config_prefix}jsonkwh"

openwbDebugLog ${DMOD} 2 "PV URL : ${config_url}"
openwbDebugLog ${DMOD} 2 "PV Watt: ${config_watt}"
openwbDebugLog ${DMOD} 2 "PV kWh : ${config_kwh}"


openwbDebugLog ${DMOD} 2 "PV URL : ${wrjsonurl}"
openwbDebugLog ${DMOD} 2 "PV Watt: ${wrjsonwatt}"
openwbDebugLog ${DMOD} 2 "PV kWh : ${wrjsonkwh}"

bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.json.device" "inverter" "${wrjsonurl}" "${wrjsonwatt}" "${wrjsonkwh}" "1" >>$MYLOGFILE 2>&1
bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.json.device" "inverter" "$config_url" "$config_watt" "$config_kwh" "$inverter_num" >>$MYLOGFILE 2>&1
ret=$?

openwbDebugLog ${DMOD} 2 "RET: ${ret}"
Expand Down

0 comments on commit 2626dd6

Please sign in to comment.