diy solar

diy solar

Modbus comms with (Deye) inverter

brandaris

New Member
Joined
Aug 30, 2022
Messages
2
Hi,

I've recently purchased a Deye 6kW hybrid inverter and would like to control it using a raspberry PI.

I am experienced using Python but I've never used the Modbus protocol before to read/write data to/from the inverter. I received the modbus documents from Deye itself containing all relevant information. But as it is mostly in Chinese or badly translated English, understanding it is not easy.

Do you have any experience doing this? Or perhaps know where to find some working code for a Deye inverter?

Thanks in advance.
 
Hi,

I've recently purchased a Deye 6kW hybrid inverter and would like to control it using a raspberry PI.

I am experienced using Python but I've never used the Modbus protocol before to read/write data to/from the inverter. I received the modbus documents from Deye itself containing all relevant information. But as it is mostly in Chinese or badly translated English, understanding it is not easy.

Do you have any experience doing this? Or perhaps know where to find some working code for a Deye inverter?

Thanks in advance.
Any chance you could share the modbus protocol doc you received from Deye? I just want to check that it matches the one I have from Sunsynk.

I have communications working with my Deye inverter back to Homeassistant. This should let me control certain settings of the inverter, but I haven't tried that yet.
I am using the Sunsynk add-on for home assistant https://github.com/kellerza/sunsynk and a modbus RTU to eth (modbus tcp) converter.
 
Yes of course,

Could you indicate if you found any differences?

According to Deye, you should be able to control all inverter settings via modbus.
 

Attachments

  • Modbus储能-组串-微逆宁波德业V118.pdf
    1.3 MB · Views: 1,459
Yes of course,

Could you indicate if you found any differences?

According to Deye, you should be able to control all inverter settings via modbus.
Thanks for that. The one I have for the Sunsynk is exactly the same, except that your version is a newer revision with a few minor changes.
 
Has anybody succeeded in setting the grid setpoint? Meaning that you control the amount of energy going through the grid connection? Either exporting or importing, controlled by your own software rather than the working mode of the Deye/Sunsynk/Sol-arl?
I read the register list, but I cannot really tell from there how to do it.
 
Hello,

I have the same problem as you because modbus table from Deye is in bad English translation.
I bought this RS 485 converter and with help from my colleague who understands modbus better then me we find some useful data.
Converter: USR-TCP232-410s RS232 / RS485 Serial to Ethernet Adapter/IP Device Server Ethernet Converter Support DHCP/DNS
Table:

Modbus addres DEYE= 1;port 502
ADDRESSREGISTER MEANINGUNITDESCRIPTION
598U GRID L1VNapetost omrežja faza 1
599U GRID L2VNapetost omrežja faza 2
600U GRID L3VNapetost omrežja faza 3
604P GRID LD L1WMoč na tokovnem transformatorju v inverterju faza 1
605P GRID LD L2WMoč na tokovnem transformatorju v inverterju faza 2
606P GRID LD L3WMoč na tokovnem transformatorju v inverterju faza 3
607P GRID LD TOTALWSkupna moč s tokovnih transformatorjev v inverterju
616P GRID CT L1WMoč na tokovnem transformatorju zunaj inverterja faza 1
617P GRID CT L2WMoč na tokovnem transformatorju zunaj inverterja faza 2
618P GRID CT L3WMoč na tokovnem transformatorju zunaj inverterja faza 3
619P GRID CT TOTALWSkupna moč s tokovnih transformatorjev zunaj inverterja
627U BACKUP LOAD L1VNapetost iz razsmernika faza 1
628U BACKUP LOAD L2VNapetost iz razsmernika faza 2
629U BACKUP LOAD L3VNapetost iz razsmernika faza 3
651P BACKUP LOAD L1WMoč na razsmerniku faza 1
652P BACKUP LOAD L2WMoč na razsmerniku faza 2
653P BACKUP LOAD L3WMoč na razsmerniku faza 3
212BATT CHARGE LIMIT CURRENTAOmejetev moči polnenja baterije
213BATT DISCHARGE LIMIT CURRENTAOmejetev moči praznenja baterije
214BATT DIS/CHARGE PERCENTAGE%Status napolnjenosti baterije
215U BATTVNapetost baterije
216I BATT (+/-)ATok polnjenja/praznenja baterije
672P PV1 (string 1)WMoč fotovoltaičnih modulov string 1
673P PV2 (string 2)WMoč fotovoltaičnih modulov string 2
676U PV1VNapetost fotovoltaičnih modulov string 1
677I PV1ATok fotovoltaičnih modulov string 1
678U PV2VNapetost fotovoltaičnih modulov string 2
679I PV2ATok fotovoltaičnih modulov string 2

