Implementation DEYE Inverter - Approach

Hello,

I´m trying to implement the DEYE Inverter (DEYE SUN-12K-SG04LP3-EU). Thanks to @acabrera I got a brief overview how to implement the hybrid battery inverter. I still try to figure out how to implement the whole system. My approach after some weeks of trying is now following. The Inverter holds data in his register for following things I need.

  • Grid Active Power
  • PV Active Power
  • Battery Stuff

Now my approach would be to implement three new Components:

  • Meter 1 - Type: GRID (Reads the data from the specific register in the inverter)
  • Meter 2 - TYPE: PRODUCTION (Reads the data from the specific register in the inverter)
  • ESS (Regulates Power and Battery stuff)

Is this the architecture openEMS wants?

Now I´m stuck on the PRODUCTION Meter. I´m reading the value from the register but in the UI the value is summed up to consumption. After some trial and error wrote a dummy value into active power and wrote the meter like the PV Inverter Simulator Meter. But still the active power is added to the consumptation. When only using the PV Inverter Simulator Meter the UI displays it the right way.

Here is the UI with my own meter, where I strictly write 1000 as active power


Here is the UI with the simulator meter, where the UI is right.

My questions are following:

  • Is my approach for implementing the hybrid inverter right with three new components?
  • What am I doing wrong with my own written Production Meter
    DeyeMeterImpl.java (5.5 KB)
1 Like

I think this is exactly the same Question i got a few Months ago…

1 Like

Thanks for the reply I now added a simulator reacting grid meter. Now the value is displayed on the grid side of the UI. I want it to be on the production side. Do you have any clue why it is still not working?

I´m setting the active power channel value to 1000 on a meter with type production.

Here is my configuration.


Could you please show me your Code on GitHub as we can work on it better then

First thing is that the “Production Meter” is falsly used here as a Production Meter is really a Meter as such and not a PV-Inverter. So basically your fault is that you define it as a Meter and not a PV-Inverter.

Please share your Code on GitHub so we / I can have a look

You need to have a look in here so you know what i mean i guess:

1 Like

Here is my repo GitHub - Rayleigh3105/openems at production_meter. As mentioned earlier I just want to write a meter which collects the active power from the deye inverter and displays it in the UI. As you can see here I´m strictly writing 1000 the the active power channel of the EletricityMeter. I also have the modbus definition running but I think this is not the problem right now. I just wanted to test if I can get the active power value 1000 to the production side of the UI element. :smiley:

Thanks for helping out.

Greetings

As i said. You need to differ between:

  1. Production Meter as a physical Metering Device
  2. ManagedSymmetricPvInverter (use this)

Also please keep your Repo Up-To-Date because sometimes there are changes in the Meter Implementations so we speak about the last recent Version either way :slight_smile:

I will have a closer look later on your Implementation and maybe fix some things

1 Like

Thanks in advance I will try to get my head around it. Here are the modbus definitions of the deye inverter. now I would add register 673 and 674 to get the production energy.
Deye SUN Inverter Modbus manual.pdf (194.4 KB)

1 Like

Btw:

I recommend using this tool to simulate the Modbus Devices;

https://www.modbustools.com/download.html

ModbusSlave ! :slight_smile:

1 Like

I´m now able to retrieve the data from the inverter the right way. See latest commit. But the UI still displays it on the consumption side of the widget. I also did it like the mentioned PvInverterSolarLogImpl.
In the log I can see that the production and consumptation is the same :confused:


Somehow the ‘Pv-Inverter’ is still missing…

@stefan.feilmeier could you maybe have a look ?

1 Like

Moment, hast du überhaupt ein echtes Grid Meter ? Also ein 3-Phasen Netzzähler?

1 Like

At first I simulated the grid. Now I implemented a grid meter which reads the data from the registers on the deye inverter. This is an old implementation I will now have a look and try to implement it like the GoodWeGridMeter

But it has the same effect


Current configuration

1 Like

