Skip to content

Conversation

@sthhs
Copy link
Contributor

@sthhs sthhs commented Aug 29, 2025

This PR extends and replaces #3237.
The component requests the actual power, voltage, current, plug state, charge state and energy values from an OpenWB Series 2 with one or two internal charge points in primary mode, which is commonly used. In this case the wallbox can only be monitored from other systems with http requests and can not be controlled.
The purpose is displaying and archiving the most important values in OpenEMS.
The pictures show the corresponding energy meter values in the OpenWB GUI and in OpenEMS at nearly the same moment.
Bildschirmfoto 2025-07-13 um 14 46 57
Bildschirmfoto 2025-07-13 um 14 46 54

These channels can be requested from the internal charge point:
Bildschirmfoto 2025-07-13 um 17 22 14

The evcs modal widget, showing the current charge power:
Bildschirmfoto 2025-08-28 um 20 06 07

And after the charging has finished:
Bildschirmfoto 2025-08-29 um 20 29 21

The charged energy is calculated from the difference of the actual imported energy from the OpenWB and the value at the time when the car is plugged in. The values from the OpenWB monitoring and this component are the same:
Bildschirmfoto 2025-08-29 um 20 29 13

@codecov
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 49.30556% with 73 lines in your changes missing coverage. Please review.

❌ Your patch status has failed because the patch coverage (49.31%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3299      +/-   ##
=============================================
- Coverage      59.59%   59.54%   -0.05%     
  Complexity       112      112              
=============================================
  Files           2895     2899       +4     
  Lines         124724   124868     +144     
  Branches        9347     9355       +8     
=============================================
+ Hits           74319    74336      +17     
- Misses         47586    47724     +138     
+ Partials        2819     2808      -11     
🚀 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.

description = "Implements the evcs component for OpenWB Series2 with internal chargepoints via HTTP API")
@interface Config {

enum ChargePoint{
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add this to an "enum" Package as in other Implementations? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

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

See my comment :)

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Oct 11, 2025

Please still fix your checkstyle Issues

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Oct 11, 2025

https://openems.github.io/openems.io/openems/latest/contribute/coding-guidelines.html
You do not have only one Checkstyle Issue - it just exits after one..

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Nov 3, 2025

@sthhs
Copy link
Contributor Author

sthhs commented Nov 4, 2025

May i ask, why we can not use Modbus on this EVSE?

This component is for monitoring the OpenWB in primary mode, which means it is controlled by it's own software.
Modbus can only be activated and used in secondary mode (controlled by another system):
https://wiki.openwb.de/doku.php?id=openwb:api
Bildschirmfoto 2025-11-04 um 07 57 18
Bildschirmfoto 2025-11-04 um 07 57 09

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.

Thanks for continuously updating this PR. I took some time to review and cleanup the code and it is merge ready now.

Some thoughts or future TODOs, still:

  • I am not sure HTTP is really the best protocol for OpenWB. There support for MQTT seems to be better and would use much less requests. Currently there is one request per datapoint per Cycle or second
  • The ReadWorker approach is rather old in OpenEMS. Nowadays we would use the HTTP-Bridge
  • PhaseRotation should be configurable
  • I refactored the part in ReadWorker where you are setting the values in such a way, that the Channels would get reset if there was a read error
  • I deleted unused Channels
  • You are calculating Energy from Power values; but Session Energy is calculated from the original Energy read from OpenWB. Thats insonsistent.

Feel free to open up new followup PRs. I am merging this one now.

@sfeilmeier sfeilmeier merged commit 21eb372 into OpenEMS:develop Nov 30, 2025
5 of 7 checks passed
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