Riden RD60xx modbus dashboard

Riden RD60xx modbus dashboard

Gets readings from the power supply into node-red where it can be shown on a web dashboard. It works by polling the serial port with the modbus protocol. The dashboard is visible from http://your-node-red-server:1880/ui.

This is set up easiest by plugging a Raspberry Pi (Zero W) into the front usb port. With the power supply as the only thing plugged in, it appears as /dev/ttyUSB0.

Connecting the serial port causes the power supply to disable panel buttons. Work around this by upgrading to the Unisoft firmware, and then in the Settings tab, enable "Skip keys lock".

Note: this currently only does read operations.

image

[{"id":"3bd7b0e607868fef","type":"tab","label":"riden rd60xx modbus","disabled":false,"info":"","env":[]},{"id":"35ac33b9b1ef1988","type":"modbus-read","z":"3bd7b0e607868fef","name":"rd60xx","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"1","quantity":"84","rate":"100","rateUnit":"ms","delayOnStart":false,"startDelayTime":"","server":"a57872645490eb1a","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":270,"y":380,"wires":[["620bd3ec97b35974","066b9a661db75edd"],[]]},{"id":"620bd3ec97b35974","type":"debug","z":"3bd7b0e607868fef","d":true,"name":"debugger","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"responseBuffer","targetType":"msg","statusVal":"","statusType":"auto","x":580,"y":720,"wires":[]},{"id":"36a42df51918322b","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":7,"width":0,"height":0,"name":"output-voltage","label":"","format":"{{msg.payload.toFixed(3)}}V","layout":"col-center","className":"","x":920,"y":420,"wires":[]},{"id":"70bc362a68e1ac19","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":8,"width":0,"height":0,"name":"output-current","label":"","format":"{{msg.payload.toFixed(3)}}A","layout":"col-center","className":"","x":920,"y":460,"wires":[]},{"id":"66b620c61ce658c8","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":9,"width":0,"height":0,"name":"output-energy","label":"","format":"{{msg.payload.toFixed(3)}}W","layout":"col-center","className":"","x":920,"y":500,"wires":[]},{"id":"d07a6ead25d96e40","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":13,"width":0,"height":0,"name":"total-power","label":"","format":"{{msg.payload}}Ah","layout":"col-center","className":"","x":910,"y":620,"wires":[]},{"id":"83e8f0e885ee2ea4","type":"ui_chart","z":"3bd7b0e607868fef","d":true,"name":"combined","group":"567281331260a160","order":1,"width":"10","height":"11","label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#0fff2b","#00e9fa","#c905ff","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":900,"y":180,"wires":[[]]},{"id":"066b9a661db75edd","type":"function","z":"3bd7b0e607868fef","name":"outputs","func":"const type = msg.payload[0] / 10;\nconst is601x = type >= 6010 && type <= 6019;\nconst currentFactor = is601x ? 100.0 : 1000.0;\nconst voltage = msg.payload[9] / 100.0;\nconst current = msg.payload[10] / currentFactor;\nreturn [\n    {topic:\"Voltage\", payload: voltage },\n    {topic:\"Current\", payload: current },\n    {topic:\"Energy\", payload: voltage * current },\n    {topic:\"Power\", payload: msg.payload[13] / 100.0 },\n    {topic:\"SetVoltage\", payload: msg.payload[7] / 100.0 },\n    {topic:\"SetCurrent\", payload: msg.payload[8] / currentFactor },\n    {topic:\"TotalEnergy\", payload: (msg.payload[39] <<16 | msg.payload[38]) / 1000.0  },\n    {topic:\"TotalPower\", payload: (msg.payload[41] <<16 | msg.payload[40]) / currentFactor },\n    {topic:\"OutputState\", payload: msg.payload[17] === 1 }\n];","outputs":9,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":360,"wires":[["83e8f0e885ee2ea4","36a42df51918322b","02f5b9f23889ca6d"],["83e8f0e885ee2ea4","70bc362a68e1ac19","5c91ac346bcf463b"],["83e8f0e885ee2ea4","d3ee429d777f0bcc","66b620c61ce658c8"],[],["6c154de9dbaba980"],["0e70f3380d191f3c"],["d07a6ead25d96e40"],["25466626d6410636"],["432a8c94331c30b8"]]},{"id":"6c154de9dbaba980","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":3,"width":0,"height":0,"name":"set-voltage","label":"","format":"{{msg.payload.toFixed(2)}}V","layout":"col-center","className":"","x":910,"y":780,"wires":[]},{"id":"0e70f3380d191f3c","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":4,"width":0,"height":0,"name":"set-current","label":"","format":"{{msg.payload.toFixed(3)}}A","layout":"col-center","className":"","x":910,"y":820,"wires":[]},{"id":"9a1badc89b33f11f","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":6,"width":0,"height":0,"name":"output-title","label":"OUTPUT","format":"","layout":"col-center","className":"","x":910,"y":380,"wires":[]},{"id":"3c4d26c4bbf8cf2c","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":2,"width":0,"height":0,"name":"set-title","label":"SET","format":"","layout":"col-center","className":"","x":900,"y":740,"wires":[]},{"id":"b9e7b6826e39a7d8","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":12,"width":0,"height":0,"name":"total-title","label":"TOTAL","format":"","layout":"col-center","className":"","x":900,"y":580,"wires":[]},{"id":"25466626d6410636","type":"ui_text","z":"3bd7b0e607868fef","group":"7210c7815e3c8ff4","order":14,"width":0,"height":0,"name":"total-energy","label":"","format":"{{msg.payload}}Wh","layout":"col-center","className":"","x":910,"y":660,"wires":[]},{"id":"02f5b9f23889ca6d","type":"ui_chart","z":"3bd7b0e607868fef","name":"voltage","group":"567281331260a160","order":2,"width":"10","height":"4","label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1ae000","#aec7e8","#0fff2b","#00e9fa","#c905ff","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":900,"y":220,"wires":[[]]},{"id":"5c91ac346bcf463b","type":"ui_chart","z":"3bd7b0e607868fef","name":"current","group":"567281331260a160","order":3,"width":"10","height":"4","label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#29ecfa","#aec7e8","#0fff2b","#00e9fa","#c905ff","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":900,"y":260,"wires":[[]]},{"id":"d3ee429d777f0bcc","type":"ui_chart","z":"3bd7b0e607868fef","name":"energy","group":"567281331260a160","order":4,"width":"10","height":"4","label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#de07ed","#aec7e8","#0fff2b","#00e9fa","#c905ff","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":890,"y":300,"wires":[[]]},{"id":"432a8c94331c30b8","type":"ui_switch","z":"3bd7b0e607868fef","name":"","label":"Output","tooltip":"","group":"7210c7815e3c8ff4","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"className":"","x":890,"y":880,"wires":[[]]},{"id":"596c4f2e166c3c00","type":"ui_spacer","z":"3bd7b0e607868fef","name":"spacer","group":"7210c7815e3c8ff4","order":5,"width":1,"height":1},{"id":"62e24846c2f17239","type":"ui_spacer","z":"3bd7b0e607868fef","name":"spacer","group":"7210c7815e3c8ff4","order":10,"width":1,"height":1},{"id":"7cf50a11a43f330e","type":"ui_spacer","z":"3bd7b0e607868fef","name":"spacer","group":"7210c7815e3c8ff4","order":11,"width":1,"height":1},{"id":"a57872645490eb1a","type":"modbus-client","name":"riden-rd60xx","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"115200","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"7210c7815e3c8ff4","type":"ui_group","name":"SIDEBAR","tab":"08759d43d604f9bc","order":2,"disp":false,"width":"2","collapse":false,"className":""},{"id":"567281331260a160","type":"ui_group","name":"Main","tab":"08759d43d604f9bc","order":1,"disp":false,"width":"10","collapse":false,"className":""},{"id":"08759d43d604f9bc","type":"ui_tab","name":"Riden RD60xx","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Flow Info

Created 4 years, 1 month ago
Rating:

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x1)
Other
  • modbus-client (x1)
  • modbus-read (x1)
  • tab (x1)
  • ui_chart (x4)
  • ui_group (x2)
  • ui_spacer (x3)
  • ui_switch (x1)
  • ui_tab (x1)
  • ui_text (x10)

Tags

  • riden
  • rd6006
  • raspberry-pi
  • modbus
  • dashboard
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option