Implementation DEYE Inverter - Approach


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 (5.5 KB)

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.


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


I recommend using this tool to simulate the Modbus Devices;

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

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?


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,

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