Skip to content

Add an Ethernet Only switch that turns WiFi off on Ethernet - #120

Merged
TrevorSchirmer merged 2 commits into
betafrom
feat/ethernet-only
Nov 24, 2026
Merged

TrevorSchirmer merged 2 commits into
betafrom
feat/ethernet-only

Conversation

@Bunton33

@Bunton33 Bunton33 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Version: 26.11.19.1

What does this implement/fix?

Adds an opt-in Ethernet Only config switch (off and disabled by default). When it's on, WiFi turns off whenever Ethernet is connected, so only the wired address is reachable and advertised, and WiFi comes back if the cable is unplugged. A customer with the HAT found Music Assistant's Sendspin connection on the WiFi address, which caused late-audio drops and an 11-minute dropout when WiFi was blocked.

If Home Assistant added the device by its WiFi IP, it may show it as unavailable after the switch turns WiFi off, until HA restarts or the host is changed; the README says so. Default behaviour is unchanged.

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Compiles on ESPHome 2026.10.2. Not tested on hardware yet; worth a bench run with the HAT and a real Home Assistant before it leaves beta.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added an Ethernet Only option. When enabled, WiFi is turned off while Ethernet is connected; WiFi can return when the Ethernet cable is unplugged.
    • WiFi recovery behavior now accounts for Ethernet status and the Ethernet Only setting.
  • Documentation
    • Added guidance for devices that appear unavailable in Home Assistant after switching from a WiFi connection to Ethernet.

With the Ethernet HAT the device stays on WiFi too, so clients like
Music Assistant can end up on the WiFi address. The opt-in switch
releases WiFi while Ethernet is connected and brings it back if the
cable is unplugged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the new-feature New feature or request label Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6663a5c-9d95-4e0e-b009-919f7ac36577
Commits

Reviewing files that changed from the base of the PR and between ee46977 and 0626c3f.

Files selected for processing: 2

  • Integrations/ESPHome/Core.yaml
  • README.md

No actionable comments were generated in the recent review.

Walkthrough

The ESPHome configuration adds an Ethernet Only switch and changes WiFi release and recovery conditions. The README documents the switch and notes a Home Assistant availability issue that can occur when a device was added by WiFi IP.

Changes

Ethernet and WiFi behavior

Layer / File(s) Summary
Ethernet Only switch and recovery gating
Integrations/ESPHome/Core.yaml, README.md
The switch is disabled by default. It stops the recovery probe and can release WiFi when enabled. When disabled, it can start the probe under the documented connection and provisioning conditions. The periodic recovery condition also requires the switch to be off. The README describes the switch and the Home Assistant connectivity note. The configured firmware version changes to 26.11.19.1.
Ethernet and WiFi event handling
Integrations/ESPHome/Core.yaml
Ethernet handling now releases WiFi when the access point is active or Ethernet Only is enabled. Post-association and disconnect handling avoid releasing WiFi while the recovery probe is running.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant EthernetOnlySwitch
  participant Ethernet
  participant WiFiRecoveryProbe
  participant WiFi
  EthernetOnlySwitch->>WiFiRecoveryProbe: Stop probe when enabled
  EthernetOnlySwitch->>Ethernet: Check connection state
  EthernetOnlySwitch->>WiFi: Release WiFi when enabled and Ethernet is connected
  EthernetOnlySwitch->>Ethernet: Check connection state when disabled
  EthernetOnlySwitch->>WiFiRecoveryProbe: Start probe when Ethernet is connected, WiFi is disabled, and WiFi was provisioned
Loading

Suggested labels: new-feature

Suggested reviewers: westwardwinds

Merge Risk: Minimal · previous review ee469

This adds an opt-in Ethernet Only switch that is off by default, so existing behavior is unchanged. Bench testing with the HAT and Home Assistant is still advisable, but no merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add an Ethernet Only switch that turns WiFi off on Ethernet" matches the main change. The changeset adds an Ethernet Only switch that releases WiFi while Ethernet is connected, and the READ…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Add an Ethernet Only switch that turns WiFi off on Ethernet" matches the main change. The changeset adds an Ethernet Only switch that releases WiFi while Ethernet is connected, and the README documents the same option. The title is specific and describes the primary behavior, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the cable glow
The WiFi rests when wires flow
A probe waits, then starts anew
When Ethernet is no longer true
The rabbit hops through fields of green

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5dcff7cb-43bc-414b-bf81-e159fe95b9c8
Commits

Reviewing files that changed from the base of the PR and between 28e58a1 and ee46977.

Files selected for processing: 2

  • Integrations/ESPHome/Core.yaml
  • README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@TrevorSchirmer
TrevorSchirmer merged commit 348e289 into beta Nov 24, 2026
6 of 7 checks passed
@TrevorSchirmer
TrevorSchirmer deleted the feat/ethernet-only branch November 24, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants