Write to subregister via Modbus and bufferparser

Hello friends.

Its been a while. I once posted a problem, where i wanded to read from one adress, that contained multiple information. For example adress 100 was listed in the documenation and contained multiple values:
ADR: 100.1 (bool value X)
ADR: 100.2 (bool value Y)
ADR: 100.3 (bool value Z) (and so on)

If someone want to read it: First project. Is Node-red the way to go

Here is my solution, how to read from an adress 100 that is splited into 6 "sub" adresses (100.1 , 100,2 ...)

[
    {
        "id": "c883412ea76f64d2",
        "type": "modbus-flex-getter",
        "z": "0c822967e78b69a8",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "0e3ec676f3e39293",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1630,
        "y": 800,
        "wires": [
            [
                "c3da37c4c8cd7d50",
                "c14c540e23bfcdbc"
            ],
            []
        ]
    },
    {
        "id": "c3da37c4c8cd7d50",
        "type": "modbus-response",
        "z": "0c822967e78b69a8",
        "name": "",
        "registerShowMax": 20,
        "x": 1630,
        "y": 860,
        "wires": []
    },
    {
        "id": "51c6209a18301ef8",
        "type": "function",
        "z": "0c822967e78b69a8",
        "name": "Read_101",
        "func": "msg.payload =\n{ value: msg.payload, \n'fc': 3, \n'unitid': 0, \n'address': 100, \n'quantity':1 \n    \n} ;\nreturn msg",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1380,
        "y": 800,
        "wires": [
            [
                "c883412ea76f64d2"
            ]
        ]
    },
    {
        "id": "a8b39931d1595820",
        "type": "inject",
        "z": "0c822967e78b69a8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "2",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1410,
        "y": 940,
        "wires": [
            [
                "51c6209a18301ef8"
            ]
        ]
    },
    {
        "id": "c14c540e23bfcdbc",
        "type": "buffer-parser",
        "z": "0c822967e78b69a8",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "bool",
                "name": "Remote_On_Off",
                "offset": 1,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Deaerating",
                "offset": 1,
                "length": 1,
                "offsetbit": 1,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "AnalogueMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 2,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "TimerMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 3,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "SlowMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 4,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Velocity",
                "offset": 1,
                "length": 1,
                "offsetbit": 5,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 1670,
        "y": 960,
        "wires": [
            [
                "58b5d9ecd58ba23f"
            ]
        ]
    },
    {
        "id": "58b5d9ecd58ba23f",
        "type": "debug",
        "z": "0c822967e78b69a8",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1890,
        "y": 860,
        "wires": []
    },
    {
        "id": "0e3ec676f3e39293",
        "type": "modbus-client",
        "name": "CIM500",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.240.6.39",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": 1,
        "commandDelay": 1,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    }
]

My problem rn is, now kinda the same, but now i want to write to an adress that has "subadresses". For example, i want to write to the adress 101.1, I tried to find an answer and tested around to make it work, but i cant find a way to manage it. I am a bit confused ho to implement the buffer parser in the writing process. Thats what i have so far:

[
    {
        "id": "a49c5714d15ff31a",
        "type": "modbus-flex-write",
        "z": "0c822967e78b69a8",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "server": "0e3ec676f3e39293",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1510,
        "y": 340,
        "wires": [
            [],
            [
                "363f74101ce7d6ce"
            ]
        ]
    },
    {
        "id": "363f74101ce7d6ce",
        "type": "modbus-response",
        "z": "0c822967e78b69a8",
        "name": "",
        "registerShowMax": 20,
        "x": 1530,
        "y": 420,
        "wires": []
    },
    {
        "id": "a421342e3c0ce1b7",
        "type": "inject",
        "z": "0c822967e78b69a8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1020,
        "y": 280,
        "wires": [
            [
                "2c2bc60ddb01114a"
            ]
        ]
    },
    {
        "id": "74f8ba5aded6e8ac",
        "type": "inject",
        "z": "0c822967e78b69a8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1060,
        "y": 360,
        "wires": [
            [
                "e9de7a7d92187b5b"
            ]
        ]
    },
    {
        "id": "e9de7a7d92187b5b",
        "type": "function",
        "z": "0c822967e78b69a8",
        "name": "0",
        "func": "var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=0;\nmsg.slave_ip=\"10.240.6.39\";\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1310,
        "y": 400,
        "wires": [
            [
                "a49c5714d15ff31a"
            ]
        ]
    },
    {
        "id": "2c2bc60ddb01114a",
        "type": "function",
        "z": "0c822967e78b69a8",
        "name": "0",
        "func": "var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=1;\nmsg.slave_ip=\"10.240.6.39\";\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1310,
        "y": 300,
        "wires": [
            [
                "a49c5714d15ff31a"
            ]
        ]
    },
    {
        "id": "0e3ec676f3e39293",
        "type": "modbus-client",
        "name": "CIM500",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.240.6.39",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    }
]

Writing to a single register (FC6) means the FULL WORD (16bits) are written. You cannot write to a single bit in a register.

Your options are to move the "bit" into a different modbus area and use FC5 or FC15.
If that is not possible, then another option is to first READ then set/reset the bit then WRITE the full WORD back. This has the risk that any "bit" set by the end device between the READ and the WRITE will get overwritten.

Thank you for the answer.

What do you mean with: "move the bit into a different modbus area"?
The given adress and subadress where i want to write (100.1 , 100.2, 100.3 ....) are determined by the manufacturer of the device i want to conrtol.

Or do i completyl missunderstand your hint?

Thank you

As I dont know what device you are meaning, I took a punt it was a PLC and the PLC addressing could be changed to point at different areas in the modbus address ranges (i.e. map COIL bits 1~16 to PLC address 100)

If that is not the case then as I said, you will need to READ, modify value to set/reset bit, WRITE full WORD (all 16 bits as one WORD) back to the address & hope that the device didnt change any of the other 15 bits in the mean time.

Its a dosing pump that i want to control.

There is a software from the manufacture, where u can control this specific adresses.
But for our project it is essential to not use this software. Here i a small snippet from the software, where u can see that one adress contain multiple "options" to control.
I am real curious how they do it, since it cant be that difficult ( i hope so:))

I can follow your hint until the reading part. Where i exit is the "modify value to set/reset bit".
I read the adress with the buffer parser and modbus getter. Now i have the value, lets say from adress 100.1. How would you proceed?

thank you for your help

hi ... from your flow i see that for the Modbus Read you convert the buffer to booleans.
For the Write as Steve explained with settings the bits, you have to work in reverse and use the buffer-maker in combination with the buffer-parser to create a uint16.

For example you have a payload [[1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0]] that represents the "subregisters" gives 263 in unsigned integer (in the range 0 to 65535) which is what the FC6 Modbus Write expects.

Test Flow:

