don't put channel into tags (and it is string, not number)
[rtl433-sensors] / mqtt-rtl_433-influx.sh
index 26f03ae..892c35f 100755 (executable)
@@ -5,14 +5,11 @@ mosquitto_sub -t rpi2/rtl433/json \
 -e 's/ "/ /' -e 's/"=/=/g' -e 's/,"/,/g' \
 -e 's/^ *//' \
 -e 's/ /\\ /g' \
--e 's/,channel="*\([^,"]*\)"*,/,channel=\1,/' \
+-e 's/,channel="*\([^,"]*\)"*,/,channel="\1",/' \
 -e 's/,battery="*\([^,"]*\)"*,/,battery="\1",/' \
 -e 's/,id=\([^,]*\),/,id=\1 /' \
 -e 's/ rid=\([^,]*\),/,rid=\1 /' \
--e 's/[ ,]channel=\([^,]*\),/,channel=\1 /' \
 -e 's/^/rtl_433,/' \
 -e 's/"//' \
 -e 's/"//' \
-| tee /dev/stderr \
-| tee /dev/shm/433.influx \
 | mosquitto_pub -t rpi2/rtl_433/influx -l