Description is in my language (Slovenian) everything else I write in English.

If someone read's more data please complete table.

This table is for Deye 12K-SG04LP3 (on modbus port pin 7 and 8)

Kind regards. Peter
 

@Pe-Ro do you have any new data? Writing values to the register, gridcharge, etc.​

Thanks a lot​

 
@ badwajzr no I don't have new data. Only one I found.
590P BATT (+/-)WMoč polnenja/prazneja baterije (+polnenje; -praznenje)
This is power in watts which goes in or out of battery.

I'm still looking to find battery temperature and inverter heat sink temperature because of safety reasons.

Kind regards. Peter
 
Hello,

In zip is modbus table which is OK and it's works for my inverter (Deye SUN 12K-SG04LP3). Inside it's word file.

Kind regards. Peter
 

Attachments

  • Modbus deye TABLE.zip
    217.1 KB · Views: 585
Hello,

I have the same problem as you because modbus table from Deye is in bad English translation.
I bought this RS 485 converter and with help from my colleague who understands modbus better then me we find some useful data.
Converter: USR-TCP232-410s RS232 / RS485 Serial to Ethernet Adapter/IP Device Server Ethernet Converter Support DHCP/DNS
Table:

Modbus addres DEYE= 1;port 502
ADDRESSREGISTER MEANINGUNITDESCRIPTION
598U GRID L1VNapetost omrežja faza 1
599U GRID L2VNapetost omrežja faza 2
600U GRID L3VNapetost omrežja faza 3
604P GRID LD L1WMoč na tokovnem transformatorju v inverterju faza 1
605P GRID LD L2WMoč na tokovnem transformatorju v inverterju faza 2
606P GRID LD L3WMoč na tokovnem transformatorju v inverterju faza 3
607P GRID LD TOTALWSkupna moč s tokovnih transformatorjev v inverterju
616P GRID CT L1WMoč na tokovnem transformatorju zunaj inverterja faza 1
617P GRID CT L2WMoč na tokovnem transformatorju zunaj inverterja faza 2
618P GRID CT L3WMoč na tokovnem transformatorju zunaj inverterja faza 3
619P GRID CT TOTALWSkupna moč s tokovnih transformatorjev zunaj inverterja
627U BACKUP LOAD L1VNapetost iz razsmernika faza 1
628U BACKUP LOAD L2VNapetost iz razsmernika faza 2
629U BACKUP LOAD L3VNapetost iz razsmernika faza 3
651P BACKUP LOAD L1WMoč na razsmerniku faza 1
652P BACKUP LOAD L2WMoč na razsmerniku faza 2
653P BACKUP LOAD L3WMoč na razsmerniku faza 3
212BATT CHARGE LIMIT CURRENTAOmejetev moči polnenja baterije
213BATT DISCHARGE LIMIT CURRENTAOmejetev moči praznenja baterije
214BATT DIS/CHARGE PERCENTAGE%Status napolnjenosti baterije
215U BATTVNapetost baterije
216I BATT (+/-)ATok polnjenja/praznenja baterije
672P PV1 (string 1)WMoč fotovoltaičnih modulov string 1
673P PV2 (string 2)WMoč fotovoltaičnih modulov string 2
676U PV1VNapetost fotovoltaičnih modulov string 1
677I PV1ATok fotovoltaičnih modulov string 1
678U PV2VNapetost fotovoltaičnih modulov string 2
679I PV2ATok fotovoltaičnih modulov string 2