[{"id":"0684c132451a4866","type":"buffer-maker","z":"54efb553244c241f","name":"","specification":"spec","specificationType":"ui","items":[{"name":"item","type":"16bitbe","length":1,"dataType":"msg","data":"payload"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":450,"y":3220,"wires":[["cfdb45057774f8a5","ea82b4f5264d2764"]]},{"id":"33a653d6480b0abe","type":"inject","z":"54efb553244c241f","name":"binary","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[[1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0]]","payloadType":"json","x":270,"y":3220,"wires":[["0684c132451a4866","acd3e779ef6b7802"]]},{"id":"b4d08d3e90771762","type":"debug","z":"54efb553244c241f","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":3160,"wires":[]},{"id":"acd3e779ef6b7802","type":"debug","z":"54efb553244c241f","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":360,"y":3160,"wires":[]},{"id":"cfdb45057774f8a5","type":"buffer-parser","z":"54efb553244c241f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"decimal","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":650,"y":3220,"wires":[["b4d08d3e90771762","7760136a875f3080"]]},{"id":"ea82b4f5264d2764","type":"debug","z":"54efb553244c241f","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":580,"y":3160,"wires":[]},{"id":"7760136a875f3080","type":"function","z":"54efb553244c241f","name":"modbus","func":"var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":3220,"wires":[["c102514d5b0dbe46","3cc5bee349987a80"]]},{"id":"c102514d5b0dbe46","type":"modbus-flex-write","z":"54efb553244c241f","name":"","showStatusActivities":false,"showErrors":false,"server":"0e3ec676f3e39293","emptyMsgOnFail":false,"keepMsgProperties":false,"x":1050,"y":3220,"wires":[[],[]]},{"id":"3cc5bee349987a80","type":"debug","z":"54efb553244c241f","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":3160,"wires":[]},{"id":"0e3ec676f3e39293","type":"modbus-client","name":"CIM500","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.240.6.39","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]

ps. i could be wrong about the order of the bits .. starting left to right or right to left .. experiment and see what you get.

Thank you very much for the help.

I am still struggling to understand this. I try to adapt your example and create the following flows in hope to understand it.

I want to inject 0 or 1 (bool) to the adress 101.1 (100.1)

Here are my thoughts what happened in your testflow. I tried to read a loat about buffers and so on. Still hard for me.

Your wrote that the payloard represents the subregisters ( for example). My subregisters are 0,1,2,3
, since i want to write to 100.0,100.1,100.2,100.3, i have to convert the number 0 (to write to 100.0), into a buffer and than i use the buffer parser to convert the buffer into an uint 16? Its this correct?

yes ... and since the msg.payload that buffer-maker expects must be in the format
[[ false, true, true, false, false, true, false, false ]] or 0,1 s
for example 100.0 the inner array [0] at position [0] must be changed to true or false

Steps:

  1. do the Modbus Read
  2. convert to Bool with buffer-parser (as you already have)
  3. save the result in flow Context

image

When you want to send a command

  1. Inject a true / false for the subregister you want to change (along with a msg.topic)
  2. Read the current status of Context
  3. Update array and Convert to Decimal uint16
  4. sent value to Modbus Write

test Flow:

[{"id":"c883412ea76f64d2","type":"modbus-flex-getter","z":"54efb553244c241f","name":"","showStatusActivities":false,"showErrors":false,"showWarnings":true,"logIOActivities":false,"server":"d1b0c8d03f3ec42a","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":560,"y":2900,"wires":[["c3da37c4c8cd7d50","c14c540e23bfcdbc"],[]]},{"id":"c3da37c4c8cd7d50","type":"modbus-response","z":"54efb553244c241f","name":"","registerShowMax":20,"x":750,"y":2820,"wires":[]},{"id":"51c6209a18301ef8","type":"function","z":"54efb553244c241f","name":"Read_101","func":"msg.payload =\n{\n    value: msg.payload,\n    'fc': 3,\n    'unitid': 0,\n    'address': 100,\n    'quantity': 1\n\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":2900,"wires":[["c883412ea76f64d2"]]},{"id":"a8b39931d1595820","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2900,"wires":[["51c6209a18301ef8"]]},{"id":"c14c540e23bfcdbc","type":"buffer-parser","z":"54efb553244c241f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bool","name":"Remote_On_Off","offset":1,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"bool","name":"Deaerating","offset":1,"length":1,"offsetbit":1,"scale":"1","mask":""},{"type":"bool","name":"AnalogueMode","offset":1,"length":1,"offsetbit":2,"scale":"1","mask":""},{"type":"bool","name":"TimerMode","offset":1,"length":1,"offsetbit":3,"scale":"1","mask":""},{"type":"bool","name":"SlowMode","offset":1,"length":1,"offsetbit":4,"scale":"1","mask":""},{"type":"bool","name":"Velocity","offset":1,"length":1,"offsetbit":5,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":790,"y":2880,"wires":[["4a19db793195618f"]]},{"id":"58b5d9ecd58ba23f","type":"debug","z":"54efb553244c241f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":2880,"wires":[]},{"id":"0684c132451a4866","type":"buffer-maker","z":"54efb553244c241f","name":"","specification":"spec","specificationType":"ui","items":[{"name":"item","type":"16bitbe","length":1,"dataType":"msg","data":"payload"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":650,"y":3220,"wires":[["cfdb45057774f8a5","ea82b4f5264d2764"]]},{"id":"33a653d6480b0abe","type":"inject","z":"54efb553244c241f","name":"Remote_On_Off true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Remote_On_Off","payload":"true","payloadType":"bool","x":160,"y":3100,"wires":[["0920c2a3e5b07bbd"]]},{"id":"b4d08d3e90771762","type":"debug","z":"54efb553244c241f","name":"debug 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":3160,"wires":[]},{"id":"acd3e779ef6b7802","type":"debug","z":"54efb553244c241f","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":580,"y":3160,"wires":[]},{"id":"cfdb45057774f8a5","type":"buffer-parser","z":"54efb553244c241f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"decimal","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":850,"y":3220,"wires":[["b4d08d3e90771762","7760136a875f3080"]]},{"id":"ea82b4f5264d2764","type":"debug","z":"54efb553244c241f","name":"debug 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":3160,"wires":[]},{"id":"7760136a875f3080","type":"function","z":"54efb553244c241f","name":"modbus","func":"var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3220,"wires":[["c102514d5b0dbe46","3cc5bee349987a80"]]},{"id":"c102514d5b0dbe46","type":"modbus-flex-write","z":"54efb553244c241f","name":"","showStatusActivities":false,"showErrors":false,"server":"0e3ec676f3e39293","emptyMsgOnFail":false,"keepMsgProperties":false,"x":1250,"y":3220,"wires":[[],[]]},{"id":"3cc5bee349987a80","type":"debug","z":"54efb553244c241f","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":3160,"wires":[]},{"id":"4a19db793195618f","type":"change","z":"54efb553244c241f","name":"save to Context","rules":[{"t":"set","p":"pumpStatus","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":2880,"wires":[["58b5d9ecd58ba23f"]]},{"id":"0920c2a3e5b07bbd","type":"function","z":"54efb553244c241f","name":"update Context","func":"let ps = flow.get(\"pumpStatus\")\n\nps = [[ps.Velocity, ps.SlowMode, ps.TimerMode, ps.AnalogueMode, ps.Deaerating, ps.Remote_On_Off, false, false]]\n\nif (msg.topic === \"Velocity\") {\n    ps[0][0] = msg.payload\n}\nelse if (msg.topic === \"SlowMode\") {\n    ps[0][1] = msg.payload;\n}\nelse if (msg.topic === \"TimerMode\") {\n    ps[0][2] = msg.payload;\n}\nelse if (msg.topic === \"AnalogueMode\") {\n    ps[0][3] = msg.payload;\n}\nelse if (msg.topic === \"Deaerating\") {\n    ps[0][4] = msg.payload;\n}\nelse if (msg.topic === \"Remote_On_Off\") {\n    ps[0][5] = msg.payload;\n}\n\nmsg.payload = ps;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":3220,"wires":[["0684c132451a4866","acd3e779ef6b7802"]]},{"id":"028bc461b01c539c","type":"inject","z":"54efb553244c241f","name":"Remote_On_Off false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Remote_On_Off","payload":"false","payloadType":"bool","x":160,"y":3140,"wires":[["0920c2a3e5b07bbd"]]},{"id":"d1b0c8d03f3ec42a","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"192.168.0.66","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"0e3ec676f3e39293","type":"modbus-client","name":"CIM500","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.240.6.39","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]

Thank you for the answers.

I am a bit further. I think i kinda understand the concept.
Where am i right now. I created a form, where i can switch things on and off (In real life this is running on an other server). From there i send the data to my MQTT server.

Where i am struggle now is how to combine the reading process and storing them into concept AND update the correct subregister that have the register:

Remote: 100.0
Deaerating : 100.1
AnalogMode: 100.2
TimerMode: 100.3
SlowMode: 100.4
Velocity: 100.5

Thats is what i have so far:

[
    {
        "id": "7fcf8c03b1c476cd",
        "type": "ui_form",
        "z": "398c06eae40d9b16",
        "name": "",
        "label": "",
        "group": "fa7c1f04e5714b54",
        "order": 2,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "REMOTE (disable/enable)",
                "value": "Remote",
                "type": "switch",
                "required": true,
                "rows": null
            },
            {
                "label": "Deaerating",
                "value": "Deaerating",
                "type": "switch",
                "required": true,
                "rows": null
            },
            {
                "label": "AnalogMode",
                "value": "AnalogMode",
                "type": "switch",
                "required": true,
                "rows": null
            },
            {
                "label": "SlowMode",
                "value": "SlowMode",
                "type": "switch",
                "required": true,
                "rows": null
            },
            {
                "label": "Velocity",
                "value": "Velocity",
                "type": "switch",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "Remote": false,
            "Deaerating": false,
            "AnalogMode": false,
            "SlowMode": false,
            "Velocity": false
        },
        "payload": "",
        "submit": "submit",
        "cancel": "cancel",
        "topic": "topic",
        "topicType": "msg",
        "splitLayout": true,
        "x": 250,
        "y": 380,
        "wires": [
            []
        ]
    },
    {
        "id": "a0469261d3b6d29b",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1150,
        "y": 580,
        "wires": []
    },
    {
        "id": "1307bc1edde4cfd9",
        "type": "change",
        "z": "398c06eae40d9b16",
        "name": "save to Context",
        "rules": [
            {
                "t": "set",
                "p": "pumpStatus",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 580,
        "wires": [
            [
                "a0469261d3b6d29b"
            ]
        ]
    },
    {
        "id": "4e3673722e4f7c0f",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 910,
        "y": 660,
        "wires": []
    },
    {
        "id": "1c42cb8a107c2aec",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "Only values from adress 101",
        "func": "msg.payload= [\n    {\n        \"Remote\": msg.payload.Remote,\n        \"Deaerating\": msg.payload.Deaerating,\n        \"AnalogMode\": msg.payload.AnalogMode,\n        \"TimerMode\" : true,\n        \"SlowMode\": msg.payload.SlowMode,\n        \"Velocity\": msg.payload.Velocity,\n        }\n];\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 580,
        "wires": [
            [
                "4e3673722e4f7c0f",
                "1307bc1edde4cfd9"
            ]
        ]
    },
    {
        "id": "42089db5518ea545",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 460,
        "wires": []
    },
    {
        "id": "9b8514179e106dd6",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "get data from MQTT",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 310,
        "y": 580,
        "wires": [
            [
                "42089db5518ea545",
                "1c42cb8a107c2aec"
            ]
        ]
    },
    {
        "id": "6eb9f2ee9c458b20",
        "type": "buffer-maker",
        "z": "398c06eae40d9b16",
        "name": "",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "name": "item",
                "type": "16bitbe",
                "length": 1,
                "dataType": "msg",
                "data": "payload"
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "x": 530,
        "y": 860,
        "wires": [
            [
                "1ba547f613be6c37",
                "e4d51083c499ed6b"
            ]
        ]
    },
    {
        "id": "92a51f536e7e6749",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 3",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 900,
        "y": 860,
        "wires": []
    },
    {
        "id": "78fd34b963570baa",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 1",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 520,
        "y": 800,
        "wires": []
    },
    {
        "id": "1ba547f613be6c37",
        "type": "buffer-parser",
        "z": "398c06eae40d9b16",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "decimal",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 730,
        "y": 920,
        "wires": [
            [
                "92a51f536e7e6749",
                "b73e42575fa058c8"
            ]
        ]
    },
    {
        "id": "e4d51083c499ed6b",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 2",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 720,
        "y": 860,
        "wires": []
    },
    {
        "id": "b73e42575fa058c8",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "modbus",
        "func": "var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 920,
        "y": 920,
        "wires": [
            [
                "566ea7874d27f4bc",
                "f50f5869793d234f"
            ]
        ]
    },
    {
        "id": "566ea7874d27f4bc",
        "type": "modbus-flex-write",
        "z": "398c06eae40d9b16",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "server": "0e3ec676f3e39293",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1130,
        "y": 920,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "f50f5869793d234f",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 4",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1100,
        "y": 860,
        "wires": []
    },
    {
        "id": "fe50bf89f9cdc72d",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "update Context",
        "func": "let ps = flow.get(\"pumpStatus\")\n\nps = [[ps.Remote, ps.Deaerating, ps.AnalogMode, ps.TimerMode, ps.SlowMode, ps.Velocity, false, false]]\n\nif (msg.topic === \"Remote\") {\n    ps[0][0] = msg.payload\n}\nelse if (msg.topic === \"Deaerating\") {\n    ps[0][1] = msg.payload;\n}\nelse if (msg.topic === \"AnalogMode\") {\n    ps[0][2] = msg.payload;\n}\nelse if (msg.topic === \"TimerMode\") {\n    ps[0][3] = msg.payload;\n}\nelse if (msg.topic === \"SlowMode\") {\n    ps[0][4] = msg.payload;\n}\nelse if (msg.topic === \"Velocity\") {\n    ps[0][5] = msg.payload;\n}\n\nmsg.payload = ps;\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 820,
        "wires": [
            [
                "6eb9f2ee9c458b20",
                "78fd34b963570baa"
            ]
        ]
    },
    {
        "id": "fa7c1f04e5714b54",
        "type": "ui_group",
        "name": "Write2",
        "tab": "a42d8adbe9caeb3d",
        "order": 3,
        "disp": false,
        "width": "11",
        "collapse": false
    },
    {
        "id": "0e3ec676f3e39293",
        "type": "modbus-client",
        "name": "CIM500",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.240.6.39",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "a42d8adbe9caeb3d",
        "type": "ui_tab",
        "name": "Pumpe_01",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

Thank you again for the support

So to clarify, you have this "remote" server that has a dashboard with the ui-form and
it collects the switch (true/false) values and sends them with mqtt to the "local" node-red server
and this local server is the one doing the Modbus communication with your pool dosing pump?

I wanted to ask whether the "local" server, needs to send periodically the current status of the pump
so when you have its dashboard open you will know what is enabled or not ?
(otherwise the actual state of the device will be out of sync with what you see on the dashboard)

So to clarify, you have this "remote" server that has a dashboard with the ui-form and
it collects the switch (true/false) values and sends them with mqtt to the "local" node-red server
and this local server is the one doing the Modbus communication with your pool dosing pump?

  • I have a device (my raspy) that is connected to my unit (pump). Here read and write (i hope so) via modbus(node red).

  • Further, my raspy sends the data to my mqtt that is installed on my vm LINUX. From there i display and control via dashboard and node red, which gets and sends the data to mqtt.

Yes, my raspy sends periodically (every 10 seconds) the current state my pump.

I am realy struggling to control the pump via modbus (see posts above) because of the sub-registeradresses and to combine the readingprocess of my mqtt and continuing with the assignment to the correct subadresses.

I manage to get the data from my MQTT (for example where a switch is on or off after pushing submit), store them into concept (like you mentioned above). After that i fail assign the info (via buffer maker and parser) to the correct subadress.

I am so close but still so far=)

Thank you

this Linux vm is it on the same network as your Pi ?
or is it across the internet and thats why you use mqtt to send data between the two systems

we tried to help with that with a simple demo flow .. i was hoping to have some feedback whether modbus worked before complicating the flow with mqtt ,dashboards etc .. so does modbus work with the flow shared above ? if not whats the issue .. any errors ?

this Linux vm is it on the same network as your Pi ?
or is it across the internet and thats why you use mqtt to send data between the two systems

Yes its across the internet. I want to control and monitor my pump from everywhere.

we tried to help with that with a simple demo flow .. i was hoping to have some feedback whether modbus worked before complicating the flow with mqtt ,dashboards etc .. so does modbus work with the flow shared above ? if not whats the issue .. any errors ?

I realy appreciate your help. I used the weekend to learn more and get a better knowledge of the whole situation. So i moved one step back to your old example.
Its kinda works. But i assume there is something mixed up with the subadresses, but i cant figure out what.
When i test your example ( i modiefied it a bit) it sometime works and sometimes not.

  1. Shouldnt the order from "update to context" not be turned around? I changed the order and it kinda works better but not perfect. Here is my updated flow from yours.
[
    {
        "id": "406367a8cccd0b49",
        "type": "modbus-flex-getter",
        "z": "398c06eae40d9b16",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "0e3ec676f3e39293",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 690,
        "y": 340,
        "wires": [
            [
                "6636e571d444708e",
                "db70305a75fdaac2"
            ],
            []
        ]
    },
    {
        "id": "6636e571d444708e",
        "type": "modbus-response",
        "z": "398c06eae40d9b16",
        "name": "",
        "registerShowMax": 20,
        "x": 730,
        "y": 260,
        "wires": []
    },
    {
        "id": "5f3949435c3983c2",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "Read_101",
        "func": "msg.payload =\n{\n    value: msg.payload,\n    'fc': 3,\n    'unitid': 0,\n    'address': 100,\n    'quantity': 1\n\n};\nreturn msg",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 280,
        "wires": [
            [
                "406367a8cccd0b49"
            ]
        ]
    },
    {
        "id": "e1c6ae3f12fe7ab5",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 260,
        "y": 300,
        "wires": [
            [
                "5f3949435c3983c2"
            ]
        ]
    },
    {
        "id": "db70305a75fdaac2",
        "type": "buffer-parser",
        "z": "398c06eae40d9b16",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "bool",
                "name": "Remote_On_Off",
                "offset": 1,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Deaerating",
                "offset": 1,
                "length": 1,
                "offsetbit": 1,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "AnalogueMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 2,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "TimerMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 3,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "SlowMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 4,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Velocity",
                "offset": 1,
                "length": 1,
                "offsetbit": 5,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 920,
        "y": 320,
        "wires": [
            [
                "07cdc99c6d7b4900"
            ]
        ]
    },
    {
        "id": "84a6692e9b57f1dd",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1320,
        "y": 320,
        "wires": []
    },
    {
        "id": "ccc5a49028560832",
        "type": "buffer-maker",
        "z": "398c06eae40d9b16",
        "name": "",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "name": "item",
                "type": "16bitbe",
                "length": 1,
                "dataType": "msg",
                "data": "payload"
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "x": 780,
        "y": 660,
        "wires": [
            [
                "ee52478392e724ed",
                "6ede6957c087f329"
            ]
        ]
    },
    {
        "id": "83f4b59476253daa",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Remote_On_Off true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Remote_On_Off",
        "payload": "true",
        "payloadType": "bool",
        "x": 170,
        "y": 460,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "29a6a1da18d6f18c",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1130,
        "y": 600,
        "wires": []
    },
    {
        "id": "f18ddebf0fbc11aa",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 710,
        "y": 600,
        "wires": []
    },
    {
        "id": "ee52478392e724ed",
        "type": "buffer-parser",
        "z": "398c06eae40d9b16",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "decimal",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 980,
        "y": 660,
        "wires": [
            [
                "29a6a1da18d6f18c",
                "f27122f4335fba31"
            ]
        ]
    },
    {
        "id": "6ede6957c087f329",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 930,
        "y": 600,
        "wires": []
    },
    {
        "id": "f27122f4335fba31",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "modbus",
        "func": "var fc=6;\nvar sa=100;\nvar addresses=1;\nvar value=msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload={\"value\":value , 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1170,
        "y": 660,
        "wires": [
            [
                "c20a1b1a3826d223",
                "a488bc141d960fef"
            ]
        ]
    },
    {
        "id": "c20a1b1a3826d223",
        "type": "modbus-flex-write",
        "z": "398c06eae40d9b16",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "server": "0e3ec676f3e39293",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1380,
        "y": 660,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "a488bc141d960fef",
        "type": "debug",
        "z": "398c06eae40d9b16",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1330,
        "y": 600,
        "wires": []
    },
    {
        "id": "07cdc99c6d7b4900",
        "type": "change",
        "z": "398c06eae40d9b16",
        "name": "save to Context",
        "rules": [
            {
                "t": "set",
                "p": "pumpStatus",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1110,
        "y": 320,
        "wires": [
            [
                "84a6692e9b57f1dd"
            ]
        ]
    },
    {
        "id": "9ac8e0f1a34ae08a",
        "type": "function",
        "z": "398c06eae40d9b16",
        "name": "update Context",
        "func": "let ps = flow.get(\"pumpStatus\")\n\nps = [[ps.Remote_On_Off, ps.Deaerating, ps.AnalogueMode, ps.TimerMode, ps.SlowMode, ps.Velocity, false, false]]\n\nif (msg.topic === \"Remote_On_Off\") {\n    ps[0][0] = msg.payload\n}\nelse if (msg.topic === \"Deaerating\") {\n    ps[0][1] = msg.payload;\n}\nelse if (msg.topic === \"AnalogueMode\") {\n    ps[0][2] = msg.payload;\n}\nelse if (msg.topic === \"TimerMode\") {\n    ps[0][3] = msg.payload;\n}\nelse if (msg.topic === \"SlowMode\") {\n    ps[0][4] = msg.payload;\n}\nelse if (msg.topic === \"Velocity\") {\n    ps[0][5] = msg.payload;\n}\n\nmsg.payload = ps;\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 660,
        "wires": [
            [
                "ccc5a49028560832",
                "f18ddebf0fbc11aa"
            ]
        ]
    },
    {
        "id": "fb63aea79fb63e00",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Remote_On_Off false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Remote_On_Off",
        "payload": "false",
        "payloadType": "bool",
        "x": 180,
        "y": 500,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "4066737add22366f",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Deaerating true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Deaerating",
        "payload": "true",
        "payloadType": "bool",
        "x": 160,
        "y": 600,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "3e5dc00542800690",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Deaerating false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Deaerating",
        "payload": "false",
        "payloadType": "bool",
        "x": 160,
        "y": 640,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "19653da55e4aca1d",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "AnalogueMode true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "AnalogueMode",
        "payload": "true",
        "payloadType": "bool",
        "x": 170,
        "y": 740,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "851b63f46e76b593",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "AnalogueMode false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "AnalogueMode",
        "payload": "false",
        "payloadType": "bool",
        "x": 170,
        "y": 780,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "56acf3b8102cdd1a",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "TimerMode true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "TimerMode",
        "payload": "true",
        "payloadType": "bool",
        "x": 160,
        "y": 880,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "ee96fa602c619ad0",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "TimerMode false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "TimerMode",
        "payload": "false",
        "payloadType": "bool",
        "x": 160,
        "y": 920,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "4e53cdb693f4dc93",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "SlowMode true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "SlowMode",
        "payload": "true",
        "payloadType": "bool",
        "x": 160,
        "y": 1000,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "80131d27a1a4ce94",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "SlowMode false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "SlowMode",
        "payload": "false",
        "payloadType": "bool",
        "x": 160,
        "y": 1040,
        "wires": [
            []
        ]
    },
    {
        "id": "0340f6a908835b4e",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Velocity true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Velocity",
        "payload": "true",
        "payloadType": "bool",
        "x": 150,
        "y": 1120,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "5b1f7927146aa1ad",
        "type": "inject",
        "z": "398c06eae40d9b16",
        "name": "Velocity false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "Velocity",
        "payload": "false",
        "payloadType": "bool",
        "x": 150,
        "y": 1160,
        "wires": [
            [
                "9ac8e0f1a34ae08a"
            ]
        ]
    },
    {
        "id": "0e3ec676f3e39293",
        "type": "modbus-client",
        "name": "CIM500",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.240.6.39",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    }
]

What strange behavior occurs: When i switch remote_On_Off to FALSEand i switch velocity to TRUE, remote_On_Off switched to TRUE

When i switch remote_On_Off to false and i switch Deaerating to ON, remote_On_off swicthed TRUE and Deaerating swicth to true.

When i switch Deaerating to FALSE when Remote_On_Off is FALSE, Remote_On_Off switches to TRUE and Deaerating to FALSE.

Here the adresses again:

So, it kinda works, but i cant find out, where the error is. I looked at it for hours

Thanks again..

From the above i deduct that maybe the device switches the remote_On_Off bit to TRUE whenever it receives a change in any of the other bits (1,2,3,4,5) to show that its being controlled Remotely ?

When you tried the 1st combination ( remote_On_Off FALSE and velocity TRUE )
does velocity actually turn TRUE ?

probably .. thats why i commented in my previous post to get Modbus out of the way .. because different devices translate the data a bit differently with all this byte ordering BE LE etc so its trial and error

When you tried the 1st combination ( remote_On_Off FALSE and velocity TRUE )
does velocity actually turn TRUE ?

Yes.

When i put TimerMode on TRUE and put SlowMode to TRUE (without updating the saving the concept) SlowMode Turns TURE and TimerMode false. I am lost=)

And sometime when i set SLowMode to False, Velocitiy sets also to false.

i do not see a pattern

Is it necessary everytime i change some value, to trigger the save to concept flow?

Indeed .. thats why we need to update Context right after writting a value to the device with Modbus so Node-red will remember what bits are already toggled and use them also with the next write.

Easy fix .. use a pair of Link nodes to re-trigger the Modbus Read (that updates Context)

[{"id":"c721535dbe14f801","type":"buffer-maker","z":"4d0d22cfcd30ef5d","name":"","specification":"spec","specificationType":"ui","items":[{"name":"item","type":"16bitbe","length":1,"dataType":"msg","data":"payload"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":670,"y":780,"wires":[["91a6e41b52751ec1","0fafc93cd2672a9c"]]},{"id":"7eba5a5f968524ed","type":"inject","z":"4d0d22cfcd30ef5d","name":"Remote_On_Off true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Remote_On_Off","payload":"true","payloadType":"bool","x":180,"y":500,"wires":[["0b6fa7541665b215"]]},{"id":"0eb55f626b1781d4","type":"debug","z":"4d0d22cfcd30ef5d","name":"debug 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":720,"wires":[]},{"id":"9ecc9a3d74701285","type":"debug","z":"4d0d22cfcd30ef5d","name":"debug 1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":600,"y":720,"wires":[]},{"id":"91a6e41b52751ec1","type":"buffer-parser","z":"4d0d22cfcd30ef5d","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"decimal","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":870,"y":780,"wires":[["0eb55f626b1781d4","0125409baf5b2626"]]},{"id":"0fafc93cd2672a9c","type":"debug","z":"4d0d22cfcd30ef5d","name":"debug 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":720,"wires":[]},{"id":"0125409baf5b2626","type":"function","z":"4d0d22cfcd30ef5d","name":"modbus","func":"var fc = 6;\nvar sa = 100;\nvar addresses = 1;\nvar value = msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload = { \"value\": value, 'fc': fc, 'unitid': 1, 'address': sa, 'quantity': addresses };\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":780,"wires":[["6ba939dffc4d236a","a45f12e30e575d12"]]},{"id":"6ba939dffc4d236a","type":"modbus-flex-write","z":"4d0d22cfcd30ef5d","name":"","showStatusActivities":true,"showErrors":true,"showWarnings":true,"server":"d1b0c8d03f3ec42a","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":1250,"y":820,"wires":[["4bebcf3e6faf10b7"],[]]},{"id":"a45f12e30e575d12","type":"debug","z":"4d0d22cfcd30ef5d","name":"debug 4","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1220,"y":720,"wires":[]},{"id":"0b6fa7541665b215","type":"function","z":"4d0d22cfcd30ef5d","name":"update Context","func":"let ps = flow.get(\"pumpStatus\")\n\nps = [[ps.Remote_On_Off, ps.Deaerating, ps.AnalogueMode, ps.TimerMode, ps.SlowMode, ps.Velocity, false, false]]\n\nif (msg.topic === \"Remote_On_Off\") {\n    ps[0][0] = msg.payload\n}\nelse if (msg.topic === \"Deaerating\") {\n    ps[0][1] = msg.payload;\n}\nelse if (msg.topic === \"AnalogueMode\") {\n    ps[0][2] = msg.payload;\n}\nelse if (msg.topic === \"TimerMode\") {\n    ps[0][3] = msg.payload;\n}\nelse if (msg.topic === \"SlowMode\") {\n    ps[0][4] = msg.payload;\n}\nelse if (msg.topic === \"Velocity\") {\n    ps[0][5] = msg.payload;\n}\n\nmsg.payload = ps;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":780,"wires":[["c721535dbe14f801","9ecc9a3d74701285"]]},{"id":"f090b95ae87218f8","type":"inject","z":"4d0d22cfcd30ef5d","name":"Remote_On_Off false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Remote_On_Off","payload":"false","payloadType":"bool","x":180,"y":540,"wires":[["0b6fa7541665b215"]]},{"id":"b09a5995ae3068e0","type":"inject","z":"4d0d22cfcd30ef5d","name":"Deaerating true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Deaerating","payload":"true","payloadType":"bool","x":200,"y":620,"wires":[["0b6fa7541665b215"]]},{"id":"204ee94637aebb8d","type":"inject","z":"4d0d22cfcd30ef5d","name":"Deaerating false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Deaerating","payload":"false","payloadType":"bool","x":200,"y":660,"wires":[["0b6fa7541665b215"]]},{"id":"633d13076ba06881","type":"inject","z":"4d0d22cfcd30ef5d","name":"AnalogueMode true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"AnalogueMode","payload":"true","payloadType":"bool","x":190,"y":740,"wires":[["0b6fa7541665b215"]]},{"id":"f33633341903486a","type":"inject","z":"4d0d22cfcd30ef5d","name":"AnalogueMode false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"AnalogueMode","payload":"false","payloadType":"bool","x":190,"y":780,"wires":[["0b6fa7541665b215"]]},{"id":"da20e67eb485f4af","type":"inject","z":"4d0d22cfcd30ef5d","name":"TimerMode true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"TimerMode","payload":"true","payloadType":"bool","x":200,"y":860,"wires":[["0b6fa7541665b215"]]},{"id":"034f056ef6fd5509","type":"inject","z":"4d0d22cfcd30ef5d","name":"TimerMode false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"TimerMode","payload":"false","payloadType":"bool","x":200,"y":900,"wires":[["0b6fa7541665b215"]]},{"id":"abf7b5988fe6e826","type":"inject","z":"4d0d22cfcd30ef5d","name":"SlowMode true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"SlowMode","payload":"true","payloadType":"bool","x":200,"y":980,"wires":[["0b6fa7541665b215"]]},{"id":"8e045715455131b6","type":"inject","z":"4d0d22cfcd30ef5d","name":"SlowMode false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"SlowMode","payload":"false","payloadType":"bool","x":200,"y":1020,"wires":[[]]},{"id":"86dc3ecb06eb449d","type":"inject","z":"4d0d22cfcd30ef5d","name":"Velocity true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Velocity","payload":"true","payloadType":"bool","x":210,"y":1100,"wires":[["0b6fa7541665b215"]]},{"id":"77fd06e2c9035294","type":"inject","z":"4d0d22cfcd30ef5d","name":"Velocity false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Velocity","payload":"false","payloadType":"bool","x":210,"y":1140,"wires":[["0b6fa7541665b215"]]},{"id":"c9f17ea70d347b7e","type":"modbus-flex-getter","z":"4d0d22cfcd30ef5d","name":"","showStatusActivities":true,"showErrors":true,"showWarnings":true,"logIOActivities":false,"server":"d1b0c8d03f3ec42a","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":640,"y":1360,"wires":[["4a0406ee2625177e","9d935e56f854ac5e"],[]]},{"id":"4a0406ee2625177e","type":"modbus-response","z":"4d0d22cfcd30ef5d","name":"","registerShowMax":20,"x":680,"y":1280,"wires":[]},{"id":"ea381f249d4181b0","type":"function","z":"4d0d22cfcd30ef5d","name":"Read_101","func":"msg.payload =\n{\n    value: msg.payload,\n    'fc': 3,\n    'unitid': 1,\n    'address': 100,\n    'quantity': 1\n\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":1300,"wires":[["c9f17ea70d347b7e"]]},{"id":"4d545404f8c5156f","type":"inject","z":"4d0d22cfcd30ef5d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":1300,"wires":[["ea381f249d4181b0"]]},{"id":"9d935e56f854ac5e","type":"buffer-parser","z":"4d0d22cfcd30ef5d","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bool","name":"Remote_On_Off","offset":1,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"bool","name":"Deaerating","offset":1,"length":1,"offsetbit":1,"scale":"1","mask":""},{"type":"bool","name":"AnalogueMode","offset":1,"length":1,"offsetbit":2,"scale":"1","mask":""},{"type":"bool","name":"TimerMode","offset":1,"length":1,"offsetbit":3,"scale":"1","mask":""},{"type":"bool","name":"SlowMode","offset":1,"length":1,"offsetbit":4,"scale":"1","mask":""},{"type":"bool","name":"Velocity","offset":1,"length":1,"offsetbit":5,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":870,"y":1340,"wires":[["90c381e0f3a4338a"]]},{"id":"bfd82082994381b8","type":"debug","z":"4d0d22cfcd30ef5d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1290,"y":1340,"wires":[]},{"id":"90c381e0f3a4338a","type":"change","z":"4d0d22cfcd30ef5d","name":"save to Context","rules":[{"t":"set","p":"pumpStatus","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":1340,"wires":[["bfd82082994381b8"]]},{"id":"4bebcf3e6faf10b7","type":"link out","z":"4d0d22cfcd30ef5d","name":"link out 1","mode":"link","links":["cd120527ab3875f5"],"x":1385,"y":820,"wires":[]},{"id":"cd120527ab3875f5","type":"link in","z":"4d0d22cfcd30ef5d","name":"link in 1","links":["4bebcf3e6faf10b7"],"x":365,"y":1260,"wires":[["ea381f249d4181b0"]]},{"id":"d1b0c8d03f3ec42a","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"192.168.0.66","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]

ps. go to the Context tab to confirm the updates ( you need to refresh to see any changes)

image

thank you very much.

With your edits is works almost.

One error occurs. I cant control the SLowMode part. Somehow when i switch it on or off, nothing happens.
Here i pushed FALSE on SlowMode and this occurs:

d

But from what i can see right now, any other values do what they should do

Edit: when SLowmode is OFF i can it turn ON but not off again

Unil i find out, what causes this trouble with Slowmode, i try to learn now how to combine, the switches on my dashboard and my Node-red write routine.

I created a small node where i read the submited values (from my dashboard) from my mqtt sever.
For the clarity i created only 2 switches. Remote_onOff and Deaerating

I now face the problem, that my writing flow only can process one writing routine (depening on the topic) at the same time
I guess i have to create now a routine where i can somehow process every change after another. Is a buffer parser the way to go? is this the right track?

[
    {
        "id": "c721535dbe14f801",
        "type": "buffer-maker",
        "z": "4b39b758866405c2",
        "name": "",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "name": "item",
                "type": "16bitbe",
                "length": 1,
                "dataType": "msg",
                "data": "payload"
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "x": 670,
        "y": 980,
        "wires": [
            [
                "91a6e41b52751ec1",
                "0fafc93cd2672a9c"
            ]
        ]
    },
    {
        "id": "0eb55f626b1781d4",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "debug 3",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1020,
        "y": 920,
        "wires": []
    },
    {
        "id": "9ecc9a3d74701285",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "debug 1",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 920,
        "wires": []
    },
    {
        "id": "91a6e41b52751ec1",
        "type": "buffer-parser",
        "z": "4b39b758866405c2",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint16be",
                "name": "decimal",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 870,
        "y": 980,
        "wires": [
            [
                "0eb55f626b1781d4",
                "0125409baf5b2626"
            ]
        ]
    },
    {
        "id": "0fafc93cd2672a9c",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "debug 2",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 820,
        "y": 920,
        "wires": []
    },
    {
        "id": "0125409baf5b2626",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "modbus",
        "func": "var fc = 6;\nvar sa = 100;\nvar addresses = 1;\nvar value = msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload = { \"value\": value, 'fc': fc, 'unitid': 1, 'address': sa, 'quantity': addresses };\n\nreturn msg;",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1060,
        "y": 980,
        "wires": [
            [
                "6ba939dffc4d236a",
                "a45f12e30e575d12"
            ],
            []
        ]
    },
    {
        "id": "6ba939dffc4d236a",
        "type": "modbus-flex-write",
        "z": "4b39b758866405c2",
        "name": "",
        "showStatusActivities": true,
        "showErrors": true,
        "server": "0e3ec676f3e39293",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 1270,
        "y": 1020,
        "wires": [
            [
                "4bebcf3e6faf10b7"
            ],
            []
        ]
    },
    {
        "id": "a45f12e30e575d12",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "debug 4",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1240,
        "y": 920,
        "wires": []
    },
    {
        "id": "0b6fa7541665b215",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "update Context",
        "func": "let ps = flow.get(\"pumpStatus\")\n\nps = [[ps.Remote_On_Off, ps.Deaerating, ps.AnalogueMode, ps.TimerMode, ps.SlowMode, ps.Velocity, false, false]]\n\nif (msg.topic === \"Remote_On_Off\") {\n    ps[0][0] = msg.payload\n}\nelse if (msg.topic === \"Deaerating\") {\n    ps[0][1] = msg.payload;\n}\nelse if (msg.topic === \"AnalogueMode\") {\n    ps[0][2] = msg.payload;\n}\nelse if (msg.topic === \"TimerMode\") {\n    ps[0][3] = msg.payload;\n}\nelse if (msg.topic === \"SlowMode\") {\n    ps[0][4] = msg.payload;\n}\nelse if (msg.topic === \"Velocity\") {\n    ps[0][5] = msg.payload;\n}\n\nmsg.payload = ps;\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 1020,
        "wires": [
            [
                "c721535dbe14f801",
                "9ecc9a3d74701285"
            ]
        ]
    },
    {
        "id": "c9f17ea70d347b7e",
        "type": "modbus-flex-getter",
        "z": "4b39b758866405c2",
        "name": "",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "0e3ec676f3e39293",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 970,
        "y": 820,
        "wires": [
            [
                "4a0406ee2625177e",
                "9d935e56f854ac5e"
            ],
            []
        ]
    },
    {
        "id": "4a0406ee2625177e",
        "type": "modbus-response",
        "z": "4b39b758866405c2",
        "name": "",
        "registerShowMax": 20,
        "x": 1010,
        "y": 740,
        "wires": []
    },
    {
        "id": "ea381f249d4181b0",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "Read_101",
        "func": "msg.payload =\n{\n    value: msg.payload,\n    'fc': 3,\n    'unitid': 1,\n    'address': 100,\n    'quantity': 1\n\n};\nreturn msg",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 780,
        "y": 760,
        "wires": [
            [
                "c9f17ea70d347b7e"
            ]
        ]
    },
    {
        "id": "4d545404f8c5156f",
        "type": "inject",
        "z": "4b39b758866405c2",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 520,
        "y": 780,
        "wires": [
            [
                "ea381f249d4181b0"
            ]
        ]
    },
    {
        "id": "9d935e56f854ac5e",
        "type": "buffer-parser",
        "z": "4b39b758866405c2",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "bool",
                "name": "Remote_On_Off",
                "offset": 1,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Deaerating",
                "offset": 1,
                "length": 1,
                "offsetbit": 1,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "AnalogueMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 2,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "TimerMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 3,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "SlowMode",
                "offset": 1,
                "length": 1,
                "offsetbit": 4,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "bool",
                "name": "Velocity",
                "offset": 1,
                "length": 1,
                "offsetbit": 5,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 1200,
        "y": 800,
        "wires": [
            [
                "90c381e0f3a4338a"
            ]
        ]
    },
    {
        "id": "bfd82082994381b8",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1790,
        "y": 800,
        "wires": []
    },
    {
        "id": "90c381e0f3a4338a",
        "type": "change",
        "z": "4b39b758866405c2",
        "name": "save to Context",
        "rules": [
            {
                "t": "set",
                "p": "pumpStatus",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1420,
        "y": 800,
        "wires": [
            [
                "a58c04208804e4c2"
            ]
        ]
    },
    {
        "id": "4bebcf3e6faf10b7",
        "type": "link out",
        "z": "4b39b758866405c2",
        "name": "link out 1",
        "mode": "link",
        "links": [
            "cd120527ab3875f5"
        ],
        "x": 1415,
        "y": 1020,
        "wires": []
    },
    {
        "id": "cd120527ab3875f5",
        "type": "link in",
        "z": "4b39b758866405c2",
        "name": "link in 1",
        "links": [
            "4bebcf3e6faf10b7"
        ],
        "x": 695,
        "y": 720,
        "wires": [
            [
                "ea381f249d4181b0"
            ]
        ]
    },
    {
        "id": "41302f190c9c0d91",
        "type": "mqtt in",
        "z": "4b39b758866405c2",
        "name": "",
        "topic": "CIM500/FORM_W",
        "qos": "2",
        "datatype": "json",
        "broker": "b6502b0e06f48d91",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 520,
        "y": 1300,
        "wires": [
            [
                "2a9df7ee70c73c69"
            ]
        ]
    },
    {
        "id": "0a1ac6fee154746d",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "Deaerating",
        "func": "msg.payload=msg.payload.Deaerating\nmsg.topic= \"Deaerating\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 730,
        "y": 1240,
        "wires": [
            []
        ]
    },
    {
        "id": "2a9df7ee70c73c69",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "Remote_On_Off true",
        "func": "msg.payload=msg.payload.Remote\nmsg.topic= \"Remote_On_Off\";\nreturn msg;\n\n",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 740,
        "y": 1180,
        "wires": [
            [
                "8c019088c567de64"
            ],
            [
                "0a1ac6fee154746d"
            ]
        ]
    },
    {
        "id": "8c019088c567de64",
        "type": "debug",
        "z": "4b39b758866405c2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 970,
        "y": 1280,
        "wires": []
    },
    {
        "id": "a58c04208804e4c2",
        "type": "function",
        "z": "4b39b758866405c2",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 3,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1600,
        "y": 800,
        "wires": [
            [
                "bfd82082994381b8"
            ],
            [],
            []
        ]
    },
    {
        "id": "0e3ec676f3e39293",
        "type": "modbus-client",
        "name": "CIM500",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.240.6.39",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "b6502b0e06f48d91",
        "type": "mqtt-broker",
        "name": "",
        "broker": "185.164.7.227",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    }
]

thank you very much

The submitted values coming from the remote server (through ui-form > mqtt) are in the form ?

{
  "Remote_On_Off":false,
  "Deaerating":false,
  "AnalogueMode":false,
  "TimerMode":true,
  "SlowMode":true,
  "Velocity":false
}

if yes .. then there is no need to process each one separately but make the necessary code change in the Function node to send them all, in the correct true/false array, the buffer nodes expect.
Before the code was different just to test each one individually .. now that you receive the msg from mqtt you can change it ..

Example

[{"id":"e8d7e5b7ad160ba3","type":"buffer-maker","z":"54efb553244c241f","name":"","specification":"spec","specificationType":"ui","items":[{"name":"item","type":"16bitbe","length":1,"dataType":"msg","data":"payload"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":590,"y":2820,"wires":[["548c5c467742b422","fa74d004c5d1bd32"]]},{"id":"d2e7823c490b5951","type":"debug","z":"54efb553244c241f","name":"debug 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":940,"y":2760,"wires":[]},{"id":"23d4333be6b02380","type":"debug","z":"54efb553244c241f","name":"debug 1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":2760,"wires":[]},{"id":"548c5c467742b422","type":"buffer-parser","z":"54efb553244c241f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"decimal","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":790,"y":2820,"wires":[["d2e7823c490b5951","28b452d7a0fed83d"]]},{"id":"fa74d004c5d1bd32","type":"debug","z":"54efb553244c241f","name":"debug 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":2760,"wires":[]},{"id":"28b452d7a0fed83d","type":"function","z":"54efb553244c241f","name":"modbus","func":"var fc = 6;\nvar sa = 100;\nvar addresses = 1;\nvar value = msg.payload.decimal;  // value calculated from buffer-parser\nmsg.slave_ip = \"10.240.6.39\";\n\nmsg.payload = { \"value\": value, 'fc': fc, 'unitid': 1, 'address': sa, 'quantity': addresses };\n\nreturn msg;","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":2820,"wires":[["413fed1f1e4fff1f","3e85f776dae01afd"],[]]},{"id":"413fed1f1e4fff1f","type":"modbus-flex-write","z":"54efb553244c241f","name":"","showStatusActivities":true,"showErrors":true,"server":"0e3ec676f3e39293","emptyMsgOnFail":false,"keepMsgProperties":false,"x":1190,"y":2860,"wires":[["30fd3044f611fa2f"],[]]},{"id":"3e85f776dae01afd","type":"debug","z":"54efb553244c241f","name":"debug 4","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1160,"y":2760,"wires":[]},{"id":"ac25cb758761677b","type":"function","z":"54efb553244c241f","name":"process MQTT","func":"let ps = flow.get(\"pumpStatus\")\n\nps = [[msg.payload.Remote_On_Off, msg.payload.Deaerating, msg.payload.AnalogueMode, msg.payload.TimerMode, msg.payload.SlowMode, msg.payload.Velocity, false, false]]\n\nmsg.payload = ps;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":2820,"wires":[["e8d7e5b7ad160ba3","23d4333be6b02380"]]},{"id":"a17ce8a0f4dbc4be","type":"modbus-flex-getter","z":"54efb553244c241f","name":"","showStatusActivities":true,"showErrors":true,"logIOActivities":false,"server":"0e3ec676f3e39293","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":630,"y":2620,"wires":[["7a6c1048507f381f","401d0bd0aefdd65c"],[]]},{"id":"7a6c1048507f381f","type":"modbus-response","z":"54efb553244c241f","name":"","registerShowMax":20,"x":670,"y":2540,"wires":[]},{"id":"c69af38291ed5350","type":"function","z":"54efb553244c241f","name":"Read_101","func":"msg.payload =\n{\n    value: msg.payload,\n    'fc': 3,\n    'unitid': 1,\n    'address': 100,\n    'quantity': 1\n\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":2560,"wires":[["a17ce8a0f4dbc4be"]]},{"id":"e0f40ada64ebbd1d","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":2580,"wires":[["c69af38291ed5350"]]},{"id":"401d0bd0aefdd65c","type":"buffer-parser","z":"54efb553244c241f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bool","name":"Remote_On_Off","offset":1,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"bool","name":"Deaerating","offset":1,"length":1,"offsetbit":1,"scale":"1","mask":""},{"type":"bool","name":"AnalogueMode","offset":1,"length":1,"offsetbit":2,"scale":"1","mask":""},{"type":"bool","name":"TimerMode","offset":1,"length":1,"offsetbit":3,"scale":"1","mask":""},{"type":"bool","name":"SlowMode","offset":1,"length":1,"offsetbit":4,"scale":"1","mask":""},{"type":"bool","name":"Velocity","offset":1,"length":1,"offsetbit":5,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":860,"y":2600,"wires":[["90bca505d5c3438d"]]},{"id":"6e92964aff312500","type":"debug","z":"54efb553244c241f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1450,"y":2600,"wires":[]},{"id":"90bca505d5c3438d","type":"change","z":"54efb553244c241f","name":"save to Context","rules":[{"t":"set","p":"pumpStatus","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":2600,"wires":[["db16e8cc24fdf9ef"]]},{"id":"30fd3044f611fa2f","type":"link out","z":"54efb553244c241f","name":"link out 1","mode":"link","links":["c259c9c6e5f2f21a"],"x":1335,"y":2860,"wires":[]},{"id":"c259c9c6e5f2f21a","type":"link in","z":"54efb553244c241f","name":"link in 1","links":["30fd3044f611fa2f"],"x":355,"y":2520,"wires":[["c69af38291ed5350"]]},{"id":"21894a25d4b9b9dc","type":"mqtt in","z":"54efb553244c241f","name":"","topic":"CIM500/FORM_W","qos":"2","datatype":"json","broker":"b5a7c2060fae401c","nl":false,"rap":true,"rh":0,"inputs":0,"x":170,"y":2820,"wires":[["ac25cb758761677b"]]},{"id":"db16e8cc24fdf9ef","type":"function","z":"54efb553244c241f","name":"","func":"\nreturn msg;","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":2600,"wires":[["6e92964aff312500"],[],[]]},{"id":"0e3ec676f3e39293","type":"modbus-client","name":"CIM500","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.240.6.39","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"b5a7c2060fae401c","type":"mqtt-broker","name":"","broker":"185.164.7.227","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

the pump is Grundfos ? i tried to read a bit about it but didnt find anything in the manual. probably you have to contact the supplier

1 Like

it works so far, thank you so much for the support!

yes its a grundfos pump. they are a bit modest with docus. i will post my progress.

1 Like