Node-red, raspberry pi and arduino communication issues

Which contrib node are you using to read the ds18b20?
add a debug node to it's output and look at the result, paste a copy to a reply

Also why not use one switch node to check for each sensor and then have the outputs go to the appropriate next node?

[{"id":"6a6c83b8.bb185c","type":"inject","z":"1f851c1.28701e4","name":"","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":160,"y":100,"wires":[["13ef1dd3.a2cf62"]]},{"id":"13ef1dd3.a2cf62","type":"rpi-ds18b20","z":"1f851c1.28701e4","topic":"","array":false,"name":"","x":350,"y":100,"wires":[["1f01bf2a.2f3b71"]]},{"id":"1f01bf2a.2f3b71","type":"debug","z":"1f851c1.28701e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":550,"y":100,"wires":[]},{"id":"d2bb6889.0e9c88","type":"comment","z":"1f851c1.28701e4","name":"Body: Tempature Probes","info":"diagram of map link here ","x":170,"y":160,"wires":[]},{"id":"78b46331.d9ff7c","type":"comment","z":"1f851c1.28701e4","name":"sensor1 Boil Kettle","info":"{\"_msgid\":\"67e54d37.7e7e34\",\"payload\":19.375,\"topic\":\"2F4407D6013C\",\"file\":\"28-3c01d607442f\",\"dir\":\"w1_bus_master1\",\"family\":\"28\"}\n","x":270.00003814697266,"y":252.00002098083496,"wires":[]},{"id":"796619bd.d06898","type":"comment","z":"1f851c1.28701e4","name":"edit when changing sensor","info":"","x":790,"y":200,"wires":[]},{"id":"1a32f115.43a18f","type":"change","z":"1f851c1.28701e4","name":"format topic to mqtt header","rules":[{"t":"set","p":"topic","pt":"msg","to":"topic.sensor1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":260,"wires":[["1bc19f2079840ced"]]},{"id":"4a0ae719.de3f58","type":"inject","z":"1f851c1.28701e4","name":"30sec","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":146.00000762939453,"y":203.00001907348633,"wires":[["a780bcc.d212b4"]]},{"id":"1abb841e.5a146c","type":"switch","z":"1f851c1.28701e4","name":"If = 2F4407D6013C","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"2F4407D6013C","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["1a32f115.43a18f"],["b619ce5b.8681a"]]},{"id":"a780bcc.d212b4","type":"rpi-ds18b20","z":"1f851c1.28701e4","topic":"","array":false,"name":"","x":356,"y":151.00000190734863,"wires":[["1abb841e.5a146c"]]}]

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]82B307D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 15.375, topic: "82B307D6013C", file: "28-3c01d607b382", dir: "w1_bus_master1" … }

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]B7EC07D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 15.25, topic: "B7EC07D6013C", file: "28-3c01d607ecb7", dir: "w1_bus_master1" … }

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]2F4407D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 15.125, topic: "2F4407D6013C", file: "28-3c01d607442f", dir: "w1_bus_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]D9D796F0013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: -1.5, topic: "D9D796F0013C", file: "28-3c01f096d7d9", dir: "w1_bus_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]1B5507D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 17.75, topic: "1B5507D6013C", file: "28-3c01d607551b", dir: "w1_bus_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]9DFD07D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 18.25, topic: "9DFD07D6013C", file: "28-3c01d607fd9d", dir: "w1_bus_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]AA5A07D6013C : msg : Object

{ _msgid: "292fbe2dacc01c10", payload: 15, topic: "AA5A07D6013C", file: "28-3c01d6075aaa", dir: "w1_bus_master1" … }

So just send the output of the node-red-contrib-ds18b20-sensor node to a switch node. In the switch test msg.payload != -127 and then pass that output to your flow.

As I said, I'd combine the following set if switched into one like this:

[{"id":"273e3c301c54b29e","type":"switch","z":"fdcb57b723139a0f","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"1B5507D6013C","vt":"str"},{"t":"eq","v":"2F4407D6013C","vt":"str"},{"t":"eq","v":"82B307D6013C","vt":"str"},{"t":"eq","v":"9DFD07D6013C","vt":"str"},{"t":"eq","v":"B7EC07D6013C","vt":"str"},{"t":"eq","v":"D9D796F0013C","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":7,"x":270,"y":660,"wires":[[],[],[],[],[],[],[]]}]

ok so that is same as what i did on the other but i used multiple switch nodes.

Im not understanding how to

In the switch test msg.payload != -127 and then pass that output to your flow.

image

1 Like

Ok that makes sense.
So basically any one sensor that has that message is basically thrown away before I send the goods readings to each gauge flow.

Ty , cheers

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.