johanmeijer / grott

Growatt inverter monitor
https://github.com/johanmeijer/grott/wiki
374 stars 103 forks source link

Add support for Growatt MOD series #490

Open aupilot opened 7 months ago

aupilot commented 7 months ago

Hi Johan,

It would be really great if you can add support for MOD series [1]. This inverter is partially compatible with the "default" mode, but some important data is missing (e.g. Output power). Here is an example of MQTT output:

{"device": "SFHDCxxxxx", "time": "2023-11-23T13:10:40", "buffered": "no", "values": {"datalogserial": "KWK2Dxxxxx", "pvserial": "SFHDCKF04X", "pvstatus": 1, "pvpowerin": 7915, "pv1voltage": 2800, "pv1current": 17, "pv1watt": 4760, "pv2voltage": 1661, "pv2current": 19, "pv2watt": 3155, "pvpowerout": 0, "pvfrequentie": 0, "pvgridvoltage": 0, "pvgridcurrent": 0, "pvgridpower": 0, "pvgridvoltage2": 0, "pvgridcurrent2": 0, "pvgridpower2": 0, "pvgridvoltage3": 0, "pvgridcurrent3": 0, "pvgridpower3": 466031499, "totworktime": 917504, "pvenergytoday": 216666199, "pvenergytotal": 276238388, "epvtotal": 170, "epv1today": 1685, "epv1total": 739772, "epv2today": 103, "epv2total": 1050, "pvtemperature": 690, "pvipmtemperature": 0, "battery1soc": 0}}

Cheers, Kir

[1] https://growatt.tech/product/growatt-mod-5000-tl3-xh-3-phase-energy-storage-inverter/

ruedigerO commented 7 months ago

Hi Johan,

first: A great project! :-) But I have the same requirement like Kir: Inverter: MOD 7KTL3-XH 4 battery modules named: ARK 2.5H-A1 Smart meter and a ShineLan-X I tried to the setting invtype=tl3 but without success. There are a lot of values missing (all regarding battery) and others are wrong (e.g. pvfrequentie: 20.4)

How can I help to fix this?

johanmeijer commented 7 months ago

Can you try it with invtype=min that should work also for mod type inverters

ruedigerO commented 7 months ago

Unfortunately not. I'd tried already. Also invtype=tl3 does not work. With invtype=default I get some data but e.g. all battery data is missing.

 - Grott automatic protocol detection
 - Grott data record length 278
 - layout   :  T060120
 - Record layout used :  T060120
 - Growatt data decrypted V2
 - Grott Growatt data decrypted
 - Growatt plain data:
     00b10006010e01205847443643483632344400000000000000000000000000000000000000004
     d454b304346463043540000000000000000000000000000000000000000170b1b15212800c800
     000086000008f7000008f8000008fb0000000d0000001d0000000d00000823000018870000081
     000000bf100001bd100000c27fffff801fffff85ffffff745000002a200000394000002900000
     28ba000033ebffffe84500000317000001f400000f8800000f8c00000f8b000010bd000001880
     000003700000f05000017cb0000124600000f3c00000000000000000000000000000000000000
     00000000000000000000000000000000000000000000000000000000000000000000000000000
     000000000000074ad
 - Growatt new layout processing
     - decrypt       :  True
     - offset        :  6
     - record layout :  T060120

 - Grott data record date/time processing started
 -......

-> the values for datalogserial and pvserial correct (voltage_l? and Current_l?). From my point of view the data record seems a bit small?!

BTW: I use the grottserver in docker. Makes this a difference?

ruedigerO commented 7 months ago

