StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
509 stars 191 forks source link

Deye Sun SUN-12K-SG04LP3 #88

Open wendtc opened 1 year ago

wendtc commented 1 year ago

Hello, Great project you have here. I have a Deye 12K hybrid inverter. Unfortunately, your YAML file for Deye did not display anything. I got the Modbus protocol from Deye and adjusted the first things. However, I have not been able to find battery status, inverter status, etc. Maybe with your experience you can find out these things. Christian

grafik

deye12KEU.yaml.txt MODBUS RTUDEYEübersetzt.pdf

PV-Joe commented 1 year ago

I would highly appreciate if anyone would find out the missing values as this configuration fits to my Deye SUN-8K-SG04LP3-EU as well.

Brilliant work Wendttc. 👍

PV-Joe commented 1 year ago

273BACEE-3884-4288-9031-52D921D55A3C

This register doesn’t seem to work. Has anyone got a clue what value has to go in there to make the sensor work?

wendtc commented 1 year ago

deye12K.yaml.txt New Register on Deye 12K

Cerak321 commented 1 year ago

Correct register for: Daily production: 0x0211 Battery power: 0x024E

All these values can be found in this document you just have to convert decimal values from the left column to hexadecimal and don't forget to add these registers to request if they are not there.

PV-Joe commented 1 year ago

Hey Cerak,

great work! Thx for posting. The daily production works fine ✅ The battery power is still „unknown“ ❌

Here is my configuration for battery power: 3F0B0891-F07D-43BC-B75D-4413D84E662E

Is there another value I could try?

Joe

PV-Joe commented 1 year ago

Hey Cerak, I just realized that:

Daily production: 0x0211 … is not production.

It is: Daily energy charged

Are you able to correct this?

ondrejbartas commented 1 year ago

@wendtc I love you ❤️

I spend past 4 days looking for way to get data from LSW3 logger 23XXX in Deye SUN-10K EU. And most of data is correct !!!! You are life saver.

ondrejbartas commented 1 year ago

Total Energy Sold update:

    - name: "Total Energy Sold"
      class: "energy"
      state_class: "total_increasing"
      uom: "kWh"
      scale: 0.1
      rule: 3
      registers: [0x020C,0x020D]
      icon: 'mdi:transmission-tower-import'

changed registers [0x020C,0x020D]

PV-Joe commented 1 year ago

Total Energy Sold update:

    - name: "Total Energy Sold"
      class: "energy"
      state_class: "total_increasing"
      uom: "kWh"
      scale: 0.1
      rule: 3
      registers: [0x020C,0x020D]
      icon: 'mdi:transmission-tower-import'

changed registers [0x020C,0x020D]

Excellent work. Just tested it and it works for my DEYE SUN-8K-SG04LP3-EU

Thank you so much! Keep going and I would be happy if you could post any other corrections here in future 👍

PV-Joe commented 1 year ago

Hi again,

my Stick-Logger was changed to a newer model today because upgrading the firmware per remote wasn't working.

Now I have got a Stick-Logger with the following firmware: LSW3_15_FFFF_1.0.91R Serialnumber beninning with: 27xxxxxxx

The result is that all the values in Home Assistant are not working anymore even though I changed the new IP and Serialnumber in the configuration. The Port ist still 8899.

Any ideas what I have to do to make the new LSW-3 Stick-Logger work again?

ondrejbartas commented 1 year ago

I found ot problem with Battery Power and Current:

correct settings are:


    - name: "Battery Power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x024E]
      icon: 'mdi:battery'

    - name: "Battery Current"
      class: "current"
      state_class: "measurement"
      uom: "A"
      scale: 0.01
      rule: 2
      registers: [0x024F]
      icon: 'mdi:battery'

But you also need to change in beggining of file requests:

  - start: 0x024A
    end: 0x024D

to

  - start: 0x024A
    end: 0x024F
Screenshot 2022-10-01 at 16 50 55
PV-Joe commented 1 year ago

Hi again,

my Stick-Logger was changed to a newer model today because upgrading the firmware per remote wasn't working.

Now I have got a Stick-Logger with the following firmware: LSW3_15_FFFF_1.0.91R Serialnumber beninning with: 27xxxxxxx

The result is that all the values in Home Assistant are not working anymore even though I changed the new IP and Serialnumber in the configuration. The Port ist still 8899.

Any ideas what I have to do to make the new LSW-3 Stick-Logger work again?

Got it working in the meantime 😄 The problem was, that after changing the serialnumber all sensors were duplicated. I deleted the old ones and deleted the xxx_2 for the new sensors and voila. It works again.

Thank you for helping myself 😂

PV-Joe commented 1 year ago

