Convert modbus float [array] register to value

All the info is in the built in help...
image

and the built in examples

I did a demo with your data. The 1st buffer parser is set to return 1 object with your values in, the 2nd one is set to return individual results with the topic set (perfect for sending straight to MQTT)...
image

1st buffer parser specification...

{
    "options": {
        "byteSwap": [
            "swap16"
        ],
        "singleResult": true,
        "resultType": "object"
    },
    "items": [
        {
            "name": "ppm",
            "type": "floatle",
            "offset": 0
        },
        {
            "name": "temp",
            "type": "floatle",
            "offset": 4
        }
    ]
}

2nd buffer parser specification...

{
    "options": {
        "byteSwap": [
            "swap16"
        ],
        "singleResult": false,
        "resultType": "value",
        "setTopic": true
    },
    "items": [
        {
            "name": "ppm",
            "type": "floatle",
            "offset": 0
        },
        {
            "name": "temp",
            "type": "floatle",
            "offset": 4
        }
    ]
}

The output...

Here is the flow...

[{"id":"5326f890.9a4668","type":"inject","z":"3391e156.d9d19e","name":"fake data","topic":"","payload":" [32870,16838,10199,16856]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":860,"wires":[["c425a4f4.8a8e48","528d2375.d3654c"]]},{"id":"af8f4394.bc2ca","type":"debug","z":"3391e156.d9d19e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":860,"wires":[]},{"id":"e346f503.875208","type":"debug","z":"3391e156.d9d19e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":650,"y":920,"wires":[]},{"id":"c425a4f4.8a8e48","type":"buffer-parser","z":"3391e156.d9d19e","name":"","data":"payload","dataType":"msg","specification":"{\"options\":{\"byteSwap\":[\"swap16\"],\"singleResult\":true,\"resultType\":\"object\"},\"items\":[{\"name\":\"ppm\",\"type\":\"floatle\",\"offset\":0},{\"name\":\"temp\",\"type\":\"floatle\",\"offset\":4}]}","specificationType":"json","x":470,"y":860,"wires":[["af8f4394.bc2ca"]]},{"id":"528d2375.d3654c","type":"buffer-parser","z":"3391e156.d9d19e","name":"","data":"payload","dataType":"msg","specification":"{\"options\":{\"byteSwap\":[\"swap16\"],\"singleResult\":false,\"resultType\":\"value\",\"setTopic\":true},\"items\":[{\"name\":\"ppm\",\"type\":\"floatle\",\"offset\":0},{\"name\":\"temp\",\"type\":\"floatle\",\"offset\":4}]}","specificationType":"json","x":470,"y":920,"wires":[["e346f503.875208"]]}]
2 Likes