X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=temp2.sh;h=932b5d8882d6919c83ff20d7220eefd02c2779f4;hb=ab77b962f015074f1582c7b5b86fc60c5b131bae;hp=3d50c6c64cc3d29fb39ff327c5ce57915b492080;hpb=b76c806524f3249becb8c2896717226bcca10ac0;p=vaillant-thermostat diff --git a/temp2.sh b/temp2.sh index 3d50c6c..932b5d8 100755 --- a/temp2.sh +++ b/temp2.sh @@ -24,6 +24,7 @@ curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-url curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\" FROM \"rtl_433\" WHERE time > now() - $INTERVAL AND \"topic\"='rpi2/rtl_433/influx' AND \"rid\" = '172'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' | tr -d '\\"' > /dev/shm/rtl_433-9-172-temperature curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\" FROM \"rtl_433\" WHERE time > now() - $INTERVAL AND \"topic\"='rpi2/rtl_433/influx' AND \"rid\" = '75'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' | tr -d '\\"' > /dev/shm/rtl_433-9-75-temperature curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\" FROM \"rtl_433\" WHERE time > now() - $INTERVAL AND \"topic\"='rpi2/rtl_433/influx' AND \"rid\" = '141'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' | tr -d '\\"' > /dev/shm/rtl_433-9-141-temperature +curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\" FROM \"rtl_433\" WHERE time > now() - $INTERVAL AND \"topic\"='rpi2/rtl_433/influx' AND \"rid\" = '183'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' | tr -d '\\"' > /dev/shm/rtl_433-183-temperature curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT mean(\"value\"),spread(\"value\") FROM \"mqtt_consumer\" WHERE time > now() - $INTERVAL AND \"topic\"='stat/boiler/DS18B20/temperature'" | jq '.results[0].series[0].values[0][1,2]' > /dev/shm/temperature.mean.spread @@ -49,6 +50,9 @@ fi set > /dev/shm/temp2.cgi.vars +lines_checked="" +test "$LINES" = 1 && lines_checked="checked" + if echo $HTTP_USER_AGENT | grep Mozilla > /dev/null ; then echo "Content-type: text/html\r\n\r\n" cat << __HTML__ @@ -56,9 +60,10 @@ if echo $HTTP_USER_AGENT | grep Mozilla > /dev/null ; then
+ - +