Skip to content

wall socket - #4172

Open
LKuemmel wants to merge 5 commits into
feature_consumer_rfidfrom
feature_local_socket
Open

LKuemmel wants to merge 5 commits into
feature_consumer_rfidfrom
feature_local_socket

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

No description provided.

@LKuemmel
LKuemmel added this pull request to stack #4171 October 22, 2026 10:42
@LKuemmel
LKuemmel force-pushed the feature_local_socket branch from 2f28bda to 5fccd3d Compare October 22, 2026 10:42
@LKuemmel
LKuemmel force-pushed the feature_local_socket branch 4 times, most recently from 7dc9400 to 8d50535 Compare October 23, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved hardware-detection, runtime, validation, import, and GPIO conflicts affect correctness and approval readiness.

4 open issues
What changed in this PR

Adds support for automatically detected openWB wall sockets, including SDM120 metering, GPIO control, MQTT integration, RFID handling, and consumer configuration.

Changes:

  • Adds internal socket detection, measurement, state control, fault handling, and MQTT publication.
  • Adds internal-socket consumer configuration, host selection, RFID support, and assignment validation.
  • Refactors shared hardware checks and updates vendor metadata, topic handling, bridge configuration, and tests.
File Description
packages/​modules/​internal_chargepoint_handler/​rfid.py Publishes scanned RFID tags for the internal socket.
packages/​modules/​internal_chargepoint_handler/​internal_socket.py Implements socket measurements and GPIO state control.
packages/​modules/​internal_chargepoint_handler/​internal_socket_test.py Tests socket MQTT handling, heartbeat behavior, and RFID flow.
packages/​modules/​internal_chargepoint_handler/​internal_socket_module_test.py Tests socket measurements and RFID publication.
packages/​modules/​internal_chargepoint_handler/​internal_socket_config.py Defines internal socket data structures.
packages/​modules/​internal_chargepoint_handler/​internal_hardware_check.py Provides shared EVSE, meter, and socket hardware checks.
packages/​modules/​internal_chargepoint_handler/​internal_chargepoint_handler.py Integrates socket detection and runtime handling.
packages/​modules/​internal_chargepoint_handler/​hardware_definition.py Defines meter and EVSE hardware mappings.
packages/​modules/​internal_chargepoint_handler/​clients.py Adds socket meter discovery and GPIO access.
packages/​modules/​devices/​vendors.py Adds readable vendor-group names.
packages/​modules/​consumers/​openwb/​vendor.py Registers the openWB consumer vendor.
packages/​modules/​consumers/​openwb/​internal_socket/​selection.py Resolves socket hosts and validates assignments.
packages/​modules/​consumers/​openwb/​internal_socket/​consumer.py Implements the internal socket consumer.
packages/​modules/​consumers/​openwb/​internal_socket/​consumer_test.py Tests local and remote socket consumer behavior.
packages/​modules/​consumers/​openwb/​internal_socket/​config.py Defines internal socket consumer configuration.
packages/​modules/​consumers/​openwb/​internal_socket/​__init__.py Initializes the internal socket consumer package.
packages/​modules/​consumers/​openwb/​__init__.py Initializes the openWB consumer package.
packages/​modules/​configuration.py Uses centralized vendor-group labels.
packages/​modules/​common/​store/​_socket_internal.py Publishes internal socket measurements.
packages/​modules/​common/​store/​__init__.py Exposes the internal socket value store.
packages/​modules/​common/​hardware_check.py Contains shared meter-value validation logic.
packages/​modules/​common/​hardware_check_test.py Tests the refactored hardware checks.
packages/​modules/​common/​fault_state.py Routes internal socket fault topics.
packages/​modules/​common/​component_type.py Adds the internal socket component type.
packages/​main.py Runs socket auto-detection during startup.
packages/​helpermodules/​update_config.py Registers internal socket topics for configuration updates.
packages/​helpermodules/​subdata.py Subscribes to and stores internal socket data.
packages/​helpermodules/​setdata.py Validates and republishes internal socket commands and values.
packages/​helpermodules/​mosquitto_dynsec/​missing_role_topics_test.py Covers internal socket topics in ACL validation.
packages/​helpermodules/​command.py Validates socket creation and handles socket removal.
packages/​helpermodules/​command_test.py Tests socket assignment and removal behavior.
packages/​control/​consumer/​rfid.py Enables RFID support for internal socket consumers.
packages/​control/​consumer/​rfid_test.py Extends RFID tests to internal socket consumers.
data/​config/​mosquitto/​local/​openwb_local.conf Bridges internal socket topics between openWB instances.

Review effort: Lite

Comment thread packages/modules/internal_chargepoint_handler/internal_hardware_check.py Outdated
Comment thread packages/helpermodules/command.py Outdated
Comment on lines +1209 to +1210
try:
validate_selection(socket_configuration)
Comment thread packages/modules/consumers/openwb/internal_socket/selection.py Outdated
Comment thread packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py Outdated
LKuemmel and others added 4 commits October 23, 2026 16:28
…ween hardware checks and clients'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Meter failures can leave the socket powered on, and switch-state reporting and broker configuration rollout also need correction.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Bump openwb-version header to 22 for bridge rule updates

data/​config/​mosquitto/​local/​openwb_local.conf:41

Increment the openwb-version header from 21 to 22 along with this bridge rule. runs/setup_mosquitto.sh:201–205 copies this configuration only when its version differs from the installed file. Existing version-21 installations therefore skip the update, leaving socket measurements, status and RFID data unavailable to remote consumers through the public broker.

Medium severity Include socket switch state in ConsumerState

packages/​modules/​consumers/​openwb/​internal_socket/​consumer.py:59

Include the received socket switch state in ConsumerState. The handler publishes openWB/internal_socket/get/state, but this constructor omits it, so ConsumerState.state defaults to False. ConsumerValueStoreBroker then publishes False to the consumer's get/state topic on every successful update, even when the socket is on.

3 resolved since last review

Review effort: Balanced

Comment on lines +295 to +297
self.module.get_values(data.last_tag)
heartbeat_expired = self._check_heartbeat_expired(global_data.heartbeat)
self.update_state.update_state(data, heartbeat_expired)
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.

2 participants