Skip to content

Conversation

@eifinger
Copy link
Contributor

@eifinger eifinger commented Nov 28, 2025

Proposed change

The existing documentation has a lot of examples on how the friendly names are created but I had troubles understanding how the entity_ids get created especially for the "main feature" of a device.

Only after playing around with it in a debug setup did it click for me.

At least for me the added example would have provided the insight I was looking for.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

  • Documentation
    • Added clarifying examples in entity documentation to illustrate how device entity IDs are derived when a device has a main feature.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

📝 Walkthrough

Walkthrough

Documentation update to entity.md clarifying how entity IDs are derived for devices with a main feature, using "nightstand" as an example where entity_id becomes "light.nightstand".

Changes

Cohort / File(s) Summary
Documentation updates
docs/core/entity.md
Adds clarifying example explaining entity ID derivation when a device has a main feature; updates both has_entity_name discussion and main feature explanation sections

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding an entity_id example for the has_entity_name feature in documentation.
Description check ✅ Passed The description follows the template structure, includes a clear proposed change explaining the motivation, checks the appropriate type of change box, completes the checklist items, but leaves the 'Additional information' fields mostly empty.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4f6795e and 97e2856.

📒 Files selected for processing (1)
  • docs/core/entity.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant
🔇 Additional comments (1)
docs/core/entity.md (1)

145-148: Well-targeted documentation clarification.

The example directly addresses the confusion point mentioned in the PR objectives. Adding the concrete "light.nightstand" example right after defining the "main feature" concept makes the entity_id formation rule immediately clear and practical. The placement is excellent—it grounds the abstract concept before the friendly_name composition rules.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.


If the entity represents a single main feature of a device the entity should typically have its name property return `None`.
The "main feature" of a device would for example be the `LightEntity` of a smart light bulb.
For a device named "nightstand" the entity id would then be `light.nightstand`.
Copy link
Member

Choose a reason for hiding this comment

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

I'd explain the entity_id together with friendly_name below instead as the entity_id has the same relationship between device name and entity name as friendly_name.

@home-assistant home-assistant bot marked this pull request as draft December 8, 2025 12:01
@home-assistant
Copy link

home-assistant bot commented Dec 8, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

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