So the settings you need in the buffer parser are NO SWAP
and use the BIG ENDIAN
(be) functions...
Yes, yes, and yes...
[{"id":"dba0f9a0.21afa8","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":360,"wires":[["6eb5eb5c.6984c4","b4c957d.a86dba8","47286846.5b20c8","c938e90a.ef2b38"]]},{"id":"6eb5eb5c.6984c4","type":"modbus-getter","z":"a605bf7e.09445","name":"30773 ~ 30869","showStatusActivities":false,"showErrors":true,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30773","quantity":"96","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":280,"wires":[["c49c1095.5511b","841e26c7.739b58"],[]]},{"id":"b4c957d.a86dba8","type":"modbus-getter","z":"a605bf7e.09445","name":"30953 ~ 30955","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30953","quantity":"2","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":360,"wires":[["5db7c6a0.c8bbe8","929cd654.324a78"],[]]},{"id":"47286846.5b20c8","type":"modbus-getter","z":"a605bf7e.09445","name":"31253 ~ 31259","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31253","quantity":"6","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":440,"wires":[["c57020b8.f203f","e3a62aee.437e18"],[]]},{"id":"c938e90a.ef2b38","type":"modbus-getter","z":"a605bf7e.09445","name":"31447 ~ 31499","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31447","quantity":"52","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":520,"wires":[["1cbe3f09.d66c41","94e91a35.a25ff8"],[]]},{"id":"c49c1095.5511b","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"PDC2","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"PAC2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"Pbez","offset":184,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"Pein","offset":188,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":280,"wires":[["2dc6cfe8.e3b2a","e5a74da9.d9a4a","937504b6.9650e8","daf78158.70ee9","1b3a46a6.569529"]]},{"id":"5db7c6a0.c8bbe8","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"T2","offset":0,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"swap16","swap3":"swap32","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":360,"wires":[["da8c3c36.a8aa1","bdc43ef9.2684c"]]},{"id":"c57020b8.f203f","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"UL1","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL3","offset":8,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":440,"wires":[["5d151875.5d3d48","b3c044a6.6e6458","436f3d5c.30be54","f4b04c08.49eb1"]]},{"id":"1cbe3f09.d66c41","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"Hz","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"var","offset":100,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":520,"wires":[["b7049802.006068","63c9e641.965d88","d6bac605.18e9a8"]]},{"id":"2dc6cfe8.e3b2a","type":"debug","z":"a605bf7e.09445","name":"parser1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":120,"wires":[]},{"id":"e5a74da9.d9a4a","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":1,"width":0,"height":0,"name":"P-ein","label":"<font color=green> Leistung Einspeisung","format":"{{msg.payload.Pein}} W","layout":"row-spread","x":830,"y":160,"wires":[]},{"id":"937504b6.9650e8","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":2,"width":0,"height":0,"name":"P-bez","label":"<font color=red> Leistung Bezug","format":"{{msg.payload.Pbez}} W","layout":"row-spread","x":830,"y":200,"wires":[]},{"id":"daf78158.70ee9","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":1,"width":0,"height":0,"name":"P-AC2","label":"Leistung AC","format":"{{msg.payload.PAC2}} W","layout":"row-spread","x":830,"y":240,"wires":[]},{"id":"1b3a46a6.569529","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":2,"width":0,"height":0,"name":"P-DC2","label":"<font color=orange> Leistung DC","format":"{{msg.payload.PDC2}} W","layout":"row-spread","x":830,"y":280,"wires":[]},{"id":"da8c3c36.a8aa1","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"T2","label":"Temperatur","format":"{{msg.payload.T2}} °C","layout":"row-spread","x":830,"y":380,"wires":[]},{"id":"bdc43ef9.2684c","type":"debug","z":"a605bf7e.09445","name":"parser2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":340,"wires":[]},{"id":"5d151875.5d3d48","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":3,"width":0,"height":0,"name":"U-L1","label":"Spannung L1","format":"{{msg.payload.UL1}} V","layout":"row-spread","x":830,"y":480,"wires":[]},{"id":"b3c044a6.6e6458","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":4,"width":0,"height":0,"name":"U-L2","label":"Spannung L2","format":"{{msg.payload.UL2}} V","layout":"row-spread","x":830,"y":520,"wires":[]},{"id":"436f3d5c.30be54","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":5,"width":0,"height":0,"name":"U-L3","label":"Spannung L3","format":"{{msg.payload.UL3}} V","layout":"row-spread","x":830,"y":560,"wires":[]},{"id":"f4b04c08.49eb1","type":"debug","z":"a605bf7e.09445","name":"parser3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":440,"wires":[]},{"id":"b7049802.006068","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":6,"width":0,"height":0,"name":"Hz","label":"Frequenz","format":"{{msg.payload}} Hz","layout":"row-spread","x":830,"y":660,"wires":[]},{"id":"63c9e641.965d88","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"var","label":"Blindleistung","format":"{{msg.payload}} var","layout":"row-spread","x":830,"y":700,"wires":[]},{"id":"d6bac605.18e9a8","type":"debug","z":"a605bf7e.09445","name":"parser4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":620,"wires":[]},{"id":"737d118c.a9597","type":"comment","z":"a605bf7e.09445","name":"STP6.0-3AV-40","info":"","x":140,"y":320,"wires":[]},{"id":"f6b1a0c2.05d6a","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":240,"wires":[["e7e75d67.fa569"]],"l":false},{"id":"e7e75d67.fa569","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nreturn { \"topic\": \"df8249b3.d3713\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168c7\", \n\"payload\": [0, 1450, 0, 1437, 0, 477, 0, 475, 0, 485, 0, 23102, 0, 23162, 0, 23264, 0, 40102, 0, 40124, 0, 40188, 0, 6355, 65535, 65535, 65535, 65535, 65535, 65535, 0, 5000, 32768, 0, 65535, 65441, 65535, 65435, 65535, 65440, 0, 1466, 0, 489, 0, 488, 0, 497, 65535, 65535, 255, 65533, 255, 65533, 0, 0, 0, 0, 32768, 0, 255, 65533, 0, 1079, 0, 6000, 0, 100, 65535, 65535, 32768, 0, 65535, 65535, 65535, 65535, 32768, 0, 65535, 65535, 255, 65533, 65535, 65535, 32768, 0, 255, 65533, 32768, 0, 65535, 65535, 0, 0, 0, 1697], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 0 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"30773\", \"quantity\": \"96\", \"messageId\": \"5f6f2b6d4a6d37a91c8168c7\" }, \"responseBuffer\": { \"data\": [0, 1450, 0, 1437, 0, 477, 0, 475, 0, 485, 0, 23102, 0, 23162, 0, 23264, 0, 40102, 0, 40124, 0, 40188, 0, 6355, 65535, 65535, 65535, 65535, 65535, 65535, 0, 5000, 32768, 0, 65535, 65441, 65535, 65435, 65535, 65440, 0, 1466, 0, 489, 0, 488, 0, 497, 65535, 65535, 255, 65533, 255, 65533, 0, 0, 0, 0, 32768, 0, 255, 65533, 0, 1079, 0, 6000, 0, 100, 65535, 65535, 32768, 0, 65535, 65535, 65535, 65535, 32768, 0, 65535, 65535, 255, 65533, 65535, 65535, 32768, 0, 255, 65533, 32768, 0, 65535, 65535, 0, 0, 0, 1697], \n\"buffer\": Buffer.from([0, 0, 5, 170, 0, 0, 5, 157, 0, 0, 1, 221, 0, 0, 1, 219, 0, 0, 1, 229, 0, 0, 90, 62, 0, 0, 90, 122, 0, 0, 90, 224, 0, 0, 156, 166, 0, 0, 156, 188, 0, 0, 156, 252, 0, 0, 24, 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 19, 136, 128, 0, 0, 0, 255, 255, 255, 161, 255, 255, 255, 155, 255, 255, 255, 160, 0, 0, 5, 186, 0, 0, 1, 233, 0, 0, 1, 232, 0, 0, 1, 241, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 255, 255, 253, 0, 0, 4, 55, 0, 0, 23, 112, 0, 0, 0, 100, 255, 255, 255, 255, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 253, 255, 255, 255, 255, 128, 0, 0, 0, 0, 255, 255, 253, 128, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 6, 161]) }, \"_msgid\": \"69b494d7.52af2c\" };","outputs":1,"noerr":0,"x":430,"y":240,"wires":[["c49c1095.5511b","841e26c7.739b58"]]},{"id":"b55d4f3d.df621","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nvar m = {\"topic\":\"5909172b.d6bb18\",\"messageId\":\"5f6f2b6d4a6d37a91c8168c8\",\"payload\":[0,364],\"queueLengthByUnitId\":{\"unitId\":3,\"queueLength\":1},\"queueUnitId\":3,\"unitId\":3,\"modbusRequest\":{\"value\":1601121133656,\"unitid\":\"\",\"fc\":4,\"address\":\"30953\",\"quantity\":\"2\",\"messageId\":\"5f6f2b6d4a6d37a91c8168c8\"},\"responseBuffer\":{\"data\":[0,364],\"buffer\":[0,0,1,108]},\"_msgid\":\"251472d0.ce518e\"}\nm.responseBuffer.buffer = Buffer.from([0,0,1,108])\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":320,"wires":[["5db7c6a0.c8bbe8","929cd654.324a78"]]},{"id":"8c2e5572.2137c8","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":320,"wires":[["b55d4f3d.df621"]],"l":false},{"id":"83a41576.2a8328","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nvar m = { \"topic\": \"5f9e2884.d556c8\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168c9\", \n\"payload\": [0, 23354, 0, 23378, 0, 23541], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 2 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"31253\", \"quantity\": \"6\", \"messageId\": \"5f6f2b6d4a6d37a91c8168c9\" }, \"responseBuffer\": { \"data\": [0, 23354, 0, 23378, 0, 23541], \"buffer\": Buffer.from([0, 0, 91, 58, 0, 0, 91, 82, 0, 0, 91, 245]) }, \"_msgid\": \"4b84a5f0.bf6a0c\" }\n\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":400,"wires":[["c57020b8.f203f","e3a62aee.437e18"]]},{"id":"c88edd8e.40a5f","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":400,"wires":[["83a41576.2a8328"]],"l":false},{"id":"459de81e.286c98","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\n\n\n\n\nvar m = { \"topic\": \"b256ea3f.ead7c\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168ca\", \n\"payload\": [0, 4999, 65535, 65535, 65535, 65535, 65535, 65535, 0, 1875, 65535, 65535, 65535, 65535, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 255, 65533, 255, 65533, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 0, 0, 0, 0, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 65535, 65244], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 3 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"31447\", \"quantity\": \"52\", \"messageId\": \"5f6f2b6d4a6d37a91c8168ca\" }, \"responseBuffer\": { \"data\": [0, 4999, 65535, 65535, 65535, 65535, 65535, 65535, 0, 1875, 65535, 65535, 65535, 65535, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 255, 65533, 255, 65533, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 0, 0, 0, 0, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 65535, 65244], \"buffer\": [0, 0, 19, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 7, 83, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 255, 255, 254, 220] }, \"_msgid\": \"a5a6c72b.80cb98\" }\nm.responseBuffer.buffer = Buffer.from([0, 0, 19, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 7, 83, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 255, 255, 254, 220])\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":480,"wires":[["1cbe3f09.d66c41","94e91a35.a25ff8"]]},{"id":"690f13c8.cfb26c","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":480,"wires":[["459de81e.286c98"]],"l":false},{"id":"94e91a35.a25ff8","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":480,"wires":[]},{"id":"929cd654.324a78","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":320,"wires":[]},{"id":"841e26c7.739b58","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":240,"wires":[]},{"id":"e3a62aee.437e18","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":400,"wires":[]},{"id":"7b9a0315.71ca9c","type":"modbus-client","z":"","name":"STP6.0","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.168.50","tcpPort":"502","tcpType":"TPC-RTU-BUFFERED","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":3,"commandDelay":200,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"8a11e8c7.342528","type":"ui_group","z":"","name":"Energy Meter","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"5be273cb.ceaddc","type":"ui_group","z":"","name":"Sunny Tripower","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"78892c6f.892384","type":"ui_tab","z":"","name":"Photovoltaik","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
NOTES...
- Read the manual - especially
3.5.7 SMA Data Types
and 3.5.8 SMA Data Formats
- the idea behind grouping modbus reads & using the buffer parser and using an offset reduces comms, improves performance and simplifies data - HOWEVER you need to be aware of the data sizes, data tyes & byte offsets to get the correct value.
e.g. if you need 30447 (SINT) & 30449 (UINT32) then read 4 items, offset 0
will have the value of 30447 and offset 4
will have the value of 30449