This commit is contained in:
2023-12-14 15:25:11 -06:00
parent 0da012bfdb
commit 290e0e815d
4 changed files with 29 additions and 12 deletions

View File

@@ -12,9 +12,11 @@ mqtt_conn='/usr/bin/mosquitto_sub -h 127.0.0.1 -u mqtt -P 12mqtt34password56'
mysql_conn='/usr/bin/mysql' mysql_conn='/usr/bin/mysql'
PW_FOLDER='/opt/idssys/powerwall' PW_FOLDER='/opt/idssys/powerwall'
PW_INCFOLDER=${PW_FOLDER}/inc
PW_LOGFOLDER=${PW_FOLDER}/logs PW_LOGFOLDER=${PW_FOLDER}/logs
PW_LOGARCHIVE=${PW_FOLDER}/logs/archive PW_LOGARCHIVE=${PW_FOLDER}/logs/archive
PW_TMPFOLDER=${PW_FOLDER}/.tmp PW_TMPFOLDER=${PW_FOLDER}/.tmp
[ ! -d ${PW_INCFOLDER} ] && mkdir ${PW_INCFOLDER}
[ ! -d ${PW_LOGFOLDER} ] && mkdir ${PW_LOGFOLDER} [ ! -d ${PW_LOGFOLDER} ] && mkdir ${PW_LOGFOLDER}
[ ! -d ${PW_LOGARCHIVE} ] && mkdir ${PW_LOGARCHIVE} [ ! -d ${PW_LOGARCHIVE} ] && mkdir ${PW_LOGARCHIVE}
[ ! -d ${PW_TMPFOLDER} ] && mkdir ${PW_TMPFOLDER} [ ! -d ${PW_TMPFOLDER} ] && mkdir ${PW_TMPFOLDER}
@@ -53,6 +55,7 @@ if [ -f ${PW_FOLDER}/settings.local.conf ]; then
declare -A PW_INVERTER_STATES declare -A PW_INVERTER_STATES
declare -A PW_INVERTER_MODES declare -A PW_INVERTER_MODES
declare -A PW_INVERTER_ERRORS declare -A PW_INVERTER_ERRORS
declare -A PW_TASMOTA_ID
source ${PW_FOLDER}/settings.local.conf source ${PW_FOLDER}/settings.local.conf

View File

@@ -512,4 +512,18 @@ DAILYTEMP(){
done done
[ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ] && echo [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ] && echo
done done
} }
GET_TASMOTA_INFO(){
device_info=$(python ${PW_INCFOLDER}/getInfo.tasmota.py "${PW_TASMOTA_ID[${1}]}")
echo ${device_info}
}

View File

@@ -7,8 +7,8 @@ source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc source /opt/idssys/defaults/default.inc
source /opt/idssys/powerwall/defaults.inc source /opt/idssys/powerwall/defaults.inc
source ${PW_FOLDER}/inc/power.inc.sh source ${PW_INCFOLDER}/power.inc.sh
source ${PW_FOLDER}/inc/temp.inc.sh source ${PW_INCFOLDER}/temp.inc.sh
# TEST=true # TEST=true
@@ -890,7 +890,7 @@ fi
;; ;;
esac esac
;; ;;
test) CHECKTEMP ${2} ${3};; test) GET_TASMOTA_INFO ${2} ${3};;
iscsi-vm-shutdown) iscsi-vm-shutdown)
[ "${2^^}" == "SYS" ] && ISCSISYSVMSHUTDOWN || ISCSIVMSHUTDOWN [ "${2^^}" == "SYS" ] && ISCSISYSVMSHUTDOWN || ISCSIVMSHUTDOWN
;; ;;

16
run.sh
View File

@@ -45,14 +45,14 @@ if [ "${1}" == "update" ]; then
echo -en "\e[1A"; echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}\n" echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}\n"
fi fi
read -n 1 -p "Do you want to restart PowerWall Services? (y/N): " choice # read -n 1 -p "Do you want to restart PowerWall Services? (y/N): " choice
case "$choice" in # case "$choice" in
[Yy]) # [Yy])
echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..." # echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..."
${PW_SCRIPT} service all restart # ${PW_SCRIPT} service all restart
;; # ;;
*) echo;; # *) echo;;
esac # esac
elif [ "${2}" != "q" ]; then elif [ "${2}" != "q" ]; then
echo -en "\e[1A"; echo -en "\e[1A";