plot \
"/dev/shm/data.DHT22-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \
,"/dev/shm/data.DS18B20-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra" lt rgb "#880088" \
+,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($2) with dots title "ir unutra" lt rgb "#884400" \
,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($2) with dots title "kuhinja" lt rgb "#ff8844" \
,"/dev/shm/data.kupaona-t-h" using ($1+tz_secs):($2) with dots title "kupaona" lt rgb "#00ff80" \
,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($2) with dots title "soba" lt rgb "#ffcc00" \
plot \
"/dev/shm/data.DHT22-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DHT22 unutra" lt rgb "#ff00ff" \
,"/dev/shm/data.DS18B20-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DS18B20 unutra" lt rgb "#880088" \
+,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($2) with lines title "ir unutra" lt rgb "#884400" \
,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($2) with lines title "kuhinja" lt rgb "#ff8844" \
,"/dev/shm/data.kupaona-t-h" using ($1+tz_secs):($2) with lines title "kupaona" lt rgb "#00ff80" \
,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($2) with lines title "soba" lt rgb "#ffcc00" \
plot \
"/dev/shm/data.DHT22-h" using ($1+tz_secs):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \
+,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($3) with dots title "ir unutra" lt rgb "#884400" \
,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($3) with dots title "kuhinja" lt rgb "#ff8844" \
,"/dev/shm/data.kupaona-t-h" using ($1+tz_secs):($3) with dots title "kupaona" lt rgb "#00ff80" \
,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($3) with dots title "soba" lt rgb "#ffcc00" \
if ( exists("lines") && lines == 1 ) {
plot \
"/dev/shm/data.DHT22-h" using ($1+tz_secs):($2 > min_h && $2 < max_h ? $2 : '') with lines title "DHT22 unutra" lt rgb "#ff00ff" \
+,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($3) with lines title "ir unutra" lt rgb "#884400" \
,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($3) with lines title "kuhinja" lt rgb "#ff8844" \
,"/dev/shm/data.kupaona-t-h" using ($1+tz_secs):($3) with lines title "kupaona" lt rgb "#00ff80" \
,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($3) with lines title "soba" lt rgb "#ffcc00" \
__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_mqtt 'stat/boiler/d' 'boiler-d'
influx_rtl 'vani-t-h' 0 165