Conversation
This update significantly refactors the OpenWB EVCS integration for improved reliability and maintainability. Changes include the removal of the ReadWorker class in favor of using the BridgeHttpFactory and HttpBridgeCycleServiceDefinition for handling HTTP requests to the OpenWB API. This approach simplifies the codebase by leveraging existing infrastructure for HTTP communications, thereby reducing custom network handling code. Additionally, SSL certificate validation for OpenWB's self-signed certificates is now globally disabled within this component to prevent connection issues. The update also introduces more granular handling of OpenWB's API responses for statuses, power, energy, and other metrics, improving the accuracy and responsiveness of the EVCS component. This refactor ensures better alignment with OpenEMS architecture and prepares the ground for future enhancements.
This update transitions the OpenWB EVCS integration from using HTTP API calls to MQTT for communication. The change involves modifying the configuration to use MQTT URI, username, and password instead of IP address and port. It also includes updates to the implementation to subscribe to MQTT topics for receiving data such as power, voltage, and state changes, and to publish commands. This migration improves the reliability and efficiency of the communication with OpenWB devices by leveraging the lightweight MQTT protocol, which is better suited for real-time data exchange in IoT applications.
Introduces the 'io.openems.edge.bridge.mqtt' module, providing MQTT communication support for OpenEMS Edge with MQTT 3.1, 3.1.1, and 5.0 via HiveMQ client. Adds configuration, connection handlers, API interfaces, and subscription management. Updates build and application files to include the new bridge and its dependencies.
This commit replaces the HiveMQ client with the Eclipse Paho client for both MQTT 3.x and MQTT 5.0 connection handlers in the MQTT bridge component. The change includes adapting the connection, publishing, subscription, and disconnection logic to utilize the Eclipse Paho API. This upgrade addresses compatibility issues with the previous client and improves the stability and flexibility of MQTT communications. The implementation now supports detailed configuration options provided by Eclipse Paho, such as automatic reconnection handling, advanced authentication mechanisms, and Last Will and Testament (LWT) features. Additionally, the commit introduces a custom reconnection strategy and enhances the handling of MQTT message subscriptions and deliveries, ensuring more robust and reliable MQTT service integration.
This commit updates the MQTT dependencies for the io.openems.edge.bridge.mqtt module. Specifically, it adds bcpkix and bcprov with version 1.78.1 to the buildpath, and replaces the com.hivemq:hivemq-mqtt-client-shaded and io.reactivex.rxjava2.rxjava dependencies with io.openems.wrapper.paho-mqttv5, org.eclipse.paho.client.mqttv3, and org.eclipse.paho.mqttv5.client, all versioned at 1.2. This change aims to standardize MQTT client usage across the project and ensure compatibility with the latest MQTT protocol versions.
This commit introduces unit tests for MQTT connection handlers across different MQTT protocol versions (3.1, 3.1.1, and 5). It includes tests for constructor behavior, connection status checks, publish/subscribe/unsubscribe operations when not connected, and topic matching with various wildcard scenarios. The tests ensure that the connection handlers behave as expected across different scenarios, including handling SSL connections, and correctly interpreting MQTT quality of service (QoS) levels. This comprehensive test suite aims to improve the reliability and robustness of the MQTT bridge by validating its core functionalities.
This commit overhauls the MQTT integration for the OpenWB Electric Vehicle Charging Station (EVCS) component, transitioning from a direct MQTT client implementation to utilizing the centralized MQTT bridge. The changes include removing direct MQTT connection handling in favor of subscribing to topics through the MQTT bridge, adapting the configuration to specify the MQTT bridge ID instead of individual MQTT connection parameters, and updating the handling of MQTT messages to work with the bridge's mechanisms. Additionally, the test cases were updated to mock the MQTT bridge and simulate message reception, ensuring the component correctly processes incoming data. This refactor improves maintainability by centralizing MQTT management and enhances testability through better simulation capabilities.
Deleted the MQTT Bridge implementation, including all related classes, interfaces, and unit tests. This change could be due to a refactoring decision to either move the MQTT functionality to a different module or to redesign the MQTT communication strategy within the system. Removing these files indicates a significant change in how MQTT communication is handled within the project.
This commit removes unused dependencies from the project to streamline the build process and reduce potential conflicts. Specifically, the 'com.hivemq:hivemq-mqtt-client-shaded' dependency was removed from cnf/pom.xml, and a duplicate entry for 'org.eclipse.paho.client.mqttv3' was removed from io.openems.edge.application/EdgeApp.bndrun.
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (64.11%) 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 #3467 +/- ##
=============================================
+ Coverage 59.43% 59.46% +0.04%
Complexity 112 112
=============================================
Files 2912 2912
Lines 125401 125436 +35
Branches 9394 9394
=============================================
+ Hits 74516 74583 +67
+ Misses 48054 48002 -52
- Partials 2831 2851 +20 🚀 New features to boost your workflow:
|
|
@sfeilmeier Unfortunately I only implemented it based on the Documentation of OpenWB - maybe @sjjh could help us out and test ? :) |
|
@Sn0w3y It works with my OpenWB. The only thing I've found is that energyStartSession is not initialized if the component is activated while the box is charging. |
It will not actually break your Implementation but "improve" it to use MQTT instead of HTTP Requests. Would be great to have your Feedback afterwards! |
Already tested:
|
Initialize energyStartSession when charging has already been started.
|
@sjjh should be fixed now - please check :)
|
|
@sfeilmeier i guess ready to merge 🎉😋 |
|
We indeed don't own any openWB. We're still struggling with the ABL and Alven. :D In case we would switch to openWB, are all features of it supported in OpenEMS? |
Please have a look at the Code - it is hard to Answer "Functions" of Code - especially on GitHub (for Developers mainly) - please move such Conversations to community. |
No description provided.