X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=temp3.sh;h=f3c2d839fd588ddfe8a5ddcb8b2f5b00aa1a520c;hb=70e835f22ffae22ab07968fa399c6c8741177339;hp=8cd6c0715a35d39a44c8969383326c37b9a6fc17;hpb=dc16ff97322f54474e6c04932141809c1c9211c8;p=vaillant-thermostat diff --git a/temp3.sh b/temp3.sh index 8cd6c07..f3c2d83 100755 --- a/temp3.sh +++ b/temp3.sh @@ -24,7 +24,7 @@ influx_mqtt() { # echo "# $topic [$rids] -> $file" cat <<__SHELL__ >> /dev/shm/curl -curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"value\" FROM \"mqtt_stat\" WHERE time > now() - $INTERVAL AND \"topic\"='$topic' " | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file +curl -G 'http://10.60.0.92:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"value\" FROM \"mqtt_stat\" WHERE time > now() - $INTERVAL AND \"topic\"='$topic' " | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file __SHELL__ } @@ -35,7 +35,7 @@ influx_rtl() { # echo "# $topic [$rids] -> $file" cat <<__SHELL__ >> /dev/shm/curl -curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\",\"humidity\" FROM \"mqtt_rtl_433\" WHERE time > now() - $INTERVAL and model='Prologue-TH' AND ( $rids )" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file +curl -G 'http://10.60.0.92:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"temperature_C\",\"humidity\" FROM \"mqtt_rtl_433\" WHERE time > now() - $INTERVAL and model='Prologue-TH' AND ( $rids )" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file __SHELL__ } @@ -46,7 +46,7 @@ influx_tele() { file=$4 cat <<__SHELL__ >> /dev/shm/curl -curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"$t_col\",\"$h_col\" FROM \"mqtt_tele_sensor\" WHERE time > now() - $INTERVAL and topic='$topic'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file +curl -G 'http://10.60.0.92:8086/query' --data-urlencode "db=telegraf" --data-urlencode "epoch=s" --data-urlencode "q=SELECT \"$t_col\",\"$h_col\" FROM \"mqtt_tele_sensor\" WHERE time > now() - $INTERVAL and topic='$topic'" | sed -e 's/^.*"values":\[\[//' -e 's/\],\[/\n/g' -e 's/,/ /g' -e 's/]].*$//' > /dev/shm/data.$file __SHELL__ } @@ -67,18 +67,19 @@ rename_ids() { done } -rename_ids 'vani-t-h' 0 165 234 -rename_ids 'kutija-t-h' 104 228 241 # hlad -rename_ids 'kupaona-t-h' 114 98 -rename_ids 'kuhinja-t-h' 199 27 -rename_ids 'soba-t-h' 252 183 +rename_ids 'vani-t-h' 211 59 # sunce +rename_ids 'kutija-t-h' 5 215 # hlad +rename_ids 'kupaona-t-h' 202 6 +rename_ids 'kuhinja-t-h' 183 111 +rename_ids 'soba-t-h' 230 37 +rename_ids 'hodnik-t-h' 167 99 influx_mqtt 'stat/boiler/DS18B20/temperature' 'DS18B20-t' influx_mqtt 'stat/boiler/DHT22/temperature' 'DHT22-t' influx_mqtt 'stat/boiler/DHT22/humidity' 'DHT22-h' -influx_tele 'tele/ir/SENSOR' 'AM2301_Temperature' 'AM2301_Humidity' 'ir-dht22-t-h' +#influx_tele 'tele/ir/SENSOR' 'AM2301_Temperature' 'AM2301_Humidity' 'ir-dht22-t-h' #influx_tele 'tele/dht11-ir-hdmi/SENSOR' 'DHT11_Temperature' 'DHT11_Humidity' 'stol-dht11-t-h' influx_mqtt 'stat/boiler/d' 'boiler-d'