Ok, the data I send before seems to be the smart meter data. I get a second data set like this and think this is the right one:

 - Grott automatic protocol detection
 - Grott data record length 585
 - layout   :  T060104X
 - no matching record layout found, try generic
 - Record layout used :  T06NNNNX
 - Growatt data decrypted V2
 - Grott Growatt data decrypted
 - Growatt plain data:
     00b60006024101045847443643483632344400000000000000000000000000000000000000004
     d454b304346463043540000000000000000000000000000000000000000170b1b153a0c020bb8
     0c3400010000000005e300000000000005e200000000000000000000000000000000000000000
     000000014460000006b000014e5138c091600090000082d08fe00090000081708f10009000008
     0c0fc70f6a0f6700000405000000000000184b00c4b2cd000000100000509f000051480000000
     300002a21000000030000272700000000000000000000008300000ebf00000000000000210000
     008100005f1300000000000000000000000600000000fffa01a705790744000018dc00c7014f0
     0b4000000fe0c740c664e20000600012fca000000000000000000000000000000000000000000
     00003c00000000000100000000000014460000000f0c350cb10000000f0000042800000017000
     004fb0000000c00000117000052e50000000f000052c300000000000000000000000000000000
     00000000000000000000000000000000000000002710000018dd0000000002010000000051f70
     018001118db0c25000d000d00a800000000140a0000000000000428000004fb000000030cb600
     2300330000008c007e0001000f000000000001000000330033000000000000000000000000000
     0000000000000000200000000001151b8ff06011609c409c40000006458c049c000000000292d
     000000000ccb0cc351ae000000000000000000000000030955280000000000000000000000000
     00000000000d66f
 - Possible Inverter serial MEK0CFF0CT
 - Inverter serial not recognised - using inverter type default
 - Growatt new layout processing
     - decrypt       :  True
     - offset        :  6
     - record layout :  T06NNNNX

 - Grott data record date/time processing started
 - date-time:  2023-11-27T21:58:12
ruedigerO commented 7 months ago

Hi Johan, does the output help? Or do you need more information?

johanmeijer commented 7 months ago

Can you send me the encrypted data record (with the /x data). That makes it more easy for me to test.

Be aware you use grottserver taht uses grott 2.7.8 (Beta). The invtype=min is supported from 2.8.2. I have to create a new docker image for that. Will plan that.

ruedigerO commented 7 months ago

After updating of the grott executables (to v Beta-2.8.x) in my grottserver container and setting invtype=min it looks much better. I'll check tomorrow if all data is available

aupilot commented 7 months ago

I tried the Beta-2.8.x. The "mini" mode does not seem to produce any data and the "default" mode works the same as the release 2.7.8

ruedigerO commented 7 months ago

I was able to correlate the following readings to the WebUI: pv1watt : The first MPPT power pv2watt" : The second MPPT power bms_batteryvolt : Battery Voltage etogridtotal : Exported to Grid (Total) edischrtoday : Discharged Today epv1today : Photovoltaic Output (epv1today + epv2today) pv1voltage : The first MPPT voltage pv2voltage : The second MPPT voltage epvtotal : Photovoltaic Output (Total) eloadtoday : Load Consumption (Today) etogridtoday : Exported to Grid (Today) eloadtotal : Load Consumption (Today) pvfrequentie : grid frequency

There is a lot more but for me the values above are enough. But I'm missing the following: Current charging power Current discharging power Consumption Import Discharged Total Discharged Today

Can you check if these attributes are contained in this data?