Hey @Sn0w3y, have you had a chance to take a look at the case? Maybe I also need a simulated ESS in order to work as expected?

Greetings

Hi @Rayleigh3105 ,

unfortunately i can not clone your Repo, maybe add me as a Maintainer on your fork please - Sn0w3y

1 Like

Hi, I had the same problem some time ago when implementing a PV inverter. The problem is that even though a PV inverter implements the method getMeterType() by returning MeterType.PRODUCTION, the UI doesn’t know this. Instead, it checks a list of hard coded factory IDs. If the PV inverter is not in the list, it won’t show in the UI. There is a PR fixing this, but it hasn’t been merged yet.
The Sum component on the other hand knows the meter type. As the consumption active power is calculated as sum of grid active power, production active power and ess active power, the production power is added to the consumption. You may also check that the channel _sum/ProductionActivePower contains the value.

I am aware of three ways how you can fix this:

  1. Merge the PR from above into your repository
  2. Add the factory ID of your inveter to the list here openems/ui/src/app/shared/edge/edgeconfig.ts at 60b473fe7849d853deedea4d1548464d50d12abb · OpenEMS/openems · GitHub
  3. Add a config parameter type() and set it to MeterType.PRODUCTION, as if it was a normal meter.

I am confident that at least one of the three options will work.

Best regards,
Thomas

1 Like

With the help of @tsicking I can now view Production and Grid values for the DEYE Hybrid Inverter. Next step is to implement the ESS. Thanks for all the help @Sn0w3y / @tsicking

Maybe the above named PR should be merged? @stefan.feilmeier / @Sn0w3y ?

Greetings Moritz

1 Like

Hello @Rayleigh3105,

I wanted to ask how far your development status is to the Deye?
I got a SG05LP3 two weeks ago and therefore it would be very important for me to be able to integrate it into openEMS.

Unfortunately, I don’t have any strong programming skills, but I’m quite good at hardware. Maybe I can contribute something to your development?
I’ve already done some research on Github and also set up the IDE. I was able to fork your Deye project and get it up and running in my test environment. I noticed in the ESS part that some Modbus registers might not be correct here. Likewise, according to my current state of knowledge, it is not so easy to operate the Daye as a pure “AC coupled battery storage”, as this is apparently only possible if many registers between charging and discharging are changed at the same time.

I already have an inquiry in the Deye forum as well as at the Deye Service if there is a simpler solution.

What I have worked out so far:(I am currently testing this with iobroker)

Unload battery:
-Workmode->Sale First
-Activate Usage Time → Register 146 (Bit 0-7 =1)
-Set Usage Time->Power to Time Slot → Register 154-159
-Usage Time->SOC Set Actual Value → Register 166-171

Load battery:
-Workmode->sale first
-Battery settings grid charging → register 130
-Activate usage time → register 146-no extra power setting? Alternatively, only battery setting->battery charging current controllable? → Register 128?
-Usage Time->Grid Charging Activate → Register 172-177
-Usage Time->SOC Set Over Actual Value → Register 166-171

Unfortunately not very simple, I hoped Deye has a workmode ala “AC coupled battery storage” a register to load or unload, i mean-> power + =load; Power - = discharge and 0 = standby.
In my opinion, the register would have to be cyclically described for safety reasons, so that the inverter does not remain in the last state in the event of a failure of the EMS and continues to work uncontrollably.
Unfortunately, this does not seem to exist so far.

Register 77 “Active power regulation” is probably only for solar sales? I don’t have a PV system on the inverter myself, so I can’t test this.

I am happy about feedback

Hi everyone,

I was wondering how far along you are with your integrations for Deye hybrid systems. I am currently planning a new installation, and the Deye inverters seem very interesting due to their wide range of compatible (and affordable) batteries.

regards,
klinki

Good evening!

I have a need to connect exactly the same inverter to OpenEms as you have. Is it possible to use your work? And if you can briefly explain how to integrate your solution, as I am the first time I encounter such programmes

I will be glad to any help.