Hi guys, hope someone can give me a few hints.
I have 1xAM2320 temp and hum% sensor, and a soil moisture sensor connected to an arduino which in turn is connected to a Rpi.
My problem is that Im getting string messages, where part of the string needs to be converted to two floats for temperature and humidity%, and one integer for the soil mosture.
Once I have clean floats and integer, I will pipe it through to an influxdb/grafana setup.
Please see my flow:
[{"id":"9b7b9696.f5d378","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"4343aeb7.bc99e","type":"serial in","z":"9b7b9696.f5d378","name":"arduino","serial":"af1e5ab1.636568","x":210,"y":360,"wires":[["10a84488.fd1f9b"]]},{"id":"10a84488.fd1f9b","type":"function","z":"9b7b9696.f5d378","name":"Buffer to String","func":"msg.payload = msg.payload.toString('hex');\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":360,"wires":[["f90cdb39.cb89c8","c2dabb6c.e0fff8"]]},{"id":"f90cdb39.cb89c8","type":"debug","z":"9b7b9696.f5d378","name":"STRENG","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":560,"y":220,"wires":[]},{"id":"cc46a99c.e1b098","type":"debug","z":"9b7b9696.f5d378","name":"TEMP","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":850,"y":180,"wires":[]},{"id":"c2dabb6c.e0fff8","type":"switch","z":"9b7b9696.f5d378","name":"switch splitter","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"temp","vt":"str"},{"t":"cont","v":"hum","vt":"str"},{"t":"cont","v":"smo","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":600,"y":360,"wires":[["cc46a99c.e1b098"],["7e283bef.1f63f4"],["d0e3c730.363738"]]},{"id":"7e283bef.1f63f4","type":"debug","z":"9b7b9696.f5d378","name":"HUM","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":850,"y":300,"wires":[]},{"id":"d0e3c730.363738","type":"debug","z":"9b7b9696.f5d378","name":"SMO","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":830,"y":420,"wires":[]},{"id":"af1e5ab1.636568","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]