Hello
I have a project to be able to view the data of a home temperature sensor by internet.
Here the main way used :
DS18BS20 Temperature sensor ------> ESP8266 NODEMCU --------> MQTT MOSQQUITTO Broker on a Raspberry PI3 ---------> Node-red on Raspberry ----------> Postgresql database on Raspberry ---------> grafana graphic maker on raspberry.
I was going step by step and I am very near to the end of my project . All step down are working execpted one : the link beetwen node-red and Postgresql.
I arrive to insert some data inside Postgresql database but I do not arrive to sent the value received from the MQTT. I have seach on the net some syntax example on this simple wish without succeed.
Could you help .
Here the node-red that I am trying to set-up
[{"id":"3af358c1.14d9b8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"71b4581.02c91a8","type":"mqtt in","z":"3af358c1.14d9b8","name":"","topic":"test","qos":"1","datatype":"auto","broker":"83a74e3d.f1929","x":80,"y":240,"wires":[["2a03924e.89ac8e","a45e3f89.02e63","211f943c.4bdd5c"]],"outputLabels":["data"]},{"id":"87331ac4.41ea38","type":"postgrestor","z":"3af358c1.14d9b8","name":"Postgre","query":"INSERT INTO bertrand (date) VALUES (value);\n\n\n","postgresDB":"45e64d43.dae164","output":true,"outputs":1,"x":560,"y":320,"wires":[]},{"id":"211f943c.4bdd5c","type":"function","z":"3af358c1.14d9b8","name":"data","func":"var payload =msg.payload;\nglobal.set("value", payload);\nreturn null;","outputs":1,"noerr":0,"x":310,"y":320,"wires":[["87331ac4.41ea38"]]},{"id":"2a03924e.89ac8e","type":"debug","z":"3af358c1.14d9b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":280,"y":200,"wires":},{"id":"a45e3f89.02e63","type":"ui_gauge","z":"3af358c1.14d9b8","name":"","group":"370e7506.73ffaa","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"1023","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":260,"y":120,"wires":},{"id":"83a74e3d.f1929","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"192.168.0.29","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"45e64d43.dae164","type":"postgresDB","z":"","name":"Raspberry","host":"192.168.0.29","port":"5432","database":"essai","ssl":false,"max":"10","min":1,"idle":"1000"},{"id":"370e7506.73ffaa","type":"ui_group","z":"","name":"exemple","tab":"da2f1fc9.a34ae","disp":true,"width":"6","collapse":false},{"id":"da2f1fc9.a34ae","type":"ui_tab","z":"","name":"Tab 1","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
in advance thank
regards
Bertrand