Skip to content

Conversation

@schiegg
Copy link
Contributor

@schiegg schiegg commented Nov 27, 2025

Overview

This pull request adds support for the Janitza UMG806 energy meter.
In our setup, the UMG806 is connected as a Modbus RTU device behind a Janitza UMG604 acting as the master.
OpenEMS communicates with the UMG604 via Modbus TCP, and the UMG806 registers are accessed through this chain. When using a UMG604 as a gateway, the configuration must use the IP address of the UMG604 and the Modbus unit ID, which references the RTU input ID of the UMG806.

The implementation has been fully tested with real hardware (UMG806 + UMG604) at our demonstration site.

This development was carried out within the OMEI project, funded by the German Federal Ministry for Digital and Transport (BMDV).

Included Functionality

  • Full Modbus-based device integration for the UMG806
  • Register mapping and parsing of essential electrical measurements
  • Compatibility with the UMG604 acting as a Modbus RTU → TCP gateway
  • Integration of measured values into the existing OpenEMS data model

Technical Notes

  • UMG806 operates as a Modbus RTU slave behind the UMG604
  • OpenEMS communicates only via Modbus TCP, but transparently reads the UMG806 registers
  • When using the UMG604 as a gateway, OpenEMS must be configured with the UMG604 IP and the Modbus unit ID corresponding to the RTU device
  • Register structure and measurement formats follow the Janitza specifications
  • All functionality was validated using live hardware

Testing

  • Successful Modbus TCP communication with UMG604
  • Access to UMG806 registers via the RTU path
  • Approximate verification of voltages, currents, power, and energy readings
  • Stable operation in a real OpenEMS setup

Credits

A big thank you goes to @himiflo, Ralf and @schiegg for creating, integrating, and evaluating this component.

References

schiegg and others added 4 commits January 12, 2023 11:10
According to the docs "[the open-pull-requests-limit] option has no impact on security updates, which have a separate, internal limit of ten open pull requests".
@Sn0w3y
Copy link
Contributor

Sn0w3y commented Nov 27, 2025

Just because I am curious - is it also possible to Connect to the UMG806 directly without the Master?

@himiflo
Copy link
Contributor

himiflo commented Nov 27, 2025

Just because I am curious - is it also possible to Connect to the UMG806 directly without the Master?

The Janitza UMG 806 meter itself does not support Modbus TCP, as it does not have an RJ45 interface. It is possible to achieve this using the UMG806-EC1 expansion module or as done via a master-slave architecture with a UMG604 as the master providing the ethernet connection.

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Nov 27, 2025

Just because I am curious - is it also possible to Connect to the UMG806 directly without the Master?

The Janitza UMG 806 meter itself does not support Modbus TCP, as it does not have an RJ45 interface. It is possible to achieve this using the UMG806-EC1 expansion module or as done via a master-slave architecture with a UMG604 as the master providing the ethernet connection.

Well possibly we should then mention this somewhere as this is not documented yet, right?

@schiegg
Copy link
Contributor Author

schiegg commented Nov 27, 2025

we should then mention this somewhere as this is not documented yet, right?

Where do you suggest to document it? That the extension is needed is described on the product page of Janitza already?

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Nov 27, 2025

That the extension is needed is described on the product page of Janitza already?

I actually would suggest to write a Hint in the Readme of the Janitza Package or in the Config.
It may be, that Janitza's Documentation does state this Info - still we have MANY Users, who just activate a Component and wonder why it won't work - opening an Issue on GitHub just because.

@schiegg
Copy link
Contributor Author

schiegg commented Nov 27, 2025

still we have MANY Users, who just activate a Component and wonder why it won't work - opening an Issue on GitHub just because.

Comprehensible 😉 A hint at the modbus bridge would then be appropriate I guess, e.g. "ID of Modbus bridge to use. This type of meter can by default only be connected via Modbus TCP enabled master device like the UMG604."

Copy link
Contributor

@sfeilmeier sfeilmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well done. I don't have permissions to edit your PR, so I'll do the remaining changes and cleanups in a separate PR directly on develop.

Thank you for the contribution! 🚀

@Override
protected ModbusProtocol defineModbusProtocol() {
var modbusProtocol = new ModbusProtocol(this,
// Register: 19000–19010 → Spannungen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should be in English language

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translated with efd35ef

@sfeilmeier
Copy link
Contributor

sfeilmeier commented Nov 30, 2025

Ah... unfortunately I cannot fix the conflicts myself. Please update this PR to develop.

Please also add JUnit tests if possible for both implementations.

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

❗ There is a different number of reports uploaded between BASE (22cf89e) and HEAD (05f4404). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (22cf89e) HEAD (05f4404)
java 1 0
Additional details and impacted files
@@              Coverage Diff               @@
##             develop    #3449       +/-   ##
==============================================
- Coverage      59.54%   29.13%   -30.40%     
==============================================
  Files           2901      291     -2610     
  Lines         124935     8116   -116819     
  Branches        9357     1386     -7971     
==============================================
- Hits           74381     2364    -72017     
+ Misses         47737     5629    -42108     
+ Partials        2817      123     -2694     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@schiegg
Copy link
Contributor Author

schiegg commented Dec 1, 2025

Please update this PR to develop.

Done with d95698e, hope that helps.

Checkstyle problems were addressed with 7f0d927. For the missing whitespace in the last check I could't amend to my last commit as I had to synchronize our repos so there is also 793b761.

@schiegg schiegg requested a review from Sn0w3y December 2, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants