Everything posted by MartinViljoen
-
non-essential load not showing on sunsynk
I managed to resolve the issue. I didnt have the clamp the right way around, my mistake! Its now facing the grid. Also I didnt know i needed to change the System mode to "Limited to Home" , initially when i enabled Limited to home with the CT facing the Inverter it gave weird and negative values.
-
non-essential load not showing on sunsynk
My 5kW Sunsynk inverter has been operating without any issues since 2023. The non-essential load (Home Load) has always displayed as 0W, while the UPS load typically shows between 500W and 800W, which is expected. My understanding is that the Home Load remains at 0W because the CT clamp was originally installed just before the cable enters the inverter, with the CT arrow pointing towards the grid. I mapped out my DB and inverter connections, as shown in the attached diagram. Based on recommendations, I moved the CT clamp from Position 2 to Position 1, as indicated in the drawing. The inverter was completely powered down during the change, so it performed a full reboot afterwards. Despite moving the CT clamp, I still cannot see any non-essential load being reported. The sub-DB and geyser loads remain completely invisible on the Sunsynk flow diagram. Is there a setting that needs to be enabled for non-essential loads to be displayed, or should this work automatically once the CT is installed in the correct position? I have also logged a support ticket to have the inverter firmware upgraded in case this is a firmware-related issue.
-
Connect Home Assistant with Sunsynk
There was an issue with the Addon today , SunSynk enhanced their security and the addon had to be adapted. https://github.com/martinville/solarsynkv3/issues/48#issuecomment-3576239133 If you wont write settings back , You can just ignore the message it wont do any harm. But if it bothers you just create the Helper entity.
-
Connect Home Assistant with Sunsynk
Go to Settings --> Devices and services -- Helpers Tab Create new helper, select "Text" as the type and call it solarsynkv3_********_settings be sure to replace the redacted text with your inverter serial. Entities created via the API are static and unmanageable, therefore it requires you to manual create it.
-
Connect Home Assistant with Sunsynk
An Addon is a docker. Almost like a VM but not quite. ;-) You dont need hacs, you simply add the repository, refresh you list of addons and install from your addon-store. I stopped mapping entities between the addon and the slipx card. Reason is simple, too much work to maintain it. 😁 Besides its not possible to provide a direct copy and paste without intervention due to the serial number mentioned in the entity. With regards to old entities. Make sure the entities are no longer updated by stopping the addon. then give the system a full reboot. Make sure addon is not set to auto start else it will appear as if they were not removed because it will repopulate the entities after reboot. (Best to un install the addon)
-
Connect Home Assistant with Sunsynk
Hi. Yes there was an issue earlier on. Looks like Sunsynk is preparing to use a more secure authentication method. Both new and old Auth method is now working again. I suspect that soon the old method will be phased out. FYI when that happens the v2 integration will most probably stop. I don't maintain the repository anymore. V3 on the other hand has already been adapted to the new Auth method. Once the old methos is phased out the new end point will most probably take the place of the original which will again cause a hiccup in V3, but it will be a super quick fix.
-
Connect Home Assistant with Sunsynk
Hi There. Yes its been running for quite some time already --> https://github.com/martinville/solarsynkv3 Also fully supports sending system mode and battery settings.
-
Connect Home Assistant with Sunsynk
Not quite sure. This is bash script and i dont have much error control in it so when ever there is an unexpected string or int encountered it will give this kind of error. But looking at your log I suspect you have a semicolon at the end of your inverter serilal numbers. I.E Serial1;Serial2; Serial1;Serial2 , So its parsing Serial1 Serial2 then a blank serial ? Seeing there are many request for better error control , sending settings ect I decided to re-create the addon using python which will be much better. Its almost done i'm in the process of testing it and adding the ability to send settings then I will make it available. instead of
-
Connect Home Assistant with Sunsynk
Unfortunatly not. I havent realy given it thought yet, I dont use this addon anymore I make use of modbus over serial.
-
Connect Home Assistant with Sunsynk
I think I know what you mean now. Since the original post further developments were made. On the SlipX card there is now a GUI, all you do go to each datapoint and search for the entity you want in order to link it. You can also offcoarse opt to manually edit the SlipX configuration yaml file if you wanted to. (Not to be confused with Home assistant's configuration file) I.E What I meant in the first post was I named the entities to be similar to the slipx card (On a developer level) so its easy to map them. As a user you cannot change them. The naming of both addon and card also later changed slightly so its not relevant anymore.
-
Connect Home Assistant with Sunsynk
I'm not 100% sure what you mean. How would I now get a nice flow chart or something similar to what Slipx has? Are you having problems installing the SlipX card via HACS ? Cause from first post in this discussion I thought I would just be able to change the name of the sensor but what I can see there is no sensor if its not configured in the configurations. So should I then add stuff in my configuration.yaml? You dont have to fiddle with the configuration.yaml The SolarSynk Addon will send which ever values it found to a predefined entity. The naming convention is Example sensor.solarsynk_[INVERTERSERIAL]_battery_power1 You cannot rename them, unless you clone the repository and edit the run.sh file. But I dont see any reason to do that. The SlipX card and the SolarSynkv2 Addon are totally 2 different developments and are not directly related in any way. SolarSynk Addon - Fetches information from your Sunsynk Cloud Account and then populates entities with values. Doesnt do anything else. SlipX Card - Is used to graphically display the entity information on a nice looking card on your HA dashboard. You dont have to use the slipX card there are some of the boring default HA cards you can also use.
-
Connect Home Assistant with Sunsynk
It should be fixed now in the new update, the sunsynk server issues is still causing the auth token to not be handed out reliably. But to fix this I added a check in place for the script to keep retrying until the server gives a valid token.
-
Connect Home Assistant with Sunsynk
Yes ,just put multiple serial numbers in the serial field separating them with a semicolon ; I.E 12345;54321
-
Connect Home Assistant with Sunsynk
No thats should be it 😉
-
Connect Home Assistant with Sunsynk
Thanks, I fixed the error. If you update it will hopefully not show the error anymore. With regards to the update rate. You also have to set the update rate to 60s on the sunsynk portal.
-
Connect Home Assistant with Sunsynk
I dont think so. But I just added UPS power now as well. Added the following 2024/11/13 Version "2.1.19" - Added more entities Load UPS PowerL1 Load UPS PowerL2 Load UPS PowerL3 Load UPS Total Power
-
Connect Home Assistant with Sunsynk
My setup unfortunately does not have an essential load, So it don't have a way to include it. I was able to add MPPT3 , MPPT4 , Phase 2 and Phase 3 because someone on the forum was kind enough to share their credentials so that I can extract the data points.
-
Connect Home Assistant with Sunsynk
Hi , The reason for creating the helper is so that you have a place to store and tell the addon which settings you want to send to the inverter. If you set the helper to JSON {"batteryCap": "100"} it will update the settings and set the battery capacity to 100 After it reads the value of the helper it will then clear it out so that on the next loop it will not send the setting again. Typically you have some automation which gets triggered based on certain conditions which will then set the value that you want to send to the inverter. Be warned though, HA helper values have a character limit and many settings cannot just be sent on their own it needs to be sent with other settings else it will simply not be applied. In some cases this exceeds the character limit of the helper which then makes it impossible to update some settings. Example of some settings I just sent.
-
Connect Home Assistant with Sunsynk
I havent forgotten about this. There is a small issue. The Sunsynk api does not like it if you try updating a single setting. It seems it wants you to update a batch of settings. Also the Automation and scenes screen is limited to a certain amount of characters not allowing you to post the entire set of settings due to the character limitation in HA. Not sure how to get around this yet. Hence I started working on an external "Add-on less" solution that runs on an ESP32 as mentioned in the post before this one.
-
Connect Home Assistant with Sunsynk
Thank you for the feedback. I must mention that I'm not as familiar with Home Assistant as most people so I don't know the lingo yet 🙂 I.E when you say "is it possible to change the Add-on configuration to an integration?" In terms of Home assistant what is the difference ? Are integrations "installable" from an external source ? From a user perspective, would it be inconvenient to run an ESP32 plugged into a USB port on your qNAP? Not specifically a qNAP any usb port to provide power to an eSP32 will do even a cellphone charger will work. Example: Here I have an ESP32 which basically replicates what the addon does but externally. It simply grabs the data from the sunsynk cloud via Wifi and then pushes it to HA via HA's Entity API (HTTP) I'm sure the core version of HA allows you to populate entities via API Its running right now as we speak. +
-
Another way of connecting your Home Assistant to your Sunsynk inverter
Maybe not 🙂 It does not quite seem like people are doing it this way. Caveat: Its a little bit premature because I'm not quite done with it. I'm sharing it here just in case someone else is interested so I know in future if I should make it publicly accessible. I'm reading my sunsynk inverter via RS232. I prefer it this way because the Sunsynk Serial port has power which can power an ESP32 connected to a RS232 TTL converter. Dont like cables that dangle all over the show. This way is much cleaner compared to what I have seen. I simply created a replacement dongle that is fully customizable. Its up to the user to enter the address IDs to be retrieved from the inverter which are sent over to home assistant with No addons needed. It just needs a long live token generated on HA. When I'm done I will add the ability to download the recipes from Github. The Dongle has a web gui that can be used to configure it. Some screenshots. Some Embarrassing Pics of the Dongle itself. At the time my 3d Printer had some issues with under extrusion.
-
Connect Home Assistant with Sunsynk
Hi its possible to change settings using this addon, i just havent had the time to create documentation for it. Will try my best to create an example for you tomorrow evening.
-
Sunsynk RS485 Modbus RTU request, bytes level
@system32 Just had to pop in and say thank you for sharing this information. I appreciate it more than you know. I translated this into arduino code for an ESP32 and it seem to work just fine. The documentation I have on how to read the inverter via Rs232 does not include the CRC bytes. To give some back , Incase anyone is interested in example code, see below. The ESP32 runs a web server and the second serial RX,TX pins GPIO 16 & 17 is connected to the inverter's RS232 port using a TTL converter. You can send a request for any register you want and it will read 3 of them at a time starting with the one you requested. and it will save the RAW hex to a log file on the ESP32's flash memory. Special Note: Most TTL converters that comes with a DB 9 is a female port and my Sunsynk 5Kw inverter's port is also female. A gender changer does not work for some reason. (Unless the one i have is faulty , I did check the pins with a multimeter and it looks fine, or my brain is too small to visualize where the RX TX pins has to go 🙂 ) I created a temporary Frankenstein board that allows me to tap into the TX/RX lines along with a 5V voltage regulator to bring down 12V to 5V for the VIN pin on the ESP32. Warning an LM7805 becomes extremely hot and will most probably give up if you use it for long periods, this was just a proof of concept. Once the server is up, you can request any value you want. http://ipaddress/send?registeraddress=182 and then retrieve the response like this http://ipaddress/log #include "LittleFS.h" #include <WiFi.h> #include <WiFiClient.h> #include <WebServer.h> const char* ssid = "SSID"; const char* password = "PASSWORD"; WebServer server(80); //Define Serial Port 2 #define RXD2 16 #define TXD2 17 int incomingBytePort2=0; void setup() { pinMode(2, OUTPUT); digitalWrite(2, LOW); Serial.begin(9600); // opens serial port, sets data rate to 9600 bps Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); LittleFS.begin(); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.print("Connecting "); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); server.on("/", handleRoot); server.on("/log",ServeLog); server.on("/deletelog", DeleteLog); server.on("/formatfs",FormatFS); server.on("/send",SendCMD); server.begin(); } void loop() { server.handleClient(); // Read Serial Port 2 if (Serial2.available() > 0) { // read the incoming byte: incomingBytePort2 = Serial2.read(); Serial.print(incomingBytePort2, HEX); Serial.print(","); File file = LittleFS.open("/log.txt", FILE_APPEND); file.print(String(incomingBytePort2,HEX)); file.print(","); file.close(); } } void ServeLog(){ File file = LittleFS.open("/log.txt", "r"); size_t sent = server.streamFile(file, "text/plain"); file.close(); } void handleRoot() { String MainPage=""; MainPage = MainPage + "<a href=""/formatfs"">Format Filesystem</a><br><br><br>"; MainPage = MainPage + "<a href=""/deletelog"">Delete Log</a><br><br><br>"; MainPage = MainPage + "<a href=""/log"">View Log</a><br><br><br>"; MainPage = MainPage + "URL Example /send?registeraddress=184<br><br>"; MainPage = MainPage + "<a href=""/send?registeraddress=182"">Send CMD 182, Batt Temp, Batt Voltage, Batt Capacity </a><br><br><br>"; server.send(200, "text/html", MainPage); } void DeleteLog(){ LittleFS.remove("/log.txt"); server.send(200, "text/plain", "log.txt deleted"); } void FormatFS(){ LittleFS.format(); server.send(200, "text/plain", "FS Formatted"); } void SendCMD(){ int registeraddress=0; String strRegisterAddress=""; for (uint8_t i = 0; i < server.args(); i++) { //Serial.println(server.argName(i)); if(server.argName(i)=="registeraddress") { Serial.println(""); Serial.print("Reading Register:"); Serial.print(server.arg(i)); strRegisterAddress = server.arg(i); registeraddress=strRegisterAddress.toInt(); } } Serial.println(""); Serial.println("Sending Read Request...."); int slave = 1; int count = 3; read_registers(slave, registeraddress, count); server.send(200, "text/plain", "cmd sent"); } // https://github.com/LacobusVentura/MODBUS-CRC16 static uint16_t MODBUS_CRC16_v3(const unsigned char *buf, unsigned int len) { static const uint16_t table[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; uint8_t Xor = 0; uint16_t crc = 0xFFFF; while (len--) { Xor = (*buf++) ^ crc; crc >>= 8; crc ^= table[Xor]; } return crc; } // https://modbus.org/docs/PI_MBUS_300.pdf int read_registers(uint8_t slave, uint16_t registeraddress, uint16_t number_of_registers) { // See Data and Control Functions - Page 19 // PI_MBUS_300.pdf - Figure 7 Master Query with ASCII/RTU Framing // send cmd buffer to slave byte cmd_buffer[8] = {0}; cmd_buffer[0] = slave; cmd_buffer[1] = 3; // READ REGISTERS cmd_buffer[2] = highByte(registeraddress); cmd_buffer[3] = lowByte(registeraddress); cmd_buffer[4] = highByte(number_of_registers); cmd_buffer[5] = lowByte(number_of_registers); uint16_t crc = MODBUS_CRC16_v3(cmd_buffer, 6); cmd_buffer[6] = lowByte(crc); cmd_buffer[7] = highByte(crc); //Serial.print("cmd_buffer="); //Serial.print(cmd_buffer); //Serial.println(sizeof(cmd_buffer)); Serial2.write(cmd_buffer, sizeof(cmd_buffer)); return 0; }
-
Read Sunsynk Inverter values via RS232
I have a web front end that runs on an ESp32 and want to populate some values from the inverter , The TX and RX pins on the ESP32 is connected to a serial converter which is connected to the inverter's DB9 port. I dont know how to request data and the documentation is not clear to me. From the documentation i have this. function code Function code type explain remark 0x03 Public function code Read the register Contains reads to a single register and multiple registers 0x10 Public function code write the register Contains writes to a single register and multiple registers 2.6.1(0x03) 2.6.1 read register (function code: 0x03) 1 PDU Request the PDU data structure data length data range function code 1 1 byte 0x03 Starting register address 2 2 byte 0x0000~0xFFFF Number of registers 2 2 byte 0x0001~ 0x007D 2 PDU Normal response PDU 2.6.1 read register (function code: 0x03) data structure data length data range function code 1 1 byte 0x03 byte count 1 1 byte N×2 Register values N×2 N×2 byte N= Note: N= number of registers 3 PDU Abnormal response PDU 107 3 PDU Request to read out three consecutive register values starting at address 107 (describe PDU only) : request normal response exceptional response field name ● field value field name field value field name field value function code 0x03 function code 0x03 wrong code 0x83 Hi Starting address Hi 0x00 byte count 0x06 exception code 0x04 Lo Starting address Lo 0x6B [107]Hi Register [107] Hi 0x02 Hi Number of registers Hi 0x00 [107]Lo Register [107] Lo 0x2B Lo Register number Lo 0x03 [108]Hi Register [108] Hi 0x00 [108]Lo Register [108] Lo 0x00 [109]Hi Register [109] Hi 0x00 [109]Lo Register [109] Lo 0x64 I tried sending some hex values to it but I dont get any response from the inverter it remains dead quiet. Tried sending the below byte message[] = {0x03, 0x06}; Serial.write(message, sizeof(message)); and also Serial.write(0x03); Serial.write(0x06); server.send(200, "text/plain", "message sent"); I tested and made sure that the ESP32 tx/rx pins are the correct way around, by sending data back and forth using an USB-RS232 cable and putty. ESP and pc receives the data fine and the baud rate is correctly set to 9600 I'm convinced I'm not sending the correct request data. Anyone care to assist ?
-
Home Assistant Sunsynk Power Flow Card and Dashboard
I recently had a question from someone on the SolarSunk integration about this not rendering correctly on an old iPad Now I know 🙂