Description is in my language (Slovenian) everything else I write in English.

If someone read's more data please complete table.

This table is for Deye 12K-SG04LP3 (on modbus port pin 7 and 8)

Kind regards. Peter
I connect to the modbus port but cannot communicate, or do I have to connect to another port?
 
Hello,

I used a 'modebus' port on deye inverter.

Kind regards. Peter
 
Hello,

I have the same problem as you because modbus table from Deye is in bad English translation.
I bought this RS 485 converter and with help from my colleague who understands modbus better then me we find some useful data.
Converter: USR-TCP232-410s RS232 / RS485 Serial to Ethernet Adapter/IP Device Server Ethernet Converter Support DHCP/DNS
Table:

Modbus addres DEYE= 1;port 502
ADDRESSREGISTER MEANINGUNITDESCRIPTION
598U GRID L1VNapetost omrežja faza 1
599U GRID L2VNapetost omrežja faza 2
600U GRID L3VNapetost omrežja faza 3
604P GRID LD L1WMoč na tokovnem transformatorju v inverterju faza 1
605P GRID LD L2WMoč na tokovnem transformatorju v inverterju faza 2
606P GRID LD L3WMoč na tokovnem transformatorju v inverterju faza 3
607P GRID LD TOTALWSkupna moč s tokovnih transformatorjev v inverterju
616P GRID CT L1WMoč na tokovnem transformatorju zunaj inverterja faza 1
617P GRID CT L2WMoč na tokovnem transformatorju zunaj inverterja faza 2
618P GRID CT L3WMoč na tokovnem transformatorju zunaj inverterja faza 3
619P GRID CT TOTALWSkupna moč s tokovnih transformatorjev zunaj inverterja
627U BACKUP LOAD L1VNapetost iz razsmernika faza 1
628U BACKUP LOAD L2VNapetost iz razsmernika faza 2
629U BACKUP LOAD L3VNapetost iz razsmernika faza 3
651P BACKUP LOAD L1WMoč na razsmerniku faza 1
652P BACKUP LOAD L2WMoč na razsmerniku faza 2
653P BACKUP LOAD L3WMoč na razsmerniku faza 3
212BATT CHARGE LIMIT CURRENTAOmejetev moči polnenja baterije
213BATT DISCHARGE LIMIT CURRENTAOmejetev moči praznenja baterije
214BATT DIS/CHARGE PERCENTAGE%Status napolnjenosti baterije
215U BATTVNapetost baterije
216I BATT (+/-)ATok polnjenja/praznenja baterije
672P PV1 (string 1)WMoč fotovoltaičnih modulov string 1
673P PV2 (string 2)WMoč fotovoltaičnih modulov string 2
676U PV1VNapetost fotovoltaičnih modulov string 1
677I PV1ATok fotovoltaičnih modulov string 1
678U PV2VNapetost fotovoltaičnih modulov string 2
679I PV2ATok fotovoltaičnih modulov string 2

Description is in my language (Slovenian) everything else I write in English.

If someone read's more data please complete table.

This table is for Deye 12K-SG04LP3 (on modbus port pin 7 and 8)

Kind regards. Peter
There is a pretty easy to read definition file at https://github.com/StephanJoubert/h...larman/inverter_definitions/deye_sg04lp3.yaml
 
I'm looking for a solution to use excess energy, so I have so far activated MODBUS on LK3/4 from www.tinycontrol.pl
ATTENTION LK4 is still in development and waiting for firmware, version 3.8 is usable, MODBUS module must be purchased
 
