don't put channel into tags (and it is string, not number)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Sep 2018 16:19:32 +0000 (18:19 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Sep 2018 16:20:33 +0000 (18:20 +0200)
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