-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Display attribute of an entity in Gauge card #38831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the |
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe gauge card documentation was updated to introduce a new optional YAML configuration parameter Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GaugeCardDocumentation
User ->> GaugeCardDocumentation: View gauge card documentation
GaugeCardDocumentation ->> User: Show example using attribute key to display entity attribute
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
source/_dashboards/gauge.markdown (1)
38-41
: 🛠️ Refactor suggestionDocument the new
attribute
option in the configuration tableThe example demonstrates an
attribute
key, but the YAML configuration reference (lines 33–117) doesn’t listattribute
. We should add it so users know how to configure it.@@ entity: required: true description: Entity ID to show. type: string +attribute: + required: false + description: Attribute of the entity to display instead of its state. + type: string
🧹 Nitpick comments (2)
source/_dashboards/gauge.markdown (2)
202-202
: Improve wording for clarityAdd an article to match English grammar. This reads more naturally:
-Display attribute of an entity instead of its state: +Display an attribute of an entity instead of its state:🧰 Tools
🪛 LanguageTool
[uncategorized] ~202-~202: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... color: var(--error-color)Display attribute of an entity instead of its state:
...(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
210-211
: Surround fenced code block with blank linesMarkdownlint (MD031) recommends blank lines before and after fenced code blocks. There's a blank line before the snippet, but none after. Add one after the closing ````` to separate it from the following paragraph.
@@
In this example, the card displays the
battery_level
attribute of thesensor.back_door_info
entity.<details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 210-210: Fenced code blocks should be surrounded by blank lines null (MD031, blanks-around-fences) </details> </details> </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 59a34bdfe36b5b62dfdfda0e0b609095b9be990b and e9bfc2ffb8e159b7fd750eb276c45f213285ec0f. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `source/_dashboards/gauge.markdown` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>source/_dashboards/gauge.markdown</summary> [uncategorized] ~202-~202: The grammatical number of this noun doesn’t look right. Consider replacing it. Context: ... color: var(--error-color) ``` Display attribute of an entity instead of its state: ```... (AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER) </details> </details> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> <details> <summary>source/_dashboards/gauge.markdown</summary> 210-210: Fenced code blocks should be surrounded by blank lines null (MD031, blanks-around-fences) </details> </details> </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms (3)</summary> * GitHub Check: Redirect rules - home-assistant-docs * GitHub Check: Header rules - home-assistant-docs * GitHub Check: Pages changed - home-assistant-docs </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
source/_dashboards/gauge.markdown (2)
42-45
: Add punctuation for consistency inattribute
description.Other descriptions in this block end with a period. Update the
attribute
parameter’s description to match:@@ line 44 - description: Attribute from the selected entity to display + description: Attribute from the selected entity to display.
206-214
: Improve grammar and surrounding blank lines for the example section.The heading is missing an article and the fenced block needs a blank line after it per markdownlint (MD031). Apply:
@@ line 206 -Display attribute of an entity instead of its state: +Display an attribute of an entity instead of its state: @@ line 214 -``` +```🧰 Tools
🪛 LanguageTool
[uncategorized] ~206-~206: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... color: var(--error-color)Display attribute of an entity instead of its state:
...(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
🪛 markdownlint-cli2 (0.17.2)
214-214: Fenced code blocks should be surrounded by blank lines
null(MD031, blanks-around-fences)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
source/_dashboards/gauge.markdown
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_dashboards/gauge.markdown
[uncategorized] ~206-~206: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... color: var(--error-color) Display attribute of an entity instead of its state:
...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
🪛 markdownlint-cli2 (0.17.2)
source/_dashboards/gauge.markdown
214-214: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - home-assistant-docs
- GitHub Check: Header rules - home-assistant-docs
- GitHub Check: Pages changed - home-assistant-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @vhonchar 👍
Proposed change
Allow Gauge Card to display any attribute if selected entity. While HA offers derivative sensors to extract attributes our of anything, this feature provides more user-friendly way of displaying any attribute of an entity
Example of non-numeric sensor

Example after configuring display of an attribute

Note, the screenshot is made with the use of a custom sensor entity, which state is a string value ("upcoming" or "overdue"), and which has numeric attributes
counter_state
.Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
Summary by CodeRabbit