Last edited:
Metric
Modbus address
MQTT topic suffix
Unit
PV1 Power
672​
dc/pv1/power
W​
PV2 Power
673​
dc/pv2/power
W​
PV1 Voltage
676​
dc/pv1/voltage
V​
PV2 Voltage
678​
dc/pv2/voltage
V​
PV1 Current
677​
dc/pv1/current
A​
PV2 Current
679​
dc/pv2/current
A​
Daily Production
529​
day_energy
kWh​
Total Production
534,535​
total_energy
kWh​
Total Grid Power
625​
ac/total_power
W​
Grid Voltage L1
598​
ac/l1/voltage
V​
Grid Voltage L2
599​
ac/l2/voltage
V​
Grid Voltage L3
600​
ac/l3/voltage
V​
Internal CT L1 Power
604​
ac/l1/ct/internal
W​
Internal CT L2 Power
605​
ac/l2/ct/internal
W​
Internal CT L3 Power
606​
ac/l3/ct/internal
W​
Total active IN Power
607​
Ac/active IN Power
W​
External CT L1 Power
616​
ac/l1/ct/external
W​
External CT L2 Power
617​
ac/l2/ct/external
W​
External CT L3 Power
618​
ac/l3/ct/external
W​
Daily Energy Bought
520​
ac/daily_energy_bought
kWh​
Total Energy Bought
522,523​
ac/total_energy_bought
kWh​
Daily Energy Sold
521​
ac/daily_energy_sold
kWh​
Total Energy Sold
524,525​
ac/total_energy_sold
kWh​
Day Load Power
526​
Ac/day load power
kWh​
GridSell Power
525​
Ac/total gridsell
kWh​
Gen Port Power
667​
Ac/total pover gen port
W​
Current L1
630​
ac/l1/current
A​
Current L2
631​
ac/l2/current
A​
Current L3
632​
ac/l3/current
A​
Inverter L1 Power
633​
ac/l1/power
W​
Inverter L2 Power
634​
ac/l2/power
W​
Inverter L3 Power
635​
ac/l3/power
W​
DC Temperature
540​
radiator_temp
°C​
AC Temperature
541​
ac/temperature
°C​
Daily Battery Charge
514​
battery/daily_charge
kWh​
Daily Battery Discharge
515​
battery/daily_discharge
kWh​
Total Battery Charge
516,517​
battery/total_charge
kWh​
Total Battery Discharge
518,519​
battery/total_discharge
kWh​
Battery Power
590​
battery/power
W​
Battery Voltage
587​
battery/voltage
V​
Battery SOC
588​
battery/soc
%​
Battery Current
591​
battery/current
A​
Battery Temperature
586​
battery/temperature
°C​
Total Load Power
653​
ac/ups/total_power
W​
Load L1 Power
650​
ac/ups/l1/power
W​
Load L2 Power
651​
ac/ups/l2/power
W​
Load L3 Power
652​
ac/ups/l3/power
W​
Load Voltage L1
644​
ac/ups/l1/voltage
V​
Load Voltage L2
645​
ac/ups/l2/voltage
V​
Load Voltage L3
646​
ac/ups/l3/voltage
V​
Daily Load Consumption
526​
ac/ups/daily_energy
kWh​
Total Load Consumption
527,528​
ac/ups/total_energy
kWh​



1698212203900.png

1698213306566.png
 
Last edited:
What is the difference between Internal CT and External CT?
I guess the external CT's are the one you put into your switch board.
But what are the internal CT's showing?
 
Hello,

