Hi,
I want to write some data to InfluxDB. Everything works fine but now i want to write some tags instead of a fixed input.
I've got the following but node red see it as text and not a var.
It's propably something simple but i'm kinda new in this and just learning.
Thanks at advance.
Kind regards,
Ward
PS: The import code for the file is this:
[{"id":"7358ccf.3170634","type":"tab","label":"Test","disabled":false,"info":""},{"id":"2b7d1279.baf0de","type":"function","z":"7358ccf.3170634","name":"Counter","func":"var counter=flow.get('count');\ncounter = msg.payload;\nflow.set('count',counter)\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":60,"wires":[[]]},{"id":"940f5e20.55e36","type":"function","z":"7358ccf.3170634","name":"Text","func":"var text=flow.get('text');\ncounter = msg.payload;\nflow.set('text',text)\nreturn msg;\n","outputs":1,"noerr":0,"x":310,"y":100,"wires":[[]]},{"id":"b7102360.aa3698","type":"inject","z":"7358ccf.3170634","name":"","topic":"","payload":"100","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":70,"y":60,"wires":[["2b7d1279.baf0de"]]},{"id":"46998a2f.92718c","type":"inject","z":"7358ccf.3170634","name":"","topic":"","payload":"Value","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":70,"y":100,"wires":[["940f5e20.55e36"]]},{"id":"3f529c0c.bf62e4","type":"inject","z":"7358ccf.3170634","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":80,"y":240,"wires":[["e8a9bc1c.8605d"]]},{"id":"e8a9bc1c.8605d","type":"function","z":"7358ccf.3170634","name":"multiple measurement points","func":"var counter=flow.get('count');\nvar text=flow.get('text');\n\nmsg.payload = [\n {\n measurement: \"Test\",\n fields: {\n 'text': 'count'\n },\n timestamp: new Date()\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":240,"wires":[["afad0324.18b288"]]},{"id":"afad0324.18b288","type":"influxdb batch","z":"7358ccf.3170634","influxdb":"8d207046.8b93e","precision":"","retentionPolicy":"","name":"","x":750,"y":240,"wires":[]},{"id":"8640915f.ca16a8","type":"inject","z":"7358ccf.3170634","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":80,"y":280,"wires":[["2059349d.55668c"]]},{"id":"2059349d.55668c","type":"influxdb in","z":"7358ccf.3170634","influxdb":"8d207046.8b93e","name":"time query","query":"SELECT * FROM Test GROUP BY * ORDER BY DESC LIMIT 1;","rawOutput":false,"precision":"s","retentionPolicy":"","x":330,"y":280,"wires":[["29547787.74f57"]]},{"id":"29547787.74f57","type":"debug","z":"7358ccf.3170634","name":"","active":true,"console":"false","complete":"false","x":730,"y":280,"wires":[]},{"id":"8d207046.8b93e","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"NodeRed","name":"InfluxDB_NodeRed","usetls":false,"tls":""}]