Closed choenig closed 1 year ago
Feel free to submit any improvements either through comment's or PR's.
Unfortunately the Growatt Inverters are a little unloved at the moment as there aren't many users. Also the growatt_plugin hasn't been fully setup for PV only Inverters which I need to work on.
Hi Christian
What changes did you make ? last i tried the mapping for the TL3-BH-UP were wrong.
I have a same inverter as you, just 8kW model, if you have done some mapping i could verify some of them on mine.
I finds the inverter now, nut the mapping seems to be off.
This is the first time a 3Phase Inverter using this set of registers has been used on the Integration. I'll need to go back over the documents.
I don't know if this helps
I have the manual in PDF somewhere,... https://www.scribd.com/document/592776725/Growatt-Inverter-Modbus-RTU-Protocol-II-V1-24-English-new
Hi, juchu a buddy :)
I just created a WIP-pullrequest https://github.com/wills106/homeassistant-solax-modbus/pull/473 that shows what I changed.
@Hans-chr2 Some of your above errors will get fixed by my changes (e.g. the last two values). Those get fixed by reducing the block_size to 64, don't know why :)
Values for L2 and L3 look broken here, too, but L1 is mostly correct (just as if it was just a 1 phase inverter)
This is my state:
Hi,
I just updated the PR.
I switched back to 100 regs/fetch as I found out, that the issue was just a duplicate reg in the configuration. That resulted in misalignments when assigning values (as it is handled as "set of byte values" then).
Now I don't have any errors in the log anymore during fetch :).
I added some more registers but they don't make too much sense to me.
@Hans-chr2 Did you have a chance to test my patch?
Br Christian
How do i test your patch easy ?
This is the link to the file of the PR:
You can download it and replace ./custom_components/solax_modbus/plugin_growatt.py
with the downloaded one. Then you need to restart HA (quick restart is not enough). I'd suggest to create a copy of the original file before overwriting it ... just in case ;-)
The next official update (done via HACS) will overwrite the file again.
Just a quick overlook, the following are off:
The power reading seems to be the only sensors that are off, but i just looked over it quickly. When i look at the code, you use:
and i use:
as stated in the PDF i'm pretty sure all power readings are int32 and there are high power [kW] reading and low [W]
I'm pretty sure all power readings are int32
That's correct if the register is bidirectional it needs to be an int so it can represent positive and negative values.
You will find that positive means import from the grid and negative is exporting to the grid. (Or the other way round)
@choenig once you are happy with the PR let me know and I can merge it.
@wills106 i know, but as i see it the registers are U32 and if that is correct what ChatGPT states, then you will get some very low or very high power readings because the first bit is used to determine positive/negative.
But i don't know how the change the int type from U32 til int32, i tried it briefly last night but no luck.
Using signed int
s here makes absolute sense, unfortunately the values are still off for me.
The raw data for 1031, 1033 and 1035 (House Load L1-L3) looks like this:
And here for 1023, 1025, 1027 and 1029 (AC Power to Grid L1-L3 and Total)
That does not look like signed
;)
Any other idea?
@wills106 Thanks, I think i'm trying to get these things sorted out, then I'll make it ready for you :)
@choenig i can't find the modbus manual 1,24 from Growatt on my computer anymore. If you can find that manual you can see the data size. As i remember all power and energy readings are 32 bit, and i can see on your screen dump above you pull 16 bit.
I have the manual here, but where does it say something about signed/unsigned? I only find the information if it is high 16bit and low 16bit like here:
Or am I missing someting?
As i remember all power and energy readings are 32 bit, and i can see on your screen dump above you pull 16 bit.
That's correct, but each 32bit field contains of two 16bit fields. E.g. for 1035 and 1036: If we combine 214 (two high bytes) and 226 (two low bytes) we get a strange high number. Or is there any advanced way to combine those two values?
and i use:
[From the previous post] Do you have a running application that displays those value correctly?
If you use GModbus you have the option to read registers as 32bit either a normal number or as a float.
So you would only read: 1031 as "unit = REGISTER_U32," or "unit = REGISTER_S32," 1033 as "unit = REGISTER_U32," or "unit = REGISTER_S32," 1035 as "unit = REGISTER_U32," or "unit = REGISTER_S32,"
Depending on which method you need. Pymodbus will read the inbetween registers as part of each 32bit read (reads two 16bit registers to create a 32bit one)
When i use the modbus integration in Home Assistant via the config files i only use the int32 bit, the power values can both be negative and positive. i also don't read multiple registers only 1 addressee at the time.
I think we either over complicates things, or there is something i have done that is stupidly lucky in the config. :-D
Im out of options now...
Im out of options now...
Does House Load L1 & L2 seem correct? It might be possible there is a Firmware fault with L3?
L1
shows the same as Total
for me, so I guess L2
and L3
are both broken.
Regarding L1+L2+L3 i also have the same issue with my generic modbus, so i see the same as @choenig now.
I marked the PR as ready
, as it does not look that we have something new here, now.
Let's then see what the holding-registers-side has for us :)
Just released 2023.07.4b2 with the changes.
I have just released 2023.07.4b6 which redefines all Growatt Inverters. So a lot has changed.
I just updated to b7
and I have not found any issues, yet :)
There is an error but I have just released 2023.07.4b8 I was accidentally reading 'Grid Export Limit' as a 32bit register.
Corrected another error in 2023.07.4b9
Does anyone with a TL-HX have a 2nd battery system connected to your Inverter?
Just released 2023.08.2 which fixes an issue with TL-HX / TL3-HX and adds additional sensor entities for TL-HX / TL3-HX Inverters.
Can this be closed down now? Or is further work required?
Closing down as no further response.
Hi,
I don't know if this should rather be a discussion or an issue, I just post it here as I guess there are more people reading here :)
I have successfully integrated my Growatt SPH 10000TL3 BH-UP Inverter.
The serial starts with 'YA1' so i added
to get it running.
Now I already improved some of the configuration values in
plugin_growatt.py
to enhance descriptions, scales and I also added some more registers. I also reduced theblock_size
to 64, that fixed some of the received registers.In any case I'm willing to share my improvements, but it would be really nice to find other users of the SPH TL3 BH-UP inverters to check some values, that look really broken on my setup.
Br Christian