home_assistant_solarman
home_assistant_solarman copied to clipboard
Deye Sun SUN-12K-SG04LP3
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

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

This register doesn’t seem to work. Has anyone got a clue what value has to go in there to make the sensor work?
deye12K.yaml.txt New Register on Deye 12K
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.
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:

Is there another value I could try?
Joe
Hey Cerak, I just realized that:
Daily production: 0x0211 … is not production.
It is: Daily energy charged
Are you able to correct this?
@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.
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]
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 👍
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?
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
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 😂
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: 0x024Dto
- start: 0x024A end: 0x024F![]()
I just changed the registers and the output is:

It looks strage to me 🤔
If power is negative tahn you are most probably chargin battery
If power is negative tahn you are most probably chargin battery
You are right. :-) Thank you for your great work!
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)
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: 0x03change to
- start: 0x0271 end: 0x027C mb_functioncode: 0x03this 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 😄
@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
@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.
Great work guys, thank you! Works perfectly with a new DEYE 10K-SG04LP3-EU hybrid.
@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

You are nearly ready 😄 Try: sensor.solarman_daily_load_consumption
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?
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 ??
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
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?
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 ?
Here is the full working deye_hybrid.yaml
Thanks. Very cool dashboard, you mind sharing the lovelace code?
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'
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'
