tasmota dht11 sensor, same graph colors, legend outside
[vaillant-thermostat] / temp3.sh
index 16ec8c9..e171b3a 100755 (executable)
--- a/temp3.sh
+++ b/temp3.sh
@@ -39,13 +39,27 @@ curl -G 'http://10.60.0.89:8086/query' --data-urlencode "db=telegraf" --data-url
 __SHELL__
 }
 
+influx_tele() {
+       topic=$1
+       t_col=$2
+       h_col=$3
+       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
+__SHELL__
+}
+
 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/dht11-ir-hdmi/SENSOR' 'DHT11_Temperature' 'DHT11_Humidity' 'stol-dht11-t-h'
+
 influx_mqtt    'stat/boiler/d'                         'boiler-d'
 
-influx_rtl     'vani-t-h' 40 0
+influx_rtl     'vani-t-h' 0 165
 influx_rtl     'kutija-t-h' 95 90 82
 influx_rtl     'kupaona-t-h' 125 148 133
 influx_rtl     'kuhinja-t-h' 239 83
@@ -53,6 +67,7 @@ influx_rtl    'soba-t-h' 59
 
 cat /dev/shm/curl | parallel
 
+echo "parallel over" >/dev/stderr
 
 GRAY=`echo $QUERY_STRING | grep -i gray | wc -l`