diff --git a/plugins/solar/solarman_api_inverter b/plugins/solar/solarman_api_inverter index 9ac01493..4fa1d82a 100644 --- a/plugins/solar/solarman_api_inverter +++ b/plugins/solar/solarman_api_inverter @@ -63,9 +63,6 @@ export SLRM_DATA_REQUEST_BODY=$(jq --null-input --arg deviceSn "${SLRM_DEVICE_SN ## get panel data export SLRM_DATA=$(curl --silent --request POST --url "https://api.solarmanpv.com/device/v1.0/currentData?appId=${SLRM_APPID}&language=en&=" --header "Authorization: bearer ${SLRM_BEARER_TOKEN}" --header 'Content-Type: application/json' --data "${SLRM_DATA_REQUEST_BODY}") -# sometimes the api can not find the requested device, exit here -echo $SLRM_DATA | grep "device not found" && exit 1 - # wenn parameter = ... if [ "$1" = "autoconf" ]; then echo yes @@ -119,6 +116,9 @@ if [ "$1" = "config" ]; then exit 0 fi +# sometimes the api can not find the requested device, exit here +echo $SLRM_DATA | grep "device not found" && exit 1 + echo "multigraph production_total" echo total_inverter.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("Et_ge0"))|.value')" echo total_panel1.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("Et_ge1"))|.value')" diff --git a/plugins/solar/solarman_api_panels b/plugins/solar/solarman_api_panels index e3cec7f1..0f7303cd 100644 --- a/plugins/solar/solarman_api_panels +++ b/plugins/solar/solarman_api_panels @@ -63,9 +63,6 @@ export SLRM_DATA_REQUEST_BODY=$(jq --null-input --arg deviceSn "${SLRM_DEVICE_SN ## get panel data export SLRM_DATA=$(curl --silent --request POST --url "https://api.solarmanpv.com/device/v1.0/currentData?appId=${SLRM_APPID}&language=en&=" --header "Authorization: bearer ${SLRM_BEARER_TOKEN}" --header 'Content-Type: application/json' --data "${SLRM_DATA_REQUEST_BODY}") -# sometimes the api can not find the requested device, exit here -echo $SLRM_DATA | grep "device not found" && exit 1 - # wenn parameter = ... if [ "$1" = "autoconf" ]; then echo yes @@ -96,6 +93,9 @@ if [ "$1" = "config" ]; then exit 0 fi +# sometimes the api can not find the requested device, exit here +echo $SLRM_DATA | grep "device not found" && exit 1 + echo multigraph voltage_current_input echo voltage.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("DV1"))|.value')" echo current.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("DC1"))|.value')"