This commit is contained in:
2024-01-01 12:45:18 -06:00
parent c7378948b7
commit 18d4d5222c
4 changed files with 8 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ CHECKPOWER(){
[ ${REPORT} -eq 0 ] && echo -en "${idsCL[Yellow]}Pulling data from 'Powerwall' ... " [ ${REPORT} -eq 0 ] && echo -en "${idsCL[Yellow]}Pulling data from 'Powerwall' ... "
INVSTATSINFO=$(curl -s "http://${PW_INVERTER_IP}/stats.json") INVSTATSINFO=$(curl -m 3 -s "http://${PW_INVERTER_IP}/stats.json")
if [ "${INVSTATSINFO}" != "" ]; then if [ "${INVSTATSINFO}" != "" ]; then
[ "${TEST_INPUTACV}" != "" ] && INPUTV=${TEST_INPUTACV} || INPUTV=$(echo ${INVSTATSINFO} | jq '.inputs .inV') [ "${TEST_INPUTACV}" != "" ] && INPUTV=${TEST_INPUTACV} || INPUTV=$(echo ${INVSTATSINFO} | jq '.inputs .inV')
INPUTA=`echo ${INVSTATSINFO} | jq '.inputs .inA'` INPUTA=`echo ${INVSTATSINFO} | jq '.inputs .inA'`
@@ -353,7 +353,7 @@ CHECKPOWER_SERVICE(){
[ "${TEST_INPUTACV}" != "" ] || [ "${TEST_BATTVOLT}" != "" ] && TESTMODE=1 || TESTMODE=0 [ "${TEST_INPUTACV}" != "" ] || [ "${TEST_BATTVOLT}" != "" ] && TESTMODE=1 || TESTMODE=0
INVSTATSINFO=$(curl -s "http://${PW_INVERTER_IP}/stats.json") INVSTATSINFO=$(curl -m 3 -s "http://${PW_INVERTER_IP}/stats.json")
SVRRM_UPS_INPUTACV=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_UPS_IP} iso.3.6.1.4.1.850.1.1.3.1.3.2.2.1.3.1.1 | sed 's/.*: //') SVRRM_UPS_INPUTACV=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_UPS_IP} iso.3.6.1.4.1.850.1.1.3.1.3.2.2.1.3.1.1 | sed 's/.*: //')
if (( $(bc <<<"${SVRRM_UPS_INPUTACV} < ${min_acvolt}") )); then if (( $(bc <<<"${SVRRM_UPS_INPUTACV} < ${min_acvolt}") )); then
@@ -586,7 +586,7 @@ POWERLOGGER_SERVICE(){
LogDataTime=`date +'%Y-%m-%d %H:%M:%S'` LogDataTime=`date +'%Y-%m-%d %H:%M:%S'`
source ${PW_FOLDER}/defaults.inc source ${PW_FOLDER}/defaults.inc
INVSTATSINFO=$(curl -s "http://${PW_INVERTER_IP}/stats.json") INVSTATSINFO=$(curl -m 3 -s "http://${PW_INVERTER_IP}/stats.json")
if [ "${INVSTATSINFO}" != "" ]; then if [ "${INVSTATSINFO}" != "" ]; then
INPUTV=`echo ${INVSTATSINFO} | jq '.inputs .inV'` INPUTV=`echo ${INVSTATSINFO} | jq '.inputs .inV'`
INPUTA=`echo ${INVSTATSINFO} | jq '.inputs .inA'` INPUTA=`echo ${INVSTATSINFO} | jq '.inputs .inA'`

View File

@@ -137,7 +137,7 @@ CHECKTEMPSENSOR(){
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
elif [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then elif [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then
INFO=$(curl -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq) INFO=$(curl -m 3 -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq)
if [[ "${1}" = *"-Probe" ]]; then if [[ "${1}" = *"-Probe" ]]; then
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes` temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
else else
@@ -362,7 +362,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
INFO=$(curl -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq) INFO=$(curl -m 3 -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq)
if [[ "${SENSOR}" = *"-Probe" ]]; then if [[ "${SENSOR}" = *"-Probe" ]]; then
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes` temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
else else
@@ -699,7 +699,7 @@ SENDTEMP(){
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "lacrosse" ]; then elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "lacrosse" ]; then
INFO=$(curl -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq) INFO=$(curl -m 3 -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq)
if [[ "${SENSORa}" = *"-Probe" ]]; then if [[ "${SENSORa}" = *"-Probe" ]]; then
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes` temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
else else

View File

@@ -50,7 +50,7 @@ AC VOLTAGE: ${OFFSITE_VOLTIN}'volts
$(date)" $(date)"
if [ "${3}" = "1" ]; then PRIORITY="${3}"; MSGSOUND=siren; elif [ "${3}" != "" ]; then PRIORITY=${3}; else PRIORITY=0; fi if [ "${3}" = "1" ]; then PRIORITY="${3}"; MSGSOUND=siren; elif [ "${3}" != "" ]; then PRIORITY=${3}; else PRIORITY=0; fi
curl -sd "token=${PW_PUSHOVER_APP_TOKEN}&user=${PW_PUSHOVER_USER_TOKEN}&message=${MESSAGE}&title=${1}&priority=${PRIORITY}&sound=cosmic" https://api.pushover.net/1/messages.json >/dev/null 2>&1 curl -m 3 -sd "token=${PW_PUSHOVER_APP_TOKEN}&user=${PW_PUSHOVER_USER_TOKEN}&message=${MESSAGE}&title=${1}&priority=${PRIORITY}&sound=cosmic" https://api.pushover.net/1/messages.json >/dev/null 2>&1
} }
if [ "${startup}" == "true" ]; then if [ "${startup}" == "true" ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}'% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Service startup" >> ${PW_LOGPOWER} echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}'% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Service startup" >> ${PW_LOGPOWER}

View File

@@ -120,7 +120,7 @@ ${reason}" 1
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}'F - Shutting down SYS servers" >> ${logtemp} echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}'F - Shutting down SYS servers" >> ${logtemp}
fi fi
# curl --data "cmd=PWRoff" http://${PW_INVERTER_IP}/cmd # curl -m 3 --data "cmd=PWRoff" http://${PW_INVERTER_IP}/cmd
echo echo
} }
SHUTDOWN_CRIT(){ SHUTDOWN_CRIT(){