I found ot problem with Battery Power and Current:

correct settings are:


    - name: "Battery Power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x024E]
      icon: 'mdi:battery'

    - name: "Battery Current"
      class: "current"
      state_class: "measurement"
      uom: "A"
      scale: 0.01
      rule: 2
      registers: [0x024F]
      icon: 'mdi:battery'

But you also need to change in beggining of file requests:

  - start: 0x024A
    end: 0x024D

to

  - start: 0x024A
    end: 0x024F
Screenshot 2022-10-01 at 16 50 55

I just changed the registers and the output is: 2B24A074-CC84-4E53-9D15-F33DAA755EB2

It looks strage to me 🤔

ondrejbartas commented 1 year ago

If power is negative tahn you are most probably chargin battery

PV-Joe commented 1 year ago

If power is negative tahn you are most probably chargin battery

You are right. :-) Thank you for your great work!

ondrejbartas commented 1 year ago

Another good metric:

    - name: "Grid side total power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x0271]
      icon: 'mdi:transmission-tower'

and also in requests:

- start: 0x0276  
    end: 0x027C
    mb_functioncode: 0x03  

change to

  - start: 0x0271
    end: 0x027C
    mb_functioncode: 0x03

this will give you power on grid (positive is buy, negative is sell) It should be same number which is shown on display of inverter (on grid side)

PV-Joe commented 1 year ago

Another good metric:

    - name: "Grid side total power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x0271]
      icon: 'mdi:transmission-tower'

and also in requests:

- start: 0x0276  
    end: 0x027C
    mb_functioncode: 0x03  

change to

  - start: 0x0271
    end: 0x027C
    mb_functioncode: 0x03

this will give you power on grid (positive is buy, negative is sell) It should be same number which is shown on display of inverter (on grid side)

Hi,

another excellent work. Tested it on my Deye 8K Hybrid and it works perfectly. I helped myself out by summing up the three LT1 to LT3 values in configuration.yaml creating a sensor with the following code until now:

# Sensor für Solarman CT1-3 Sum solar_external_ct1_3: friendly_name: "Solarman CT1-3 Power" unit_of_measurement: 'W' value_template: "{{ states('sensor.solarman_external_ct_l1_power')|int(0) + states('sensor.solarman_external_ct_l2_power')|int(0) + states('sensor.solarman_external_ct_l3_power')|int(0) }}"

This is obsolete now.

Thank you 😄

Magno06 commented 1 year ago

@ondrejbartas Thanks, everything works. I also have a DEYE 10K but I can't see the daily production, it still returns "unknow" and I don't know how to edit the .yaml file. can you help me? Have a good evening

PV-Joe commented 1 year ago

@ondrejbartas Thanks, everything works. I also have a DEYE 10K but I can't see the daily production, it still returns "unknow" and I don't know how to edit the .yaml file. can you help me? Have a good evening

Try this in your “deye_hybrid.yaml”:

- name: "Daily Production"
  class: "energy"
  state_class: "total_increasing"
  uom: "kWh"
  scale: 0.1
  rule: 1
  registers: [0x0211]
  icon: 'mdi:solar-power'

Use the Addon “File Editor” to edit the yaml.

tomasvitha commented 1 year ago

Great work guys, thank you! Works perfectly with a new DEYE 10K-SG04LP3-EU hybrid.

Magno06 commented 1 year ago

@ondrejbartas Thanks, everything works. I also have a DEYE 10K but I can't see the daily production, it still returns "unknow" and I don't know how to edit the .yaml file. can you help me? Have a good evening

Try this in your “deye_hybrid.yaml”:

- name: "Daily Production"
  class: "energy"
  state_class: "total_increasing"
  uom: "kWh"
  scale: 0.1
  rule: 1
  registers: [0x0211]
  icon: 'mdi:solar-power'

Use the Addon “File Editor” to edit the yaml.

Thanks for your invaluable help! Another question ... Is there a way to have a sensor that indicates the daily consumption of my house? I see it in the energy distribution graph but I don't have a sensor that I can use. can you help me? Thanks again image

PV-Joe commented 1 year ago

You are nearly ready 😄 Try: sensor.solarman_daily_load_consumption

Klagio commented 1 year ago

Hi, I have exactly the same Inverter (actually 2, one master and one slave). Can you please help me on how to change the component so that it works?

Klagio commented 1 year ago

Hey Cerak, I just realized that:

Daily production: 0x0211 … is not production.

It is: Daily energy charged

Are you able to correct this?

Hi, I am getting confused now, which is the correct value for daily production 0x01F5 or 0x0211 ??

Klagio commented 1 year ago

