add rid and channel to tags to uniqly identify sensors
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Aug 2017 09:41:08 +0000 (11:41 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Aug 2017 09:41:15 +0000 (11:41 +0200)
mqtt-rtl_433-influx.sh

index de4da0d..3d5b295 100755 (executable)
@@ -8,6 +8,8 @@ mosquitto_sub -t rpi2/rtl433/json \
 -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/"//' \