X-Git-Url: http://git.rot13.org/?p=vaillant-thermostat;a=blobdiff_plain;f=temp3.sh;h=f587c46d45a83563b3b17c1a9f19924bd359eb80;hp=db8d559cd7017c07835813b69ea7a6c7e414907b;hb=HEAD;hpb=f4252faaf51dcbe00ae3afb905e304cc807cee67 diff --git a/temp3.sh b/temp3.sh index db8d559..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 # 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'