Skip to content

[wifi-info] Add IP address text sensor - #25

Merged
bharvey88 merged 1 commit into
betafrom
wifi-info-ip-address
Feb 27, 2026
Merged

bharvey88 merged 1 commit into
betafrom
wifi-info-ip-address

Conversation

@bharvey88

@bharvey88 bharvey88 commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a wifi_info IP address text sensor to Core.yaml

Test plan

  • Confirm IP Address entity appears in Home Assistant after flashing
  • Confirm entity shows the correct IP address

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

Summary by CodeRabbit

  • New Features
    • ESPHome devices now expose their IP address information.

@coderabbitai

coderabbitai Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@bharvey88 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d6db296 and 80c1945.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

Walkthrough

A new text_sensor configuration block was added to expose the ESPHome device's IP address using the wifi_info platform. The sensor is named "IP Address" with identifier wifi_ip for integration monitoring and observability purposes.

Changes

Cohort / File(s) Summary
ESPHome Wifi Info Sensor
Integrations/ESPHome/Core.yaml
Added text_sensor integration with wifi_info platform to expose device IP address, including sensor name and unique identifier configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A curious rabbit hops with glee,
"Now networks near can surely see,
Our little device's IP address bright,
Shining through the digital night!" ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[wifi-info] Add IP address text sensor' directly and accurately summarizes the main change: adding an IP address text sensor to the wifi_info integration in Core.yaml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wifi-info-ip-address

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
Integrations/ESPHome/Core.yaml (2)

298-302: Add entity_category: "diagnostic" for consistency.

The existing wifi_signal_db RSSI sensor (Line 271) carries entity_category: "diagnostic". The IP address sensor is the same kind of network-diagnostic entity and should be categorized consistently so it lands in the HA Diagnostics section rather than the main entity list.

♻️ Proposed fix
 text_sensor:
   - platform: wifi_info
     ip_address:
       name: "IP Address"
       id: wifi_ip
+      entity_category: "diagnostic"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Integrations/ESPHome/Core.yaml` around lines 298 - 302, Update the wifi IP
text sensor block (text_sensor -> platform: wifi_info -> ip_address with id:
wifi_ip) to include entity_category: "diagnostic" so it is categorized like the
existing wifi_signal_db RSSI sensor; add the entity_category key inside the
ip_address sensor definition next to name/id to ensure it appears under Home
Assistant Diagnostics.

298-302: Consider using address_0 for deterministic IPv4 reporting if IPv6 is enabled.

The ESP-IDF framework supports dual-stack IPv4/IPv6. If network.enable_ipv6 is set to true, the device can obtain multiple IP addresses, and the bare ip_address sensor may surface an IPv6 address instead of IPv4. ESPHome supports up to five address sensors (address_0–address_4) for reporting all addresses. To ensure IPv4 is always reported first, pin the primary sensor to address_0.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Integrations/ESPHome/Core.yaml` around lines 298 - 302, The wifi_info
text_sensor currently uses the generic ip_address field (text_sensor ->
platform: wifi_info -> ip_address with id wifi_ip); update this to use the
indexed address_0 sensor instead so the primary IPv4 is reported
deterministically when IPv6 is enabled (replace ip_address with address_0 while
keeping the name "IP Address" and id wifi_ip).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Integrations/ESPHome/Core.yaml`:
- Around line 298-302: Update the wifi IP text sensor block (text_sensor ->
platform: wifi_info -> ip_address with id: wifi_ip) to include entity_category:
"diagnostic" so it is categorized like the existing wifi_signal_db RSSI sensor;
add the entity_category key inside the ip_address sensor definition next to
name/id to ensure it appears under Home Assistant Diagnostics.
- Around line 298-302: The wifi_info text_sensor currently uses the generic
ip_address field (text_sensor -> platform: wifi_info -> ip_address with id
wifi_ip); update this to use the indexed address_0 sensor instead so the primary
IPv4 is reported deterministically when IPv6 is enabled (replace ip_address with
address_0 while keeping the name "IP Address" and id wifi_ip).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e79266 and d6db296.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

@TrevorSchirmer

Copy link
Copy Markdown
Member

@bharvey88 Conflict

@bharvey88
bharvey88 force-pushed the wifi-info-ip-address branch from 83d014d to 80c1945 Compare February 27, 2026 19:02
@bharvey88
bharvey88 merged commit d73a082 into beta Feb 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants