Comments (13)
Reading through the code I see that the RW Modbus option only reads the holding registers and not the input registers. Still figuring out how to read PV1 and PV2 Power.
from openinvertergateway.
Depending on your RTU Protocol (which i believe is tied to your growatt inverter model and/or serial/usb stick), you can find it in the specification:
(start at page 25) v1.0.5 (newest version i believe): https://www.photovoltaicsolar.in/Growatt_Manual/MAX%20Series%20Modbus%20RTU%20Protocol.pdf
(start at page 10) v3.0.5 (older version i believe): https://docplayer.net/161194234-Growatt-pv-inverter-modbus-rs485-rtu-protocol.html
I believe the input registers do get read if i look at Growatt.cpp line 22 and 32.
Line 22 (input register 28) matches on the v3.0.5 specification for total energy.
Line 32 (input register 55) matches on the v1.05 specification for total energy.
I did found other projects on github (e.g. https://github.com/nygma2004/growatt2mqtt/blob/main/Growatt2mqtt_1p2s.ino start on line 135) which matches the input registers on the v3.0.5 specification.
from openinvertergateway.
(Input reg 5 for PV1 power and input reg 9 for PV2 power for both the v1.0.5 spec and the v3.0.5 spec)
from openinvertergateway.
Lots of Thanks!!
The doc I found has the same specification. I also tried out the regs you proposed this afternoon. IIRC, Reg 5 gave me the right value for PV1. Reg 9 however was 0.
I Also tried out 6 and 10, which also gave unexpected results. Maybe I programmed it wrong? I'm not a programmer.
Growatt.cpp (ln 70)
...
if (res == Modbus.ku8MBSuccess)
{
_Data.InverterStatus = (eGrowattStatus_t)Modbus.getResponseBuffer(0);
_Data.u32DcPower = (Modbus.getResponseBuffer(5) << 16) + Modbus.getResponseBuffer(9);
_Data.u16DcPowerPV1 = Modbus.getResponseBuffer(5);
_Data.u16DcPowerPV2 = Modbus.getResponseBuffer(9);
_Data.u16DcVoltage = Modbus.getResponseBuffer(3);
_Data.u16DcInputCurrent = Modbus.getResponseBuffer(4);
//return true;
}
...
Growatt.h (ln 24)
...
float GetDcPower();
float GetDcPowerPV1();
float GetDcPowerPV2();
float GetDcVoltage();
...
Index.h (ln 88)
...
document.getElementById("DcVoltage").innerHTML = "DC Voltage: " + obj.DcVoltage + " V";
document.getElementById("DcPower").innerHTML = "DC Power Total: " + obj.DcPower + " W";
document.getElementById("DcPowerPV1").innerHTML = "DC Power String 1: " + obj.DcPowerPV1 + " W";
document.getElementById("DcPowerPV2").innerHTML = "DC Power String 2: " + obj.DcPowerPV2 + " W";
...
ShineWiFi-S_ModBus.ino (ln 521)
...
sprintf(Buffer, "%s \"DcVoltage\": %.1f,\r\n", Buffer, Inverter.GetDcVoltage());
sprintf(Buffer, "%s \"DcPower\": %.1f,\r\n", Buffer, Inverter.GetDcPower());
sprintf(Buffer, "%s \"DcPowerPV1\": %.1f,\r\n", Buffer, Inverter.GetDcPowerPV1());
sprintf(Buffer, "%s \"DcPowerPV2\": %.1f,\r\n", Buffer, Inverter.GetDcPowerPV2());
What am I missing?
Is it the "shift left +" thingy? Has something to do with u16 to u32 conversion but I don't understand it fully.
BTW: I have Growatt 6000TL-XE and ShineWiFi_X
from openinvertergateway.
Not a programmer as well. Do you have an ShineWifi-X or ShineWifi-S?
I think for the ShineWifi-X you need the following:
res = Modbus.readInputRegisters(0, 9);
line 70 Growatt.cpp
from openinvertergateway.
Thanks. Seems obvious to read from 0 to 9
This is what I've tested so far. The second image shows the correct value for PV1.
It's getting dark now. So maybe tomorrow I'll tweak a little more.
BTW I've found working solution here using ESPHome. I've modified this code a bit using reg 6 and 10. These gave me the correct power output. of PV1 and PV2. So we're definitely missing something with the above code...
from openinvertergateway.
I am waiting on my wemos d1 so i can try it my self on the SYSCOM port. Currently the ShineWifi-X is working as I intended with domoticz so I wont mess around with it.
I did even found an 1.20 version PDF which has an date of 2020 and mentions the TL-XE series (newest inverter series is believe, at least the one I have).
https://github.com/nygma2004/growatt2mqtt/blob/main/Growatt%20PV%20Inverter%20Modbus%20RS485%20RTU%20Protocol%20v120.pdf
from openinvertergateway.
Thanks!
The v1.20 also states that the PV1 and PV2 power should be read from registers 5/6 for PV1 and 9/10 for the PV2 string. Therefore, I would assume that the code below should work to get the correct values of both strings.
res = Modbus.readInputRegisters(0, 10); // line 70 Growatt.cpp
and adding around line 74
_Data.u32DcPowerPV1 = (Modbus.getResponseBuffer(5) << 16) + Modbus.getResponseBuffer(6);
_Data.u32DcPowerPV2 = (Modbus.getResponseBuffer(9) << 16) + Modbus.getResponseBuffer(10);
I haven't tested this since the ESPHome code I am currently using gives me the proper output.
BTW _Data.u32DcPower
(line 74) only shows the power output for PV1. I would suggest to @otti to change this line to _Data.u32DcPowerPV1
so that people know that the total PV power is not shown here as I initially assumed ;-)
Yes please let us know this works via the SYSCOM port!
from openinvertergateway.
Small update on my end, i got the SYSCOM port working, but it wouldnt read any of the PV1 and PV2. It did manage to retreive the other registers (with this repo code). I got it now running with own-customized code of https://github.com/nygma2004/growatt2mqtt.
Next up, compare code why it doesnt work with this repo but it does with the other one.
from openinvertergateway.
Nice one!
So you're saying you can read PV2 DC-Power from SYSCOM with this repo code? Do you have the ability to check your repo with the ShineWifi-X or ShineWifi-S? Because I couldn't get it to work.
from openinvertergateway.
I ended up using the other repo and haven't checked this repo any further for the issues we are facing. (still not a programmer ;) )
from openinvertergateway.
No problem @superfunnl ;-)
Glad you got it working!
from openinvertergateway.
After #61 you should now be able to get invert PV Power values (1-7).
from openinvertergateway.
Related Issues (20)
- Add Possibility to update the firmware when connected to an AP HOT 1
- Error: Unknown Shine Stick HOT 9
- Unable to set MQTT broker HOT 1
- Huge first value HOT 3
- WiFi reconnection failure HOT 1
- Which EEPROM.h use for this? HOT 2
- Only precompiled release 1.0.0 works with Shine X HOT 1
- Strange values for TodayGenerateEnergy HOT 7
- Original Firmware
- Battery Status not available with Growatt mod 9000tl3-xh HOT 2
- Protocoll Error in Mosquitto HOT 3
- Suport shine Wifi-F (the big old white) that you need for all GROWATT SPF Series HOT 4
- How can i change the Modbus Protocol? HOT 1
- modbus - RTU over TCP - iobroker HOT 1
- Can't get any data from 10KTL3-X inverter. HOT 2
- any chance to implement NTP so that the inverter can not drift in time.. HOT 2
- Growatt 1500-S inverter support HOT 2
- Strange Values of OutputPower at the evening
- Integration of smartmeter? HOT 1
- No values shown although inverter is producing according to display HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openinvertergateway.