Update powerwall.sh
This commit is contained in:
13
powerwall.sh
13
powerwall.sh
@@ -202,13 +202,14 @@ POWERLOGGER_SERVICE(){
|
|||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||||
outV=$(curl -s "http://10.10.0.61/stats.json" | jq '.outputs .outV')
|
|
||||||
outA=$(curl -s "http://10.10.0.61/stats.json" | jq '.outputs .outA')
|
|
||||||
inV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
|
||||||
inA=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inA')
|
|
||||||
battV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .battV')
|
|
||||||
battA=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .xfA')
|
|
||||||
JSONSTATS=$(curl -s "http://10.10.0.61/stats.json")
|
JSONSTATS=$(curl -s "http://10.10.0.61/stats.json")
|
||||||
|
inV=`echo ${JSONSTATS} | jq '.inputs .inV'`
|
||||||
|
inA=`echo ${JSONSTATS} | jq '.inputs .inA'`
|
||||||
|
outV=`echo ${JSONSTATS} | jq '.outputs .outV'`
|
||||||
|
outA=`echo ${JSONSTATS} | jq '.outputs .outA'`
|
||||||
|
battV=`echo ${JSONSTATS} | jq '.inputs .battV'`
|
||||||
|
xfA=`echo ${JSONSTATS} | jq '.inputs .xfA'`
|
||||||
|
|
||||||
QRY="USE servermonitor; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('2','${datetime}','${inV}','${inA}')"
|
QRY="USE servermonitor; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('2','${datetime}','${inV}','${inA}')"
|
||||||
QRY="${QRY}; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('3','${datetime}','${outV}','${outA}')"
|
QRY="${QRY}; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('3','${datetime}','${outV}','${outA}')"
|
||||||
|
|||||||
Reference in New Issue
Block a user