Thanks for your invaluable help! Another question ... Is there a way to have a sensor that indicates the daily consumption of my house? I see it in the energy distribution graph but I don't have a sensor that I can use. can you help me? Thanks again image

Hi just to make sure I don't do anything wrong, these are the 5 sensors for the graph? To be put in recorder.yaml? Where to put load consumption (the house?? sensor.solarman_daily_load_consumption ?

  - sensor.solarman_daily_energy_bought # for GRID consumption?
  - ssensor.solarman_daily_energy_sold # for RETURN TO GRID?
  - sensor.solarman_total_battery_charge  #for energy going into the battery?
  - sensor.solarman_total_battery_discharge # for energy coming out from the battery?
  - sensor.solarman_daily_production # for Solar panels?
Klagio commented 1 year ago

Other issue, I have 2 inverters in parallel (one in Master mode, other in Slave mode). At the moment I check the address of the MASTER inverter, wonder if I need to do two instances of Solarman, or what Anyone with the same Master/Slave settings ?

PV-Joe commented 1 year ago

Here is the full working deye_hybrid.yaml

deye_hybrid.yaml.txt

DEYE Hybrid in Home Assistant 2022-11

Klagio commented 1 year ago

Here is the full working deye_hybrid.yaml

deye_hybrid.yaml.txt

DEYE Hybrid in Home Assistant 2022-11

Thanks. Very cool dashboard, you mind sharing the lovelace code?

Klagio commented 1 year ago

I have this as differenzce


    - name: "SmartLoad Enable Status"
      class: ""
      state_class: ""      
      uom: ""
      scale: 1
      rule: 1
      registers: [0x0085]
      isstr: true
      lookup: 
      -  key: 0
         value: "GEN Use"
      -  key: 1
         value: "SMART Load output"
      -  key: 2
         value: "Microinverter"
      icon: 'mdi:lightning-bolt-outline'
Klagio commented 1 year ago

which is the correct?


    - name: "Total Grid Power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x0271]
      icon: 'mdi:transmission-tower'
    - name: "Total Grid Power"
      class: "power"
      state_class: "measurement"
      uom: "W"
      scale: 1
      rule: 2
      registers: [0x0260]
      icon: 'mdi:transmission-tower'
Magno06 commented 1 year ago

Good morning everyone and happy holidays, I had correctly modified the DEYE 10K inverter yaml file but I had lost the integration and therefore the code. Would someone with the same inverter (@ondrejbartas) as me be so kind as to provide me with the complete code? I would be very grateful :)

linuxdep commented 1 year ago

Hi, thanks for add correct parameter for deye12kEU, but i have found some other issues:

[sensor.deye12k_grid_connected_status] wrong status GRID, i see "unavailable" but it is connect to grid [sensor.deye12k_time_of_use] i see "unavailable" [sensor.deye12k_total_power] i see "unavailable"

have you a fix for me? or is this normal?

@StephanJoubert What do you think, could you not incorporate the changes into your code? It seems to be working fine except for a few things.

bruceborrett commented 1 year ago

I also have a SUN-10K-SG04LP3 but when trying to use the new config I get this error:

Querying registers [3 - 89] failed, aborting.

My serial number starts with 22 and I see mention in the readme that this might mean I need a different integration that uses protocol version 4, but I cannot find any such integration, anyone have any pointers?

Thanks

Derirrepeter commented 1 year ago

Hi again, my Stick-Logger was changed to a newer model today because upgrading the firmware per remote wasn't working. Now I have got a Stick-Logger with the following firmware: LSW3_15_FFFF_1.0.91R Serialnumber beninning with: 27xxxxxxx The result is that all the values in Home Assistant are not working anymore even though I changed the new IP and Serialnumber in the configuration. The Port ist still 8899. Any ideas what I have to do to make the new LSW-3 Stick-Logger work again?

Got it working in the meantime 😄 The problem was, that after changing the serialnumber all sensors were duplicated. I deleted the old ones and deleted the xxx_2 for the new sensors and voila. It works again.

Thank you for helping myself 😂

Can you give me some help i have the same Inverter and have verry poor experience with HA and Solarman. I have the HACS ans Solarman running and tried to integrate the new Deye_12K.yaml into my HA and the Solarman. this didnt worked. Please i need help.

sdrogi commented 1 year ago

First of all thank you for this great work.... With this thread I got my 10K-SG04LP3-EU connected to my Home Assistant. I have only one small problem left. In addition to the PV 1 and PV 2 strings, there are also three micro inverters connected to and controlled by the SG04LP3-EU. The output in the app is displayed separately. But I can't find the matching resgisters in the yaml or the modbus file. Does anyone have an idea about this? Thanks in advance Screenshot_20230530-101250 Screenshot_20230530-100119

