Skip to content

Refactor threshold trigger and condition docs into shared includes - #45719

Merged
c0ffeeca7 merged 9 commits into
currentfrom
threshold_triggers_conditions_reuse
Jun 17, 2026
Merged

Refactor threshold trigger and condition docs into shared includes#45719
c0ffeeca7 merged 9 commits into
currentfrom
threshold_triggers_conditions_reuse

Conversation

@abmantis

@abmantis abmantis commented Jun 2, 2026

Copy link
Copy Markdown
Member

Proposed change

Move duplicated parts of the threshold triggers/conditions into a set of shared includes.
Applied it to temperature and humidity. If the approach is approved, we can extend it later to others.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Copilot AI review requested due to automatic review settings June 2, 2026 22:20
@home-assistant home-assistant Bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Jun 2, 2026
@home-assistant

home-assistant Bot commented Jun 2, 2026

Copy link
Copy Markdown

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

@netlify

netlify Bot commented Jun 2, 2026

Copy link
Copy Markdown

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 7072c24
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/6a32b22732cafa00084fd48e
😎 Deploy Preview https://deploy-preview-45719--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the “threshold” family of trigger and condition documentation by extracting duplicated UI/YAML explanation blocks into shared includes, and then applying those includes to the temperature and humidity trigger/condition pages.

Changes:

  • Introduces reusable include partials for “crossed threshold” and “changed” triggers (UI steps + UI options + YAML options).
  • Introduces reusable include partials for “threshold value” conditions (UI steps + UI options + YAML options).
  • Updates the temperature and humidity trigger/condition pages to use the new shared includes.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
source/_triggers/temperature.crossed_threshold.markdown Replaces duplicated UI/YAML option text with shared “crossed threshold” includes (temperature variant).
source/_triggers/temperature.changed.markdown Replaces duplicated UI/YAML option text with shared “changed” includes (temperature variant).
source/_triggers/humidity.crossed_threshold.markdown Replaces duplicated UI/YAML option text with shared “crossed threshold” includes (unitless/humidity variant).
source/_triggers/humidity.changed.markdown Replaces duplicated UI/YAML option text with shared “changed” includes (unitless/humidity variant).
source/_conditions/temperature.is_value.markdown Replaces duplicated UI/YAML option text with shared “threshold value” condition includes (temperature variant).
source/_conditions/humidity.is_value.markdown Replaces duplicated UI/YAML option text with shared “threshold value” condition includes (unitless/humidity variant).
source/_includes/triggers/threshold_crossed_steps.md New shared UI step list for “crossed threshold” triggers.
source/_includes/triggers/threshold_crossed_options_ui.md New shared UI options block for “crossed threshold” triggers.
source/_includes/triggers/threshold_crossed_options_yaml.md New shared YAML options block for “crossed threshold” triggers.
source/_includes/triggers/threshold_changed_steps.md New shared UI step list for “changed” triggers.
source/_includes/triggers/threshold_changed_options_ui.md New shared UI options block for “changed” triggers.
source/_includes/triggers/threshold_changed_options_yaml.md New shared YAML options block for “changed” triggers.
source/_includes/conditions/threshold_value_steps.md New shared UI step list for “threshold value” conditions.
source/_includes/conditions/threshold_value_options_ui.md New shared UI options block for “threshold value” conditions.
source/_includes/conditions/threshold_value_options_yaml.md New shared YAML options block for “threshold value” conditions.

Comment thread source/_includes/triggers/threshold_crossed_steps.md
Comment thread source/_includes/triggers/threshold_changed_steps.md
Comment thread source/_includes/conditions/threshold_value_steps.md

@c0ffeeca7 c0ffeeca7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love it! ❤️ Added a question.

Comment thread source/_includes/triggers/threshold_changed_options_yaml.md Outdated
Comment thread source/_includes/triggers/threshold_changed_options_yaml.md Outdated
Comment thread source/_includes/triggers/threshold_changed_steps.md Outdated
Comment thread source/_includes/triggers/threshold_changed_steps.md Outdated
@abmantis

abmantis commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

@c0ffeeca7 I've replaced the temperature-specific stuff with variables so it each trigger can have the proper descriptions and units.

@abmantis
abmantis requested a review from c0ffeeca7 June 3, 2026 14:53

@c0ffeeca7 c0ffeeca7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but best to wait for opinions

@c0ffeeca7 c0ffeeca7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A merge conflict appeared. Could you take a look?

@home-assistant

home-assistant Bot commented Jun 5, 2026

Copy link
Copy Markdown

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.

@home-assistant
home-assistant Bot marked this pull request as draft June 5, 2026 11:00
@abmantis
abmantis requested a review from c0ffeeca7 June 7, 2026 20:59
@abmantis
abmantis marked this pull request as ready for review June 7, 2026 21:00

@c0ffeeca7 c0ffeeca7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is documenting functionality that has already been implemented in past releases. Shouldn't this PR be targeting the current branch?

@home-assistant
home-assistant Bot marked this pull request as draft June 8, 2026 07:30
@c0ffeeca7
c0ffeeca7 force-pushed the threshold_triggers_conditions_reuse branch from 232d169 to e7670fc Compare June 8, 2026 13:36
@c0ffeeca7
c0ffeeca7 changed the base branch from next to current June 8, 2026 13:37
@home-assistant home-assistant Bot added current This PR goes into the current branch and removed needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Jun 8, 2026
@c0ffeeca7
c0ffeeca7 marked this pull request as ready for review June 8, 2026 13:37
@home-assistant
home-assistant Bot requested a review from c0ffeeca7 June 8, 2026 13:37
against the threshold-mapping schema.

Parameters:
reading quantity noun, e.g. "humidity"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
reading quantity noun, e.g. "humidity"
reading Quantity noun. For example: "humidity".

What do you mean by a quantity noun?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

its the noun of the reading. maybe "Reading type" would be better?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as in: domain?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could just remove that variable. The text works without it. One less potential source of copy-paste errors.

Comment thread source/_includes/conditions/threshold_value_options_ui.md Outdated
Comment thread source/_includes/conditions/threshold_value_options_ui.md Outdated
Comment thread source/_includes/conditions/threshold_value_options_ui.md Outdated
Comment thread source/_includes/conditions/threshold_value_options_ui.md Outdated
@abmantis

Copy link
Copy Markdown
Member Author

This is documenting functionality that has already been implemented in past releases. Shouldn't this PR be targeting the current branch?

That depends on whether there are still trigger/condition docs missing in current. If so, then yes.

{% options_ui %}
Threshold type:
description: |
The {{ include.reading }} level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The {{ include.reading }} level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold.
The level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold.

maybe we can just remove this to make the text more generic.

@abmantis
abmantis marked this pull request as ready for review June 17, 2026 14:42
@home-assistant
home-assistant Bot requested a review from c0ffeeca7 June 17, 2026 14:42

@c0ffeeca7 c0ffeeca7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, @abmantis 👍

@c0ffeeca7
c0ffeeca7 merged commit e17511a into current Jun 17, 2026
9 checks passed
@home-assistant home-assistant Bot removed the in-progress This PR/Issue is currently being worked on label Jun 17, 2026
@c0ffeeca7
c0ffeeca7 deleted the threshold_triggers_conditions_reuse branch June 17, 2026 15:14
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

current This PR goes into the current branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants