X-Git-Url: http://git.rot13.org/?p=vaillant-thermostat;a=blobdiff_plain;f=temp3.sh;h=5770a92a5a55d0c77f0551dc47aff7977fad6df3;hp=21420d896aafac5ff0fe33c6a66db0a2f704d391;hb=HEAD;hpb=91ce7088496c73dbc6db9b5378c1ba1682163608 diff --git a/temp3.sh b/temp3.sh index 21420d8..5673c1a 100755 --- a/temp3.sh +++ b/temp3.sh @@ -54,6 +54,13 @@ curl -G 'http://10.60.0.92:8086/query' --data-urlencode "db=rtl_433" --data-urle | tee /dev/shm/rtl_433.th \ | awk -F, '{print $3" "$5" "$6 > "/dev/shm/id."$4 }' +psql_subvision() { + to=$1 + echo "select extract(epoch from time), temperature, humidity from s_1 where time > now() - interval '$INTERVAL' order by time" | \ + ssh subvision psql -t -A eg5120 | sed 's/|/ /g' > /dev/shm/data.$to +} + + rename_ids() { to=$1 shift @@ -68,12 +75,13 @@ rename_ids() { done } -rename_ids 'vani-t-h' 1 154 # sunce -rename_ids 'kutija-t-h' 237 114 # hlad -rename_ids 'kupaona-t-h' 78 15 -rename_ids 'kuhinja-t-h' 33 126 -rename_ids 'soba-t-h' 105 234 -rename_ids 'hodnik-t-h' 145 181 +rename_ids 'vani-t-h' 156 # sunce +rename_ids 'kutija-t-h' 138 # hlad +#rename_ids 'kupaona-t-h' 78 15 +psql_subvision 'kupaona-t-h' +rename_ids 'kuhinja-t-h' 144 +rename_ids 'soba-t-h' 251 +rename_ids 'hodnik-t-h' 234 influx_mqtt 'stat/boiler/DS18B20/temperature' 'DS18B20-t'