K3iVi commented 11 months ago

First of all thank you for this great work.... With this thread I got my 10K-SG04LP3-EU connected to my Home Assistant. I have only one small problem left. In addition to the PV 1 and PV 2 strings, there are also three micro inverters connected to and controlled by the SG04LP3-EU. The output in the app is displayed separately. But I can't find the matching resgisters in the yaml or the modbus file. Does anyone have an idea about this? Thanks in advance Screenshot_20230530-101250 Screenshot_20230530-100119

I can not find total numbers, but you can create meter.

Edit deye_sg04lp3.yaml:

requests:

and add sensors:

- name: "Phase voltage of Gen port A"
  class: "voltage"
  state_class: "measurement"      
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0295]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase voltage of Gen port B"
  class: "voltage"
  state_class: "measurement"
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0296]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase voltage of Gen port C"
  class: "voltage"
  state_class: "measurement"
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0297]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port A"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x0298]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port B"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x0299]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port C"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x029A]
  icon: 'mdi:home-lightning-bolt'

- name: "Total Power of Gen port"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x029B]
  icon: 'mdi:home-l1ghtning-bolt'
sdrogi commented 11 months ago

Great ... Thank you

K3iVi commented 11 months ago

Great ... Thank you

Good news everyone :) Found out registers for Microinverter generation :)

 - start: 0x0218
    end: 0x021A
    mb_functioncode: 0x03 
- name: "Microinverter power generation of today"
  class: "energy"
  state_class: "total_increasing"
  uom: "kWh"
  scale: 0.1
  rule: 3
  registers: [0x0218]
  icon: 'mdi:transmission-tower-import'

- name: "Microinverter power generation total"
  class: "energy"
  state_class: "total_increasing"
  uom: "kWh"
  scale: 0.1
  rule: 3
  registers: [0x0219,0x021A]
  icon: 'mdi:transmission-tower-import'

`

Hieu137 commented 9 months ago

First of all thank you for this great work.... With this thread I got my 10K-SG04LP3-EU connected to my Home Assistant. I have only one small problem left. In addition to the PV 1 and PV 2 strings, there are also three micro inverters connected to and controlled by the SG04LP3-EU. The output in the app is displayed separately. But I can't find the matching resgisters in the yaml or the modbus file. Does anyone have an idea about this? Thanks in advance Screenshot_20230530-101250 Screenshot_20230530-100119

I can not find total numbers, but you can create meter.

Edit deye_sg04lp3.yaml:

requests:

  • start: 0x0295 end: 0x029B mb_functioncode: 0x03

and add sensors:

- name: "Phase voltage of Gen port A"
  class: "voltage"
  state_class: "measurement"      
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0295]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase voltage of Gen port B"
  class: "voltage"
  state_class: "measurement"
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0296]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase voltage of Gen port C"
  class: "voltage"
  state_class: "measurement"
  uom: "V"
  scale: 0.1
  rule: 1
  registers: [0x0297]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port A"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x0298]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port B"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x0299]
  icon: 'mdi:home-lightning-bolt'

- name: "Phase power of Gen port C"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x029A]
  icon: 'mdi:home-lightning-bolt'

- name: "Total Power of Gen port"
  class: "power"
  state_class: "measurement"
  uom: "W"
  scale: 1
  rule: 1
  registers: [0x029B]
  icon: 'mdi:home-l1ghtning-bolt'

Hi , Can you share with me Modbus documents ?

K3iVi commented 9 months ago

This is the last one I got from Deye support. Totals on microinverters are hidden under Chinese 536,537,538. Singles GEN port phases are from 661+

Deye MODBUS RTU三相储能通信规约V104 (1).pdf

chinezbrun commented 8 months ago

hello guys. great work on this tread issue.

Is the original deye_sg04lp03.yaml updated with these values in curent release, or all changes needs to be done manually?

hajokim commented 5 months ago

Hi again, my Stick-Logger was changed to a newer model today because upgrading the firmware per remote wasn't working. Now I have got a Stick-Logger with the following firmware: LSW3_15_FFFF_1.0.91R Serialnumber beninning with: 27xxxxxxx The result is that all the values in Home Assistant are not working anymore even though I changed the new IP and Serialnumber in the configuration. The Port ist still 8899. Any ideas what I have to do to make the new LSW-3 Stick-Logger work again?

Got it working in the meantime 😄 The problem was, that after changing the serialnumber all sensors were duplicated. I deleted the old ones and deleted the xxx_2 for the new sensors and voila. It works again.

Thank you for helping myself 😂

Hello, I have the same problem. But I don't understand how do you solve this problem? I would be very grateful, if you send me the solution. Thank you.