I have SUN-50K-SxG01HP3-EU-BM4 which has two battery towers with two BMS. Registry for the first battery packs fits but I just cant find registry for the second BMS2 and battery2 - any thoughts? (I'm using logger to solarmanpv.com and I can see BMS and BMS2 just cannot find any specification for the second battery anywhere)
 
Hello,
'festr' did you try to look whole modbus table with 'modbus poll' software? When you see all of numbers and addresses you will probly find data for other BMS.

'hasan73' the difference between internal CT and extrnal CT is if you look deye data sheet (shematic picture) you will see that internal CT is measuring UPS load (backup) power and extrnal is on grid and comsumption of devices that you have connected on grid.

Kind regards. Peter
 
Hello,

I have the same problem as you because modbus table from Deye is in bad English translation.
I bought this RS 485 converter and with help from my colleague who understands modbus better then me we find some useful data.
Converter: USR-TCP232-410s RS232 / RS485 Serial to Ethernet Adapter/IP Device Server Ethernet Converter Support DHCP/DNS
Table:

Modbus addres DEYE= 1;port 502
ADDRESSREGISTER MEANINGUNITDESCRIPTION
598U GRID L1VNapetost omrežja faza 1
599U GRID L2VNapetost omrežja faza 2
600U GRID L3VNapetost omrežja faza 3
604P GRID LD L1WMoč na tokovnem transformatorju v inverterju faza 1
605P GRID LD L2WMoč na tokovnem transformatorju v inverterju faza 2
606P GRID LD L3WMoč na tokovnem transformatorju v inverterju faza 3
607P GRID LD TOTALWSkupna moč s tokovnih transformatorjev v inverterju
616P GRID CT L1WMoč na tokovnem transformatorju zunaj inverterja faza 1
617P GRID CT L2WMoč na tokovnem transformatorju zunaj inverterja faza 2
618P GRID CT L3WMoč na tokovnem transformatorju zunaj inverterja faza 3
619P GRID CT TOTALWSkupna moč s tokovnih transformatorjev zunaj inverterja
627U BACKUP LOAD L1VNapetost iz razsmernika faza 1
628U BACKUP LOAD L2VNapetost iz razsmernika faza 2
629U BACKUP LOAD L3VNapetost iz razsmernika faza 3
651P BACKUP LOAD L1WMoč na razsmerniku faza 1
652P BACKUP LOAD L2WMoč na razsmerniku faza 2
653P BACKUP LOAD L3WMoč na razsmerniku faza 3
212BATT CHARGE LIMIT CURRENTAOmejetev moči polnenja baterije
213BATT DISCHARGE LIMIT CURRENTAOmejetev moči praznenja baterije
214BATT DIS/CHARGE PERCENTAGE%Status napolnjenosti baterije
215U BATTVNapetost baterije
216I BATT (+/-)ATok polnjenja/praznenja baterije
672P PV1 (string 1)WMoč fotovoltaičnih modulov string 1
673P PV2 (string 2)WMoč fotovoltaičnih modulov string 2
676U PV1VNapetost fotovoltaičnih modulov string 1
677I PV1ATok fotovoltaičnih modulov string 1
678U PV2VNapetost fotovoltaičnih modulov string 2
679I PV2ATok fotovoltaičnih modulov string 2

Description is in my language (Slovenian) everything else I write in English.

If someone read's more data please complete table.

This table is for Deye 12K-SG04LP3 (on modbus port pin 7 and 8)

Kind regards. Peter


Hello, I'm in a similar situation, I have a 12kW model where there is an RJ45 MODEBUS connector, where I connected pins 7 and 8 but it still doesn't read anything, I tried e.g. Battery SOC with this command: MODBUSR(H, 0x03, Int16)/588
I don't know if this is correct.

Can you advise me, thanks
 
Hello, I'm in a similar situation, I have a 12kW model where there is an RJ45 MODEBUS connector, where I connected pins 7 and 8 but it still doesn't read anything, I tried e.g. Battery SOC with this command: MODBUSR(H, 0x03, Int16)/588
I don't know if this is correct.

Can you advise me, thanks
Did you set the battery to lithium and enabled comms ?
If not, the BMS port will be disabled
 
Yes, the battery is set to lithium, but I cant found menu where is "enabled comms" :(
When you set lithium you need to set a protocol.
Furthermore, have you tried swapping 7 and 8 ?
Some adapters (ch314 mostly ) have swapped it
 

diy solar

diy solar
Back
Top