Growatt 2 MQTT: convert data from solar inverter to MQTT
Vložit
- čas přidán 10. 09. 2024
- I am working on a new project to read data from my solar inverter and turn it into MQTT messages. The project is work in progress and if you happen to have up-to-date modbus documentation for Growatt inverters, you can help.
My Growatt2MQTT sketch: github.com/nyg...
Follow-up video on this project: • Growatt2mqtt: close to...
Modbus documentation I used, probably applicable to older Growatt inverters:
github.com/ard...
Documentation of Growatt offgrid inverter (from comment by David Granz): watts247.com/m...
2020 version which looks applicable to my inverter (from comment by David Granz): pdfcoffee.com/...
Similar project by TechLab: github.com/ash...
I got some responses but nowadays YT automatically blocks comments with links in them, without any option for me to approve them. But I do receive the notifications so I have the links. Thanks a lot David Granz for your comments and TechLab to his project. I am adding these to the video description.
Glad to help. I'm in the process of installing a Growatt system, so I am very interested in your interface efforts :)
@@DavidGranz Actually I am in the process of re-structuring my code and implementing based on the new doc.
great project - works perfect with my Growatt SPH10000. I wanted to include the SOC value and spent hours to extend your code to include the register 1014 unfortunately with no success. Do you have any hint, how to do so? Json object (SOC) is included and published via MQTT - only the SOC value is not right - I surrender....
Sooo cool, I’ll give it a try, I have a MIN 3000 TL-XH so should be very similar to this 😕😕
I just looked it up, and this looks like a nice inverter, battery read and dual MPPT trackers. Very useful. I assume it would have some additional registers for battery, but as far as I can tell the common registers are same across. And the SYS COM port appears to be the same as on my inverter. So it should work.
Hello
I want to derate my Growatt Min 4200 TL-XE by Modbus (pin 3+4) to Zero Feed In.
It looks so easy with an smartmeter but I have an different system to read and write to the Inverter.
The communication to read and write with the Inverter is ok.
If I write an "1" into register 122 and set the value % in Register 123 the Inverter reduce the power nearly to zero (20W)
What do I have to write into Register 3086 (derating) ?
Do you have some experience with that function ?
Thanks in advance and best regards ....Cord
great job ! keep working please
hi, can I have the result excavation with an inverter voltronic Axpert? Ty
Have you considered to follow the GROTT approach which is opensource acting as a middle man between the inverter and the growatt cloud.
The grott device (usually a pi ) receives the messages from the inverter(s) by listening and then repeating. From there it can deliver mqtt and to grafana.
Growatt is not interferred.
Not really. Modbus is an industry standard well understood, easy to read and the Growatt documentation is fairly good. You only need an ESP which is much cheaper than a pi. Also I don't have a ShineWifi dongle so I never looked into this option. And I was no afraid to connect to the inverter :)
Very nice project and well documented!
A question: Do you know if it is possible to detect when the PV-string is opened during operation (specially during night time when not active)?
My solar panels will be installed in a location were they could be 'removed' by unwanted people and I would like to find a way to setup a software detector to get an alarm.
-ben
My experience at least with Growatt that when the sun is out, it turns itself off completely. So there is no way to tell if the string is broken.
hi, I need detect overflow and surplus, but i cannot find corresponding r NO. variable in Protocol, can you help me ?
The battery full charge status may be sufficient, but it does not correspond 100% value ???
Sorry, I have a simple inverter, I dont have a battery setup.
Hi Csongor. I have a 3kw grid-tied solar setup with Growatt 3kw inverter. Looks exactly like the one in the video. Do you happen to know whether there is a way to monitor grid import/export kw, house consuption kw, and solar generated kw all under one Shine App? For now, all I see is only the solar generated kw.
Thanks
I never used the Shine app, so I am not sure. But the inverter itself does not have an idea about your house consumption. For that you will definitely need a different power metering device, most probably after your main meter at the house. If Growatt sells something like that which integrates with the Shine app I have no idea.
Thanks for the great video and explaination. I try to read my inverter via modbus but i only get an error. My ethernet to RS485 converter shows me that there is a telegram going to the inverter but no answer appears. I used the baudrate stop bit and so on from the documentation. Do you have any idea what could be wrong?
Well, that's not easy, because the Ethernet to RS485 hides all the errors. One simple mistake could be that A and B wires are swapped. Swapped the around and test again. If that does not work, I recommend getting a USB to RS485 converter and try to communicate from a laptop with a program like modbus poll. At least that will show the errors.
@@csongorvarga thank you for the quick response. I will try the wire swapping and otherwise i will test it with my serial to usb and a tool with more error information. Thanks. Modbus address 1 is default correct? It is not needed to activate modbus in the inverter, right?
@@user-gd6vu3cw2d Yes, the detault address is 1 and it is active by default. And you can also verify the address on the small screen within the settings.
@@csongorvarga thanks I got it now working. But now I am a bit confused from the modbus addresses. I looked in your code but i looks like your addresses are diffent to my. For example you read the register 37 as frequency (modbusdata.gridfrequency = growattInterface.getResponseBuffer(37) * 0.01;), if i read this register this will return the value 18798. I do not see there any relation.
Do you have an document for a Growatt MIC 1500TL-X? I didn't find anything helpful in the www.
Thank you
@@user-gd6vu3cw2d I only have the documents that I shared on GitHub. It is possible that Growatt has reviewed the register mapping and changed it for newer model.
I built it but it doesn't communicate with the Growatt MIN 6000 TL-XE. Can the software be modified for this model?
Possible, but I did not hear it. What error message do you get?
@@csongorvarga thanks for the quick response the message is: "Invalid slave ID"
@@cristianbuzatu2423 In that case the slave ID is invalid. It is usually 1 by default, but it is possible that it was changed on your unit. Please check it on the screen. You can get into the settings via the screen on your inverter.
@@csongorvarga I checked, it is set to 1 in the inverter, never changed.
@@cristianbuzatu2423 Oh... that is not good. Can you try wapping the A-B wires over? And just to double check the SLAVE_ID in the code is still set to 1, right?
Hello
I want to derate my Growatt Min 4200 TL-XE by Modbus to zero Load.
Do you have some experience which Modbus register I have to use and what I have to configure in Growatt settings ?
My Modbus connection is done with pin 3 and 4 and I can read and write values into the modbus register of the Growatt Inverter
When I write an "1" into Register 122 and set the Value (%) in Register 123 the Inverter get nearly to Zero (20W) And it dosn´t matter how much % I write into Register 123
What do I have to write into Register 3086 (Derating)
Do you have any idea ???
Thanks in advance ...
Best regards Cord
Sorry, I have no experience with this. I am not sure which document you refer to, I don't see these registers in mine. Based on my inverter Growatt is using Input Registers to read status of the device and Holding Registers can be written into to change behaviour. So probably it is enough to write Register 122 and Register 3086 (Derating) will just reflect that it is manually de-rated.
@@csongorvarga Thanks for response ...I am searching also in an photovoltaik forum
Hi Csongor, very nice project. Can I download the PCB gerber file somewhere without creating an PCBWay account? I was not able to find the file to be able to produce it somewhere else. Thanks!
hey genius thanks.. . you think it is possible to change registers via mqtt ?? i have to control power ratio via radio controller device...
Yes, the modbus library support changing registers as well. So it is possible to do.
@@csongorvarga How can I see if the power ratio Register is editable?
@@tobicreativ If I remember the documentation states if the register is editable.
Nice Work Csongor Varga, I have just got a Growatt 3kW Inverter of Model Growatt SPF 3000TL HVM-48. I am Working for its Modbus over RS485 Registers. Can you Please Share some Information about that Model as well? Thanks
Sorry, I don't own a SPF model, so I have no idea how that is different from my inverter.
I have problem about the inverter no stop only 0 A?
Yes, actually mi inverter does the same too. You can filter the data in mqtt and ignore anything where the status is not 1.
Hello can you if you have a 10 kw inverter can you make it by software a 8 kw inverter ????
I did not look into that. But there are a few de-rating options available.
Would be great to have access to Growatt's API. Anyone?
Yes, that would be nice, but I assume that is close sourced... I think most people just get the data locally, hence less need to reverse engineer the API.
Very nice! Can your PCB run on US 115vac?
Thanks. Yes those are 100-240V power supplies.
HI, can u share script?
Sorry, added the link to the video description. I also added a link to a follow-up video.
hello i work also with a mic 1500 from growatt, but i cant read out some data with my arduino and Max485 converter from the Inverter. i get alwas the same value 226. maybe you can help me with my code. I only want to read out some input registers..
#include
#include
#define MAX485_TX_ENABLE 2 // EIA-485 transmit control pin; MAX485 Module PIN DE and RE
#define EIA485_RX 0 // EIA-485 serial receive pin ; MAX485 Module PIN RO
#define EIA485_TX 1 // EIA-485 serial transmit pin ; MAX485 Module PIN DI
ModbusMaster node;
SoftwareSerial RS485Serial(EIA485_RX, EIA485_TX); // declare serial port
void preTransmission() {
digitalWrite(MAX485_TX_ENABLE, true);// Vor der Übertragung wird Pin 2 auf High gesetzt/transmit
}
void postTransmission() {
digitalWrite(MAX485_TX_ENABLE, false);// Nach der Übertragung wieder auf Low/ receive
}
void setup() {
pinMode(MAX485_TX_ENABLE, OUTPUT);
digitalWrite(MAX485_TX_ENABLE, false);
Serial.begin(9600);
RS485Serial.begin(9600); //Baudrate of PV Inverter ist 9600
node.begin(15, RS485Serial);//Start der seriellen Schnittstelle, Slave ID 15 //Growat Com Adress set to 015?
node.postTransmission(postTransmission);
Serial.print("Growatt ");// Inverter name.
}
void loop() {
//float result;
uint32_t result;
result = node.readInputRegisters(0,1);//Funktion : Read 1 Input Registers, Modbus Adress is 0 for Inverter Status
Serial.println(result);
delay(1000);//wait one second
}
i connect my Max485 Module to pin 3,4 at the inverter.
My seriellMonitor shows always
Growatt
226
226
266....? but this is wrong.
Thanks a lot Max
The result is the result of the modbus communication, whether it is successful or not. I don't remember what 226 is, there are codes for each modbus result code. After each read command you get the values from node.getResponseBuffer(x). In your case since you read a single value, it will be node.getResponseBuffer(0)
Hi Csongor, can you help me out? I read the Growatt via node-js via Modbus-RTU/TCP and having some issues with interpreting the 32bit values for the wattage. All registers are 16bit unsigned integer, but wattage is stored in one high bit and low bit (BigEndian), so you have to shift the 16bits left and bitwise or the next register to the new bit-register.
Your code: ((growattInterface.getResponseBuffer(35)
Ok, this is interesting. Based on your screenshot the result should be 490.0. I put the same code into a javascript sandbox tool and i get 490 back. So I am not sure what is different. Maybe your variables are declared as the wrong type? Can you use a simple calculation like R1031*65536+R1032?