Skip to content

[Edge] Carlo Gavazzi EM100 meter: fix modbus registers for Energy#3215

Merged
sfeilmeier merged 5 commits intoOpenEMS:developfrom
sthhs:EM100-Fix
Jul 1, 2025
Merged

[Edge] Carlo Gavazzi EM100 meter: fix modbus registers for Energy#3215
sfeilmeier merged 5 commits intoOpenEMS:developfrom
sthhs:EM100-Fix

Conversation

@sthhs
Copy link
Copy Markdown
Contributor

@sthhs sthhs commented Jun 26, 2025

The modbus registers in the previous implementation for production and consumption energy are not correct.
They had to be changed to 300017 and 300033. See on page 8:
https://www.gavazziautomation.com/fileadmin/images/PIM/OTHERSTUFF/COMPRO/EM111_EM112_ET112_CP.pdf

@sthhs sthhs changed the title Fix modbus registers for consumption and production Carlo Gavazzi EM100: Fix modbus registers for consumption and production Jun 26, 2025
@sthhs sthhs changed the title Carlo Gavazzi EM100: Fix modbus registers for consumption and production Carlo Gavazzi EM100: Fix consumption and production modbus registers Jun 26, 2025
@sthhs sthhs changed the title Carlo Gavazzi EM100: Fix consumption and production modbus registers Carlo Gavazzi EM100: Fix consumption and production energy modbus registers Jun 26, 2025
@sthhs sthhs changed the title Carlo Gavazzi EM100: Fix consumption and production energy modbus registers Fix consumption and production energy modbus registers of Carlo Gavazzi EM100 Jun 26, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3215      +/-   ##
=============================================
- Coverage      59.16%   59.15%   -0.01%     
  Complexity       139      139              
=============================================
  Files           2682     2682              
  Lines         115840   115840              
  Branches        8533     8533              
=============================================
- Hits           68523    68508      -15     
- Misses         44757    44771      +14     
- Partials        2560     2561       +1     
🚀 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.

Copy link
Copy Markdown
Collaborator

@Sn0w3y Sn0w3y left a comment

Choose a reason for hiding this comment

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

Just a general Question - why don't we also integrate a "Invert" Function as in the other Meters so one can swap Production and Consumption aswell ?

/**
* See Modbus definition PDF-file in doc directory and
* https://www.galoz.co.il/wp-content/uploads/2014/11/EM341-Modbus.pdf
* https://www.gavazziautomation.com/fileadmin/images/PIM/OTHERSTUFF/COMPRO/EM111_EM112_ET112_CP.pdf
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Inverting the values is already implemented for this meter (line 101):
if (this.config.invert()) { energyChannelId300017 = ElectricityMeter.ChannelId.ACTIVE_CONSUMPTION_ENERGY; energyChannelId300033 = ElectricityMeter.ChannelId.ACTIVE_PRODUCTION_ENERGY; } else { energyChannelId300017 = ElectricityMeter.ChannelId.ACTIVE_PRODUCTION_ENERGY; energyChannelId300033 = ElectricityMeter.ChannelId.ACTIVE_CONSUMPTION_ENERGY; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sfeilmeier sfeilmeier changed the title Fix consumption and production energy modbus registers of Carlo Gavazzi EM100 [Edge] Carlo Gavazzi EM100 meter: fix modbus registers for Energy Jul 1, 2025
Copy link
Copy Markdown
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.

Thank you!

@sfeilmeier sfeilmeier merged commit 6dd3602 into OpenEMS:develop Jul 1, 2025
2 checks passed
@sthhs
Copy link
Copy Markdown
Contributor Author

sthhs commented Jul 2, 2025

@sfeilmeier: Thank you for reviewing. Now the energy is calculated as expected:
Bildschirmfoto 2025-07-02 um 11 36 38

@sthhs sthhs deleted the EM100-Fix branch July 15, 2025 07:53
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.

3 participants