Growatt original Data: \x00\x02\x00\x06\x01\x0e\x01\x20\x1f\x35\x2b\x41\x22\x3c\x42\x75\x46\x2b\x77 \x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72 \x22\x32\x2a\x44\x37\x01\x34\x5f\x34\x35\x74\x74\x47\x72\x6f\x77\x61\x74\x74 \x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x76\x78\x73\x57\x56\x78\x77\xa9 \x74\x74\x47\xf4\x6f\x77\x69\x9a\x74\x47\x7a\x89\x77\x61\x7c\x99\x47\x72\x6f \x70\x61\x74\x74\x56\x72\x6f\x77\x66\x74\x74\x46\xfa\x6f\x77\x6d\x15\x74\x47 \x73\x73\x77\x61\x72\xe7\x47\x72\x60\xfc\x61\x74\x72\xeb\x8d\x90\x8d\x67\x8b \x8b\xbd\x0b\x90\x88\x98\xfa\x74\x47\x72\x8d\x77\x61\x77\x6e\x47\x72\x6f\xd3 \x61\x74\x7b\x42\x72\x6f\x6b\xaa\x8b\x8b\xaa\x8f\x6f\x77\x60\x89\x74\x47\x73 \x9b\x77\x61\x7b\x04\x47\x72\x60\x07\x61\x74\x7b\x30\x72\x6f\x60\x9e\x74\x74 \x46\x95\x6f\x77\x61\x39\x74\x47\x67\x30\x77\x61\x55\xb3\x47\x72\x76\x90\x61 \x74\x61\xea\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f \x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47 \x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74 \x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\xde\xd0

Rido commented 6 months ago

I don't want to hijack this issue, but I am also having problems with my MOD inverter, so thought will use this issue instead of creating a new one. I'm not getting all the data with my MOD 8000TL3-X inverter.

After reading this issue I added the invtype=min to my Docker environment. The logging says it's using the layout T065029MIN.

But the value pvpowerout for example stays empty in my MQTT output.

And the pvenergytoday seems a bit strange. I'm using the HA sensors:

    - state_topic: energy/growatt
      value_template: "{{ value_json['values']['pvenergytoday'] | float / 10 }}"
      unique_id: growatt_generated_energy_today
      device_class: energy
      unit_of_measurement: "kWh"
      name: Growatt - Generated energy (Today)
      icon: mdi:solar-power
image

Encrypted data:

\x75\x44\x47\x6c\x6f\x72\x26\x39\x20\x6c\x4a\x6f\x68\x61\x67\x46\x77\x40\x5c
\x77\x5c\x59\x77\x77\x74\x70\x11\x43\x41\x47\x61\x6f\x74\x46\x44\x6f\x6b\x61
\x7b\x77\x69\x33\x20\x14\x25\x5f\x47\x51\x44\x74\x52\x72\x68\x40\x4f\x40\x5a
\x61\x75\x44\x47\x78\x6f\x76\x51\x74\x7f\x47\x72\x6f\x7a\x61\x76\x45\x7f\x72
\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x7e
\x41\x5d\x77\x69\x74\x6a\x0c\x24\x24\x47\x22\x3f\x30\x76\x33\x27\x77\x61\x74
\x77\x61\x74\x67\xcf\x72\x6b\x77\x60\x41\x74\x42\x72\x6e\x46\x61\x72\x74\x45
\x47\x45\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f
\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x33\x3c\x3c\x02\x31\x22\x4e\x51
\x24\x21\x2a\x44\x37\x0c\x36\x5e\x36\x29\x74\x74\x47\x72\x6f\x77\x61\x74\x74
\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72
\x00\xcb\x00\x06\x00\xed\x50\x29\x0c\x25\x24\x46\x22\x3f\x30\x76\x33\x27\x77

MQTT output:

{"device": "xxxxxx", "time": "2023-12-29T09:42:01", "buffered": "no", "values": {"pvserial": "xxxxx", "pvstatus": 1, "pvpowerin": 703, "pv1voltage": 1415, "pv1current": 1, "pv1watt": 141, "pv2voltage": 1407, "pv2current": 1, "pv2watt": 140, "pv3voltage": 0, "pv3current": 0, "pv3watt": 0, "pv4voltage": 0, "pv4current": 0, "pv4watt": 0, "pvpowerout": 0, "pvfrequentie": 0, "pvgridvoltage": 0, "pvgridcurrent": 0, "pvgridpower": 0, "pvgridvoltage2": 0, "pvgridcurrent2": 0, "pvgridpower2": 0, "pvgridvoltage3": 0, "pvgridcurrent3": 0, "pvgridpower3": 45421450, "vacrs": 2281, "vacst": 4, "vactr": 0, "ptousertotal": 59771108, "ptogridtotal": 262144, "ptoloadtotal": 59640044, "totworktime": 327680, "pvenergytoday": 74846072, "pvenergytotal": 258543461, "epvtotal ": 0, "epv1today ": 2197, "epv1total": 2362294, "epv2today": 0, "epv2total": 496, "epv3today": 0, "epv3total": 1387, "etousertoday": 0, "etousertotal": 0, "etogridtoday": 0, "etogridtotal": 0, "eloadtoday": 0, "eloadtotal": 0, "deratingmode": 0, "iso": 0, "dcir": 0, "dcis": 0, "dcit": 0, "gfci": 1883, "pvtemperature": 516, "pvipmtemperature": 233, "temp3": 223, "temp4": 0, "temp5": 0, "pbusvoltage": 3049, "nbusvoltage": 3052, "ipf": 20000, "realoppercent": 0, "opfullwatt": 80000, "standbyflag": 0, "faultcode": 0, "warningcode": 0, "systemfaultword0": 0, "systemfaultword1": 0, "systemfaultword2": 0, "systemfaultword3": 0, "systemfaultword4": 0, "systemfaultword5": 0, "systemfaultword6": 0, "systemfaultword7": 60, "invstartdelaytime": 0, "bdconoffstate": 0, "drycontactstate": 0, "edischrtoday": 0, "edischrtotal": 0, "echrtoday": 0, "echrtotal": 0, "eacchrtoday": 0, "eacchrtotal": 0, "priority": 0, "epsfac": 0, "epsvac1": 0, "epsiac1": 0, "epspac1": 0, "epsvac2": 0, "epsiac2": 0, "epspac2": 0, "epsvac3": 0, "epsiac3": 0, "epspac3": 0, "epspac": 0, "loadpercent": 0, "pf": 0, "dcv": 0, "bdc1_sysstatemode": 0, "bdc1_faultcode": 0, "bdc1_warncode": 0, "bdc1_vbat": 0, "bdc1_ibat": 0, "bdc1_soc": 0, "bdc1_vbus1": 0, "bdc1_vbus2": 0, "bdc1_ibb": 0, "bdc1_illc": 0, "bdc1_tempa": 0, "bdc1_tempb": 0, "bdc1_pdischr": 0, "bdc1_pchr": 0, "bdc1_edischrtotal": 0, "bdc1_echrtotal": 0, "bdc1_flag": 800, "bdc2_sysstatemode": 0, "bdc2_faultcode": 0, "bdc2_warncode": 23, "bdc2_vbat": 12, "bdc2_ibat": 28, "bdc2_soc": 23, "bdc2_vbus1": 12, "bdc2_vbus2": 29, "bdc2_ibb": 0, "bdc2_illc": 0, "bdc2_tempa": 0, "bdc2_tempb": 25565, "bdc2_pdischr": 0, "bdc2_pchr": 0, "bdc2_edischrtotal": 65536, "bdc2_echrtotal": 0, "bdc2_flag": 0, "bms_status": 0, "bms_error": 0, "bms_warninfo": 0, "bms_soc": 0, "bms_batteryvolt": 0, "bms_batterycurr": 0, "bms_batterytemp": 0, "bms_maxcurr": 0, "bms_deltavolt": 0, "bms_cyclecnt": 0, "bms_soh": 0, "bms_constantvolt": 0, "bms_bms_info": 0, "bms_packinfo": 0, "bms_usingcap": 0, "bms_fw": 0, "bms_mcuversion": 0, "bms_commtype": 0}}
johanmeijer commented 6 months ago

The record you included is not a data record. So I can not detect what the problem is.

Have you tried it with invtype=min? That layout also seems to fit the MOD types inverters the best at this moment.

techmantel commented 3 months ago

@Rido Check my comment here https://github.com/johanmeijer/grott/issues/81#issuecomment-2027467918 I have the same inverter and ginvtype=tl3 worked for me!