GVC Posted January 2, 2023 Share Posted January 2, 2023 Thanks to @Bloubul7and all the other contributors. This is my HA dashboard. It has all I need to view at a glance. (PS: really impressed with the Sunsynk) jasweb, Scorp007, RocketBoy and 6 others 6 3 Quote Link to comment Share on other sites More sharing options...
BritishRacingGreen Posted January 2, 2023 Share Posted January 2, 2023 14 minutes ago, GVC said: Thanks to @Bloubul7and all the other contributors. This is my HA dashboard. It has all I need to view at a glance. (PS: really impressed with the Sunsynk) I want to add, that 3 metrics exposed on the top, thats some good ergonomics. It just eases and routes the eye towards the important stuff. Pity that 7 and 10 inch TFT displays are expensive, would be great to have that on permanent display. GVC and Steve87 1 1 Quote Link to comment Share on other sites More sharing options...
GVC Posted January 2, 2023 Share Posted January 2, 2023 (edited) For sure.... That is the custom Flex-Horseshoe-Card. Been using it since a couple of inverters ago. Edit: I am running it on an old 27-inch Dell monitor. Edited January 2, 2023 by GVC ScanlanGP 1 Quote Link to comment Share on other sites More sharing options...
Saliegh Posted January 2, 2023 Share Posted January 2, 2023 1 hour ago, GVC said: Thanks to @Bloubul7and all the other contributors. This is my HA dashboard. It has all I need to view at a glance. (PS: really impressed with the Sunsynk) This is pretty. Care to share the dashboard json? Quote Link to comment Share on other sites More sharing options...
GVC Posted January 2, 2023 Share Posted January 2, 2023 Sure.... how do I do that? Quote Link to comment Share on other sites More sharing options...
GVC Posted January 2, 2023 Share Posted January 2, 2023 (edited) Think I figured it out. Copied the Raw Config file. EDIT: Open the file at the bottom with notepad or Text Editor. Copy and paste in Dashboard "Raw configuration editor" You need to install the following custom cards: card-mod Flexible Horseshoe card Layout card Atomic Calendar Revive card Mushroom card Plotly Graph card Sunsynk card (manual download from @slipx Home Assistant Dashboard Edited January 2, 2023 by GVC Added resources iiznh, RhysMcW, Durran and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
Saliegh Posted January 2, 2023 Share Posted January 2, 2023 41 minutes ago, GVC said: Think I figured it out. Copied the Raw Config file. EDIT: Open the file at the bottom with notepad or Text Editor. Copy and paste in Dashboard "Raw configuration editor" You need to install the following custom cards: card-mod Flexible Horseshoe card Layout card Atomic Calendar Revive card Mushroom card Plotly Graph card Sunsynk card (manual download from @slipx Home Assistant Dashboard 50.37 kB · 1 download Nice one, thanks! GVC 1 Quote Link to comment Share on other sites More sharing options...
slipx Posted January 2, 2023 Share Posted January 2, 2023 (edited) On 2023/01/02 at 7:30 AM, GVC said: Thanks to @Bloubul7and all the other contributors. This is my HA dashboard. It has all I need to view at a glance. (PS: really impressed with the Sunsynk) Thanks for sharing. Did not know about the horseshoe or plotly cards. Added to Dashboard Edited January 3, 2023 by slipx abeetude, system32, GVC and 2 others 4 1 Quote Link to comment Share on other sites More sharing options...
GVC Posted January 3, 2023 Share Posted January 3, 2023 That is one good looking dashboard... Quote Link to comment Share on other sites More sharing options...
shaulf Posted January 5, 2023 Share Posted January 5, 2023 Wow slipx! please can you share your dash with me- it's proper! On 2023/01/02 at 9:02 PM, slipx said: Thanks for sharing. Did not know about the horseshoe or plotly cards. Added to Dashboard Quote Link to comment Share on other sites More sharing options...
slipx Posted January 8, 2023 Share Posted January 8, 2023 Thanks. I've shared via PM Quote Link to comment Share on other sites More sharing options...
slipx Posted January 9, 2023 Share Posted January 9, 2023 Does anyone know which modbus registers give you the monthly and yearly stats for PV, Load, Grid etc ? Quote Link to comment Share on other sites More sharing options...
Sc00bs Posted January 9, 2023 Share Posted January 9, 2023 This post was recognized by Energy-Jason! Sc00bs was awarded the badge 'Helpful' and 50 points. 1 hour ago, slipx said: Does anyone know which modbus registers give you the monthly and yearly stats for PV, Load, Grid etc ? These might help, attached the latest Modbus register I could find as well. Modbus储能-组串-微逆宁波德业V118 (2).pdf slipx 1 Quote Link to comment Share on other sites More sharing options...
Durran Posted January 16, 2023 Share Posted January 16, 2023 On 2023/01/08 at 5:20 PM, slipx said: Thanks. I've shared via PM ...can you share a bit wider, this is awesome!! Quote Link to comment Share on other sites More sharing options...
slipx Posted January 16, 2023 Share Posted January 16, 2023 Sent you a pm but you can download the card by following the instructions below Durran 1 Quote Link to comment Share on other sites More sharing options...
RocketBoy Posted January 17, 2023 Share Posted January 17, 2023 I hate asking stuff like this, but without reading through all 25 pages... does anyone know of a good USB-RS485 cable to get for communicating with the Sunsynks? Im most likely going to use it through a Raspberry pi. Quote Link to comment Share on other sites More sharing options...
kellerza Posted January 17, 2023 Share Posted January 17, 2023 50 minutes ago, RocketBoy said: without reading through all 25 pages... Read the link in my signature. There are even pictures RocketBoy 1 Quote Link to comment Share on other sites More sharing options...
Sc00bs Posted January 17, 2023 Share Posted January 17, 2023 1 hour ago, RocketBoy said: I hate asking stuff like this, but without reading through all 25 pages... does anyone know of a good USB-RS485 cable to get for communicating with the Sunsynks? Im most likely going to use it through a Raspberry pi. Lol, and that ain't the half of it. There are good instructions on getting it to work on @kellerza 's Github page https://github.com/kellerza/sunsynk Durran, kellerza and RocketBoy 3 Quote Link to comment Share on other sites More sharing options...
ridwan Posted January 17, 2023 Share Posted January 17, 2023 It a bit expensive, but the victron cable worked very well for me. Quote Link to comment Share on other sites More sharing options...
JuanH Posted January 17, 2023 Share Posted January 17, 2023 3 hours ago, RocketBoy said: I hate asking stuff like this, but without reading through all 25 pages... does anyone know of a good USB-RS485 cable to get for communicating with the Sunsynks? Im most likely going to use it through a Raspberry pi. I went through all the suggestions. This was the one that was easiest and worked the best for me: https://solar-assistant.io/shop/products/sunsynk_rs485 Quote Link to comment Share on other sites More sharing options...
kellerza Posted January 18, 2023 Share Posted January 18, 2023 22 hours ago, JuanH said: I went through all the suggestions. This was the one that was easiest and worked the best for me: https://solar-assistant.io/shop/products/sunsynk_rs485 There is probably nothing wrong with the cable, but if I see a pre made-up cable, I always wonder: Do you cut the connector off to route the cable through sprague & the cable glands, or do you cut the cable gland to make the connector fit? (And if you use a RJ45 inline extender, then you still need a crimping tool ) Quote Link to comment Share on other sites More sharing options...
ChristoSnake Posted January 20, 2023 Share Posted January 20, 2023 On 2023/01/17 at 4:17 PM, ridwan said: It a bit expensive, but the victron cable worked very well for me. I have a spare Victron cable if anybody's interested in one. Still sealed and unopened in its bag. Quote Link to comment Share on other sites More sharing options...
JustinSchoeman Posted January 22, 2023 Share Posted January 22, 2023 I have just started playing with node-red to try move my geyser control from Arduino for easier automation and remote management. To do this, I need to read a block of values every second. Doing this register by register is just way too inefficient, so I need to read them in bulk and then process the results sequentially. I have never used node-red before, so I am not sure what will work best. For testing, I have created a decoder function based on https://github.com/jacauc/SunSynk-NodeRed : // per register // props = properties of new message object // conv = conversion function to get payload.value from modbus response data // scale = (optional) scaling factor to apply to payload.value after conversion // skip = (optional) do not produce output for this register // // conversion algorithms // s16 = signed 16 bit // u16 = unsigned 16 bit // temp = sunsynk temperature value const regs = { '182': { props: { topic: 'battery_temp', deviceclass: 'battery', unit: '°C', }, conv: 'temp', }, '183': { props: { topic: 'battery_volt', deviceclass: 'battery', unit: 'V', }, conv: 'u16', scale: 0.01, }, '184': { props: { topic: 'battery_soc', deviceclass: 'battery', unit: '%', }, conv: 's16', }, }; // paranoia if (msg.values.length != msg.modbusRequest.quantity) { node.warn("Read failed - response length does not match request..."); return null; } var base = msg.modbusRequest.address; //node.warn("start: "+base); var outs = []; var i = 0; while(i < msg.values.length) { var reg = base + i; var rem = msg.values.length - i; //node.warn("reg: "+reg); //node.warn("remain: " + rem); if(!(reg in regs)) { //node.warn('key not found:'+reg) i++; continue; } var config = regs[reg]; //node.warn("config: "+config); if("skip" in config && config.skip) { node.warn('key set to skip:' + reg) i++; continue; } var newmsg = Object.assign({}, config.props); if(config.conv == 's16') { var val = (msg.values[i] + 0); if(val > 32767) { val = val - 65535; } newmsg.payload = val; } else if (config.conv == 'u16') { newmsg.payload = (msg.values[i] + 0); } else if (config.conv == 'temp') { newmsg.payload = (msg.values[i] - 1000) / 10; } else { node.warn('conversion function not found:' + config.conv); i++; continue; } if("scale" in config) { newmsg.payload *= config.scale; } outs.push(newmsg); i++; } //node.warn("outs: "+outs.length); return [outs]; So, issue a bulk read to Modbus-Flex-Getter ( {"fc": 3,"unitid": 1,"address":180,"quantity":10} ) - pass the result into the above function, and it spits out a stream of messages for each configured register. From the outset, that 'regs' array should not be defined here. Probably an external JSON file loaded into global context and referenced from there. Other than that, what do the node-red experts think. Will this scale efficiently if I extend 'regs' to include all registers of interest? Quote Link to comment Share on other sites More sharing options...
kellerza Posted January 22, 2023 Share Posted January 22, 2023 26 minutes ago, JustinSchoeman said: I have just started playing with node-red to try move my geyser control from Arduino for easier automation and remote management. To do this, I need to read a block of values every second. Doing this register by register is just way too inefficient, so I need to read them in bulk and then process the results sequentially. I have never used node-red before, so I am not sure what will work best. For testing, I have created a decoder function based on https://github.com/jacauc/SunSynk-NodeRed : // per register // props = properties of new message object // conv = conversion function to get payload.value from modbus response data // scale = (optional) scaling factor to apply to payload.value after conversion // skip = (optional) do not produce output for this register // // conversion algorithms // s16 = signed 16 bit // u16 = unsigned 16 bit // temp = sunsynk temperature value const regs = { '182': { props: { topic: 'battery_temp', deviceclass: 'battery', unit: '°C', }, conv: 'temp', }, '183': { props: { topic: 'battery_volt', deviceclass: 'battery', unit: 'V', }, conv: 'u16', scale: 0.01, }, '184': { props: { topic: 'battery_soc', deviceclass: 'battery', unit: '%', }, conv: 's16', }, }; // paranoia if (msg.values.length != msg.modbusRequest.quantity) { node.warn("Read failed - response length does not match request..."); return null; } var base = msg.modbusRequest.address; //node.warn("start: "+base); var outs = []; var i = 0; while(i < msg.values.length) { var reg = base + i; var rem = msg.values.length - i; //node.warn("reg: "+reg); //node.warn("remain: " + rem); if(!(reg in regs)) { //node.warn('key not found:'+reg) i++; continue; } var config = regs[reg]; //node.warn("config: "+config); if("skip" in config && config.skip) { node.warn('key set to skip:' + reg) i++; continue; } var newmsg = Object.assign({}, config.props); if(config.conv == 's16') { var val = (msg.values[i] + 0); if(val > 32767) { val = val - 65535; } newmsg.payload = val; } else if (config.conv == 'u16') { newmsg.payload = (msg.values[i] + 0); } else if (config.conv == 'temp') { newmsg.payload = (msg.values[i] - 1000) / 10; } else { node.warn('conversion function not found:' + config.conv); i++; continue; } if("scale" in config) { newmsg.payload *= config.scale; } outs.push(newmsg); i++; } //node.warn("outs: "+outs.length); return [outs]; So, issue a bulk read to Modbus-Flex-Getter ( {"fc": 3,"unitid": 1,"address":180,"quantity":10} ) - pass the result into the above function, and it spits out a stream of messages for each configured register. From the outset, that 'regs' array should not be defined here. Probably an external JSON file loaded into global context and referenced from there. Other than that, what do the node-red experts think. Will this scale efficiently if I extend 'regs' to include all registers of interest? While I cannot really comment on where you want to store these registers in Node-Red, I can comment on the concept behind bulk reading. And agree that it makes a lot of sense! A call to read the RS485 holding registers needs a start and a length, so you obviously want to read the optimal length. Since all the registers you need are not sequential, you will have to group your reads. There is a couple of factors you should keep in mind. Sometimes it might make sense to read a register or two that you do not need, since skipping one might be expensive. With some hardware the size of the blocks you can read can be limited. Once you've figured out what registers you need, you can have a look at what we do in the Sunsynk Python library to group these - groups Btw with the library it's easy to react within a second or two to a major load/power change. The idea from the start was that I can control loads, and even remove them if the inverter goes above its rated 5Kw output. In reality the solution was much simpler, and I ended up simply spreading my heavy loads through the day (geyser & pool pump+heatpump). Sc00bs and WannabeSolarSparky 2 Quote Link to comment Share on other sites More sharing options...
JustinSchoeman Posted January 22, 2023 Share Posted January 22, 2023 I already have everything working (batched reads and such) on my Arduino setup: https://github.com/justinschoeman/ModbusThermostat/blob/master/SunsynkController/sunsynk.h Been running flawlessly 24/7 for over 2 years now. But now I would like to add some UI components and flexible load management for more loads (with priorities and overrides). I could extend the Arduino code to do this. I could also do it in Python. But both would require a lot of UI development around it. Node-red gives me a UI with the flexibility I require. But I have 0 experience in it, and would appreciate some feedback on my implementation choices. If, at the same time, I can preserve the basics of the existing node-red project, then I can steal the logging and dashboarding goodness that has already been developed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.