-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Sunsynk 12kw 3-phase inverter? #63
Comments
I have no idea if this will work, have not seen any document on how to wire up the RS485 on the 12kw unit. There might even be different registers (to measure power etc on different phases etc). Would be great if you can test and report back |
Will certainly do so. I've ordered a splitter as I think that one "BMS" port is the one needed for communication. Yesterday I tried changing this through the Sunsynk app and shortly afterwards there was an error event with audible alert: F13: Grid_Mode_changed. I was a little taken back and changed it back to 0. Do you know if a change like this be a "real" error or is that normal behaviour for the inverter to log an event like this? |
As long as the the parallel box isn't checked (you only have the one inverter right?), Changing the Modbus SN ID to 01 wont cause any problems. The F13 error will clear after a few minutes and the inverter output will turn back on. |
If you have multiple inverters installed, or parallel checked, it's highly unlikely that your Modbus SN is till 0! Modbus address 0 is a broadcast address and you are not allowed to respond to any message you receive on 0. With older firmware versions the inverter always responded... |
I have the same problem with a Deye 12kw Inverter. The only one is the Serial No. Do you have an idea? |
Planning to buy the same inverter (3fase/12kw) combined with batteries only (no solar) so very curious to hear about your progress. Out of curiosity, with this add-on, is it possible to instruct the inverter (for instance to change discharge or charge from grid settings) or is the addon reporting state sensors only? |
The fact that it's displaying the SN means it is communicating, so that's a good start. Have you entered the inverter SN into the config? If so, try remove the quotation marks around the serial number. |
Hi, in the meanwhile, i figured out, what is the actual problem! The Deye Sun-12k-SG04LP3 seems to "speak" another protocol. Last night, I found another protocol description with different register addresses than the "other" one, you are using in your add on. I tried a NodeRed Flow to read out the inverter, it worked! I attach both documents, the old and the new one. sunsynk_modbus - no chinese.docx found here, a german forum: The Serial# registers are equal, also the Register: 02 - Communication Protocol Version. Maybe, it is possible to implement both version of the protocol, switching after the read of the protocol version. |
I'm not sure if the same port issue exists with the 3-phase Sunsynk and Deye, but I think the port could also be the issue here. I'm waiting on a delivery for a splitter and hope to test on the "BMS" port soon. Interestingly I also managed to connect with the inverter using NodeRed (Using "Meter-485" port) and managed to pull some values out of it --- however the values appeared not to change over time. As soon as I have the splitter, my plan is to first test with this integration "out the box" and see what I get. Else I'll play around more with NodeRed. |
@sebmueller thanks for the document. This document shows a new device type-which seems to be the 3ph inverter. So far we’ve tested the dev type 0x0300, while the 3ph is 0x0500. The key would be to go through the new doc and map the register numbers that you are interested in. My guess is that the current implementation will either give you total(across phases) or only one of the phases, or worst case the single-phase registers will give you something entirely different. Once we have the registers of the 3phase inverter it is possible to choose either based on the value of the device type @sebmueller how did you connect to you inverter? (Might help @lubster85) @ronaldt80 you can read and you can write RW type sensors. definitions.py will show you the registers and which are read &write — use the dev version of the addon for write |
I've started having a look at the doc and I can confirm that I'm getting readings that appear to be correct. I'm still going through them to work out which is which. |
Keen to hear about your experience @lubster85 and @sebmueller - my sunsynk 3ph 12kw has been ordered. I intend to switch to dynamic energy tariffs with the aim to buy low sell high :) - typically the pricing curve shows 2 peaks and 2 troughs so plenty of options to recover part of the investment. Key is however to also steer the export / import settings of the inverter - hope the r/w settings permit this |
I've been playing around using NodeRed for now. Thank you @sebmueller for sharing that doc.
When I have some more time I'll look at this in more detail, but hope this helps for now. I'm super-happy that I'm at least able to pull in some data into home assistant now. |
@lubster85 you are welcome. For Overall_State - you can use register 500 (run state) 0000 待机 standby Here is my nodered flow: @kellerza is it possible to extent your implementation to read out also the 3ph inverter? |
Nice work @lubster85 ! Not sure exactly when I'll get to it but it is possible to add a second set of registers by extending the base sensor class. |
@kellerza when do you think you will add the Deye 12kw? Depending on this, i would deside if i order the solar assistant or if i would use the home assistant :) |
@sebmueller i will definitely share, not a problem. Just hoping to add some of the “3-phase” metrics first and will share. Out of interest - I used a splitter on the “BMS” port to split readings from the inverter (based on the solar-assistant site suggestion). I have a sneaky suspicion that this was not necessary in my case (I was just referencing the incorrect registers initially). Would be interesting to hear how others have connected. |
@lubster85 If I am understanding it correctly, you only managed to start getting readings once you started using Node-Red? You didn't have any success using @kellerza add-on? I'm completely new to all of this and I'm also trying to get readings out of the 12kW Sunsynk without much success. I just assumed I was doing something wrong as I was getting the same error in the logs as you initially did, but I will try Node-Red and see what happens. Maybe I'm completely off-base here, but shouldn't we get something (even incorrect or 'zero' readings out of the add-on, even if the registers are different? Or did you start getting some sort of readings from the inverter when you swapped the Modbus SN to 01? I also managed to shut my inverter down by changing the SN to 01. Nearly had heart failure. But, after doing further reading, apparently you are supposed to isolate all loads from the inverter before changing anything on that settings page. Live and Learn. |
@lubster85 I just used the Modbus Port. But I also read, it depends on the firmware version, which port es usable. In the future, I want to connect my diy battery, but therefore I need a converter for the battery informations. |
@jcwilson01, correct. This is because the integration developed by @kellerza was made-for and tested on the inverters listed here: https://github.com/kellerza/sunsynk#tested-inverters. Interestingly enough, when I changed the modbus serial id to '01', the integration picked up my inverter serial number as it started. I'm really no expert and I haven't looked under the hood of what this integration is doing, but I think the integration is looking for an expected response, not getting it, and safely stopping itself. If you look at the two docs that @sebmueller shared a few posts above, you'll see just how different the two are. I'm still going through it all and double-checking my initial "mappings". Once I'm done I'll share my flows (to be used at your own risk). :-) |
Updated addresses for 3-phase inverter "monitoring" values.
Then these are some of the "settings" addresses I can find. Most of these are R/W addresses (i.e. you can also write back to the inverter - use with caution :-) ).
|
The way i read the manual 148 - 177 should al be read/write: 148- 153 accepts a time value, where 1745 would equate to quarter to 6. 154 - 159 should be the max watt power importing or exporting, 8000 being 8kw 160 - 165 is the voltage 166 - 171 is the target SoC level 172 - 177 is enable/disable of charge mode Unfortunately I will only receive my deye in december.. so no possibility to test |
@sebmueller see attached "my" NodeRed flow. I found this at this forum post and adapted it to suit my needs. Much of what I have done is stripped some functionality I didn't need/understand and I also added some of the 3-phase metrics in (as referenced in the posts above). Still very much a work in progress so please treat it with caution. :-P @kellerza thank you for the quick replies and apologies - you'll see the references I've posted above are based on the NodeRed flow I found (and not in line with your definitions.py) naming. Nonetheless I hope it proves helpful if/when you consider looking at this. In the meantime, I thought I'd share some of the Home Assistant (apexcharts) charts I've put together for our setup :-) We've been away from home so the usage is lower than normal, but its been particularly interesting seeing the usage by phase. It looks like most of our plugs + lights are on Phase A, pool pump and some other things on B and the Stove/Oven on C. |
@lubster85 thanks for sharing your flows! :) @kellerza are there some news about integrating a second set of registers in your addon? kind regards |
No problem - you'll see there are a few custom cards and a theme that you'll need to download/change. I'm sure it's also not perfect, but its getting there :-)
|
@lubster85 |
@lubster85 I also figured out, that the Overall State decoding in you flow was buggy. |
thanks for sharing your dashboard, looks nice :) |
@lubster85 Register 606, in the Flow it is used for "battery_charge_volts", this is in the "old / other" protocol. |
I use this Modbus Gateway. But USB should work as well, though I didn't try that. |
@archi Was able to debug with USB connected to my MBPro but have ordered the Wave tcp gateway anyway. Bit chilly in the garage... Have added the system program settings and have tested the write functionality (simple time change), which seems to work just fine. I'm not sure about the 'Prog mode' options though, is that 1phase specific? or firmware specific, I'm still on C027 waiting for an update. There are still some unknown registers and not yet translated ones, I have reused your comment: # 12k?? Todo: test and add the following as RW Also noticed, although in several lists, anything in 200 range returns 0 from my inverter. Here's a link to the definitions file, when I've sorted more I will send pull. Here's a list of the sensors and the one skipped:
|
Hey, great :) I will screenshot my settings for the gateway - I found some of the stuff a bit counterintuitive.
Since I only have the 3 phase inverter, I don't know. Maybe kellerza has an idea?
I don't have a lot of time for testing right now (many more house improvements to be done, including getting the electrical work up to code), but once my battery arrives I'll try to see if can setup a small temporary solar array for offgrid testing. Though testing configuration parameters match the display might already be possible (I did not yet dare playing with that, read-only is safer and personally enough for me).
|
Hmm prog mode is the combination of gen charge - grid charge.. |
Yes, but if you define your own, you can also separate the using a bitmask=xx on the sensor definition |
@kababoom : You have to install the add ons for gate and cycle in HA. |
Ah, @kababoom nice work on the PR :) Looking forward to test it. Regarding the Waveshare: Keep in mind the non-PoE variant is lacking any isolation, while the PoE variant is isolated both on the Ethernet port and on RS485. The think the chance of the inverter unloading into the modbus is pretty slim, but in case of a lightning strike I didn't want to take any chances (plus, I have PoE anyway). I can also report the configuration software runs well on my Linux machine (using |
@sebmueller Thank you, packages could not be found but got it working by adding the packages to the config of nodered. Looks good.. |
Here is a ESP32-Deye project, if you look at the yaml file, it lists the 3P modbus registries in quite readable format, so might be useful to have a look |
Can anyone confirm how to use the definitions file added in #93? Do I have to create a local copy of the addon and rename definitions3ph.py to definitions.py? I tried doing exactly this and unfortunately it still tries to query the registers from the original definitions file, Im not where it is reading them from since I removed the original file. |
@bruceborrett you have to modify the addon’s There is a script called copy2local that does this and copies the files to the correct folder (modify for your target HASS IP/samba share. You will need msys to run it on windows (for sed) |
@kellerza Im running Linux and dont have any experience with Windows scripts, but will figure it out, thanks. |
Even better. that means you have all the linux command-line tools available already. The script will just show you what needs to go where |
Managed to get it all working and it is now reading the correct registers 🥳 Thank you |
The first version of the MULTI addon should be ready. You can now select a "three-phase" inverter though config & even add your own custom sensors And new docs 😉 https://kellerza.github.io/sunsynk/reference/definitions The definitions3ph.py file was contributed by @kababook & @archi and hopefully they keep it up to date,- PRs always welcome |
2023.03.19-0.3.1 2023-03-21 10:24:20,573 INFO options Loading HASS OS configuration |
Second issue is if i run the single phase definitions i dont get any errors . ... And more digging im finding that its to do with the Definitions file .. 2023-03-21 10:38:44,427 INFO Removing HASS MQTT discovery info homeassistant/sensor/2208077352/total_grid_export/config |
Can you try using mbusd? This seems more like there is an issue with the serial driver I don't have the capability to test the serial driver, maybe I should just force everyone to go via mbusd |
ok
Ok installed and configured and no errors you were right thank you for that . |
Great, I’m not actively using the 3ph definitions, but PRs are welcome to that file Will see if I can setup a test env to test the serial drivers& update pymodbus to the latest release as well. There seems to be some new development happening there (there was a blocking issue with async before pymodbus 3, and the reason why I included umodbus). Umodbus seems to be very quiet recently I have my doubts if umodbus is reliable on usb interfaces |
I've also got it running now, with a small test PV deployment attached to the inverter. It currently runs in a screen session on my home server, and seemed rock solid. The reported data looks correct (didn't check all, but many), and I can even control lots of things in the inverter. N.b.: I'll probably put the "addon" into a systemd service on my host machine, since it works really nice even without home assistant - I really like how you went with the MQTT approach! What I noticed:
For 1&2 I guess you have to decide if these changes are okay, Johann. I'll then open a PR. For 3. I'll try to take a look once I find some spare time. For 4. it's up to you as well; I know how painful random user "helpful suggestions" can be for FOSS maintainers and can totally live with a local workaround. |
Great, glad you got it working! Do you run it natively, or do you still use Docker/Podman?
This does seem incorrect, especially with a max of 2000A. For "Ah" there is no specific keyword (only voltage/current/energy have these to try and enforce some consistency) PR welcome. I'm not too concerned about adding deprecated version, but you can always add the _deprecated logic from the 1ph definitions.py file.
MQTT Switch is not something I've tested extensively. Today it is simply a special case of a MQTT select entity, but might need to check the MQTT discovery docs again. What exactly does the "Force charge" switch do?
This will really depend on the inverter - see also #59 for another place to read up on these modbus registers
If you are willing to do a PR I'll consider this, maybe through some modifier, like the filters, say My approach is to add it to the UI as an entity. Then you have to first click on it and you can change in a popup. But I fully agree that some things you don't want to set in the UI. (At the end of #59 there is one, something completely hidden from the sunsynk UI). In the normal definitions file, I have tried to steer away from what I consider dangerous settings (like changing the grid frequency, - although a user suggested you can nicely disconnect from the grid if this is wrong. It's a neat use case, but I might be a bit conservative to test it)
|
Native execution inside a screen session. Since it runs well with python 3.10 from the Arch Linux repositories, I don't see a reason to put inside a container which I'd then need to update manually. If I find some time, I'll probably write a package file.
Set the target capacity in the "time of use" config to 100% and enable grid charging. This will then fully charge the battery. I used this to charge the battery for initial balancing.
haha, I feel very much the same :) Regarding the other points, I'll try to look into these once I have some time on my hands :) |
This seems like a combination of the writable sensors |
The MULTI addon allows you to use the three-phase definitions - https://kellerza.github.io/sunsynk/reference/definitions#three-phase-inverter-sensor-definitions For any specific issues on the 3ph definitions, please open a PR/new issue |
Which port did you guys plug into in the end? Meter 485? Or did you have to split the BMS port in the end? |
Hi there
I recently had a Sunsynk 12kw 3-phase inverter installed, but I'm a little unsure if this integration works with this model.
I purchased a USB-RS485 cable from Solar-Assistant (https://solar-assistant.io/shop/products/sunsynk_rs485) and tried starting up the integration.
I've tried a few ports on the inverter with no success yet, but I was hoping to sense-check myself here as I don't recall the 3-phase inverter being included in the list of tested inverters.
My understanding is that the "Meter-485" port could be used for monitoring and also the "BMS" port.
Referencing Solar Assistant, they claim there was a firmware change recently.
Is there perhaps something else I may be missing or should try?
If not, I'll try find a splitter and confirm if that makes a difference.
The text was updated successfully, but these errors were encountered: