X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=temp3.sh;h=6de1e574c92df3976f05cd561b06636d1cbea821;hb=0f9342d1bd49465a91256be355c20f7931083abc;hp=c3b3e9ae6aa4db2f3a252269800ad7b38920014f;hpb=258b3f3bb2e2953fc21b300d00f8eea732f4d2d8;p=vaillant-thermostat diff --git a/temp3.sh b/temp3.sh index c3b3e9a..6de1e57 100755 --- a/temp3.sh +++ b/temp3.sh @@ -50,6 +50,30 @@ curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-url __SHELL__ } +curl -G 'http://10.60.0.92:8086/query' --data-urlencode "db=rtl_433" --data-urlencode "q=SELECT time,id,temperature_C,humidity FROM \"Prologue-TH\" WHERE time > now() - $INTERVAL" -H "Accept: application/csv" --data-urlencode "epoch=s" \ + | tee /dev/shm/rtl_433.th \ + | awk -F, '{print $3" "$5" "$6 > "/dev/shm/id."$4 }' + +rename_ids() { + to=$1 + rm /dev/shm/data.$to + shift + while [ ! -z "$1" ] ; do + if [ -e /dev/shm/id.$1 ] ; then + cat /dev/shm/id.$1 > /dev/shm/data.$to + rm /dev/shm/id.$1 + fi + shift + 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' 59 252 + + influx_mqtt 'stat/boiler/DS18B20/temperature' 'DS18B20-t' influx_mqtt 'stat/boiler/DHT22/temperature' 'DHT22-t' influx_mqtt 'stat/boiler/DHT22/humidity' 'DHT22-h' @@ -59,16 +83,14 @@ influx_tele 'tele/dht11-ir-hdmi/SENSOR' 'DHT11_Temperature' 'DHT11_Humidity' 'st influx_mqtt 'stat/boiler/d' 'boiler-d' -influx_rtl 'vani-t-h' 0 165 -influx_rtl 'kutija-t-h' 82 104 228 -influx_rtl 'kupaona-t-h' 205 122 -influx_rtl 'kuhinja-t-h' 154 199 -influx_rtl 'soba-t-h' 59 252 +#influx_rtl 'vani-t-h' 0 165 234 +#influx_rtl 'kutija-t-h' 104 228 241 # hlad +#influx_rtl 'kupaona-t-h' 114 98 +#influx_rtl 'kuhinja-t-h' 199 27 +#influx_rtl 'soba-t-h' 59 252 cat /dev/shm/curl | parallel -echo "parallel over" >/dev/stderr - GRAY=`echo $QUERY_STRING | grep -i gray | wc -l` tz_secs=`date +%:z | cut -d: -f1 | sed -e 's/^+//' -e 's/$/ * 3600/' | bc`