home_assistant_solarman icon indicating copy to clipboard operation
home_assistant_solarman copied to clipboard

Deye Sun SUN-12K-SG04LP3

Open wendtc opened this issue 3 years ago • 42 comments

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

wendtc avatar Aug 18 '22 06:08 wendtc

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 avatar Sep 05 '22 14:09 PV-Joe

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?

PV-Joe avatar Sep 05 '22 22:09 PV-Joe

deye12K.yaml.txt New Register on Deye 12K

wendtc avatar Sep 11 '22 18:09 wendtc

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.

Cerak321 avatar Sep 16 '22 16:09 Cerak321

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 avatar Sep 17 '22 13:09 PV-Joe

Hey Cerak, I just realized that:

Daily production: 0x0211 … is not production.

It is: Daily energy charged

Are you able to correct this?

PV-Joe avatar Sep 19 '22 15:09 PV-Joe

@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 avatar Sep 29 '22 20:09 ondrejbartas

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]

ondrejbartas avatar Sep 30 '22 06:09 ondrejbartas

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 avatar Sep 30 '22 06:09 PV-Joe

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?

PV-Joe avatar Oct 01 '22 13:10 PV-Joe

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

ondrejbartas avatar Oct 01 '22 14:10 ondrejbartas

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 avatar Oct 01 '22 15:10 PV-Joe

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 🤔

PV-Joe avatar Oct 01 '22 15:10 PV-Joe

If power is negative tahn you are most probably chargin battery

ondrejbartas avatar Oct 01 '22 15:10 ondrejbartas

If power is negative tahn you are most probably chargin battery

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

PV-Joe avatar Oct 02 '22 11:10 PV-Joe

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)

ondrejbartas avatar Oct 03 '22 20:10 ondrejbartas

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 😄

PV-Joe avatar Oct 05 '22 05:10 PV-Joe

@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

Magno06 avatar Nov 20 '22 19:11 Magno06

@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.

PV-Joe avatar Nov 20 '22 19:11 PV-Joe

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

tomasvitha avatar Nov 23 '22 19:11 tomasvitha

@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

Magno06 avatar Nov 24 '22 17:11 Magno06

You are nearly ready 😄 Try: sensor.solarman_daily_load_consumption

PV-Joe avatar Nov 24 '22 19:11 PV-Joe

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 avatar Nov 30 '22 11:11 Klagio

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 avatar Nov 30 '22 12:11 Klagio

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 avatar Nov 30 '22 12:11 Klagio

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 ?

Klagio avatar Dec 01 '22 16:12 Klagio

Here is the full working deye_hybrid.yaml

deye_hybrid.yaml.txt

DEYE Hybrid in Home Assistant 2022-11

PV-Joe avatar Dec 06 '22 20:12 PV-Joe

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 avatar Dec 07 '22 08:12 Klagio

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 avatar Dec 07 '22 15:12 Klagio

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'

Klagio avatar Dec 07 '22 15:12 Klagio