Skip to content

Feature/ethernet support#4

Open
Brunke wants to merge 8 commits into
phurth:mainfrom
Brunke:feature/ethernet-support
Open

Feature/ethernet support#4
Brunke wants to merge 8 commits into
phurth:mainfrom
Brunke:feature/ethernet-support

Conversation

@Brunke

@Brunke Brunke commented Apr 18, 2026

Copy link
Copy Markdown

This PR introduces support for CAN-to-Ethernet Gateways (IDS-CAN protocol) to allow older OneControl systems that lack direct BLE to be integrated into Home Assistant over the local network.

Because the underlying data structures between BLE and the CAN bridge share significant DNA, this implementation reuses the vast majority of the existing entity classes and data parsing logic.

Key Additions:

  • Network Transport (IdsCanRuntime): Added an Ethernet runtime to handle TCP/UDP sessions, frame decoding, and heartbeat polling with the bridge.

  • Config Flow & Discovery: Added config flow support for selecting a CAN-to-Ethernet connection. Includes automatic UDP advertisement discovery to pre-fill the host/port (defaults to 192.168.1.1:6969).

  • Device Metadata Import: The legacy IDS-CAN protocol does not expose device metadata over the network. To solve this, users can now paste the contents of DeviceManifestV1.json and DeviceSnapshotV1.json (obtained via the official app's diagnostic dump) directly into the config flow to automatically map entity names.

    • Entity Support: Tested and working with:
    • Dimmable and RGB Lights (mapped to HSV)
    • HVAC Controls & Status
    • Relay Switches
    • Tank Sensors & Hour Meters
    • Covers / Slide Sensors
  • Documentation: Updated README.md with setup instructions and steps for generating the metadata JSON files.

@Brunke Brunke requested a review from phurth as a code owner April 18, 2026 19:37

@phurth phurth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Requesting changes before merge due to several correctness/reliability issues that should be addressed first.

  1. Runtime table-id fallback can mis-key entities and commands
  • File: custom_components/ha_onecontrol/runtime/ids_can_runtime.py
  • The IDS runtime falls back to default table_id=0x03 before GatewayInfo arrives. On systems where table_id differs, identity/state keys can be created under the wrong table, then later diverge once real gateway info is known.
  • Please avoid hard-coding 0x03 for bootstrap identity mapping, or gate identity/state creation until authoritative table context is known.
  1. Ethernet discovery can fail hard on UDP bind errors
  • File: custom_components/ha_onecontrol/protocol/ethernet_discovery.py
  • Discovery binds multiple UDP ports without resilient per-port error handling. A single OSError (port in use/restricted) can abort discovery.
  • Please catch bind failures per port, continue with remaining ports, and return partial results with clear diagnostics.
  1. Ethernet exposes controls that are unimplemented/no-op
  • Files: custom_components/ha_onecontrol/button.py, custom_components/ha_onecontrol/coordinator.py
  • The button platform now makes controls broadly available, but coordinator paths show Ethernet lockout clear not implemented and metadata refresh disabled for Ethernet.
  • Please either implement these operations for Ethernet or hide/disable those buttons for Ethernet to prevent misleading UX.
  1. Diagnostics redaction appears incomplete for new naming options
  • Files: custom_components/ha_onecontrol/diagnostics.py, custom_components/ha_onecontrol/config_flow.py
  • Added naming JSON options can be persisted but are not in the explicit diagnostics redaction list.
  • Please redact/summarize these fields in diagnostics output to reduce leakage risk when users share bundles publicly.
  1. Branch is merge-conflicting and needs rebase/revalidation
  • PR currently reports merge conflicts. Please rebase onto current main and re-run tests/QA to ensure current migration/pairing behavior is preserved.

After those are addressed, I’m happy to re-review.

@phurth

phurth commented May 5, 2026

Copy link
Copy Markdown
Owner

Follow-up prioritization to help scope the next revision.

Must-fix before merge:

  1. Runtime table-id bootstrap fallback (0x03) can mis-key entities/commands on non-0x03 systems.
  2. Ethernet discovery should tolerate per-port UDP bind failures and continue discovery.
  3. Rebase to resolve merge conflicts, then re-run tests/QA against current main.

Can be follow-up if needed (but preferred in this PR):

  1. Hide/disable Ethernet-only no-op controls unless fully implemented.
  2. Expand diagnostics redaction/summarization for naming JSON options.

If you want, I can re-review quickly after the first three are addressed and call out any residual risk.

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