You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_includes/conditions/threshold_value_options_ui.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,22 @@ Reusable "Options in the UI" block for entity conditions that test a reading
3
3
against the threshold-mapping schema.
4
4
5
5
Parameters:
6
-
reading quantity noun, e.g. "humidity"
7
-
value_short Number-entry phrasing, e.g. "a fixed percentage (0–100)"
8
-
has_unit set (to anything) to add a "Unit" row for the temperature unit
6
+
reading quantity noun, e.g. "humidity"
7
+
value_short Number-entry phrasing, e.g. "a fixed percentage (0–100)"
8
+
has_unit set (to anything) to add a "Unit" row (requires unit_label,
9
+
unit_options_code, unit_default)
10
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
11
+
unit_options_code inline-code list of allowed units, e.g. "`°C` or `°F`"
12
+
unit_default default unit, e.g. "°C"
9
13
{% endcomment %}
10
14
{% options_ui %}
11
15
Threshold type:
12
16
description: |
13
17
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.
14
18
{% if include.has_unit %}
15
19
Unit:
16
-
description: The temperature unit to use for threshold comparison. Accepts `°C` or `°F`. Required when using numerical thresholds (not required when using entity references).
17
-
default: °C
20
+
description: The {{ include.unit_label }} to use for threshold comparison. Accepts {{ include.unit_options_code }}. Required when using numerical thresholds (not required when using entity references).
unit_default default unit used in the example, e.g. "°C"
15
+
unit_example_entity entity reference used in the example, e.g.
16
+
"input_number.comfort_temperature_min"
17
+
unit_example_value literal number used in the example, e.g. "22"
13
18
threshold_required "true" or "false" for the threshold field (default "false")
14
19
{% endcomment %}
15
20
{% options_yaml %}
@@ -29,13 +34,13 @@ threshold:
29
34
threshold:
30
35
type: between
31
36
value_min:
32
-
entity: input_number.comfort_temperature_min
37
+
entity: {{ include.unit_example_entity }}
33
38
value_max:
34
-
number: 22
35
-
unit_of_measurement: °C
39
+
number: {{ include.unit_example_value }}
40
+
unit_of_measurement: {{ include.unit_default }}
36
41
```
37
42
38
-
When using an `entity`, its current reading is used as the threshold at the moment the condition is evaluated, which lets you compare two temperature readings dynamically.
43
+
When using an `entity`, its current reading is used as the threshold at the moment the condition is evaluated, which lets you compare two {{ include.reading }} readings dynamically.
39
44
{% else %}
40
45
41
46
For the `number` key, use {{ include.number_final }}. For the `entity` key, use an `input_number`, `number`, or `sensor` entity.
Copy file name to clipboardExpand all lines: source/_includes/conditions/threshold_value_steps.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,14 @@ range). Used by humidity.is_value; reusable by climate.target_humidity,
5
5
light.is_brightness, counter.is_value, and similar.
6
6
7
7
Parameters:
8
-
title UI display name, e.g. "Relative humidity"
9
-
sensor sensor noun, e.g. "humidity sensor"
10
-
areas example areas, e.g. "bedroom or bathroom"
11
-
reading quantity noun, e.g. "humidity"
12
-
value_long Number-entry phrasing, e.g. "a fixed percentage directly, for example `65` for 65%"
13
-
has_unit set (to anything) to add a "Unit" step for the temperature unit
8
+
title UI display name, e.g. "Relative humidity"
9
+
sensor sensor noun, e.g. "humidity sensor"
10
+
areas example areas, e.g. "bedroom or bathroom"
11
+
reading quantity noun, e.g. "humidity"
12
+
value_long Number-entry phrasing, e.g. "a fixed percentage directly, for example `65` for 65%"
13
+
has_unit set (to anything) to add a "Unit" step (requires unit_label, unit_options)
14
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
15
+
unit_options bare list of allowed units for prose, e.g. "°C or °F"
14
16
{% endcomment %}
15
17
To use **{{ include.title }}** in an automation:
16
18
@@ -29,7 +31,7 @@ To use **{{ include.title }}** in an automation:
29
31
- For **In range** or **Outside range**, you need two entities: one for the lower bound and one for the upper bound (for example, two separate number helpers).
30
32
- If you don't have a number helper, you can create one by selecting **Create a new number helper**.
31
33
{%- if include.has_unit %}
32
-
7. Under **Unit**, select the temperature unit (°C or °F) to use for the threshold comparison.
34
+
7. Under **Unit**, select the {{ include.unit_label }} ({{ include.unit_options }}) to use for the threshold comparison.
33
35
{%- endif %}
34
36
8. Under **Condition passes if** (see [Behavior](#behavior-with-multiple-targets)), pick **Any** or **All**.
Copy file name to clipboardExpand all lines: source/_includes/triggers/threshold_changed_options_ui.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,12 @@ Reusable "Options in the UI" block for "changed" entity triggers that use the
3
3
threshold-mapping schema.
4
4
5
5
Parameters:
6
-
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
7
-
has_unit set (to anything) to add a "Unit" row for the temperature unit
6
+
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
7
+
has_unit set (to anything) to add a "Unit" row (requires unit_label,
8
+
unit_options_code, unit_default)
9
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
10
+
unit_options_code inline-code list of allowed units, e.g. "`°C` or `°F`"
11
+
unit_default default unit, e.g. "°C"
8
12
{% endcomment %}
9
13
{% options_ui %}
10
14
Threshold type:
@@ -19,6 +23,6 @@ Threshold type:
19
23
For each mode you can enter {{ include.unit_phrase_ui }} or reference a sensor entity or a [number helper](/integrations/input_number/) entity.
20
24
{% if include.has_unit %}
21
25
Unit:
22
-
description: The temperature unit to use for threshold comparison. Accepts `°C` or `°F`. Required when using numerical thresholds (not required when using entity references). Default is `°C`.
26
+
description: The {{ include.unit_label }} to use for threshold comparison. Accepts {{ include.unit_options_code }}. Required when using numerical thresholds (not required when using entity references). Default is `{{ include.unit_default }}`.
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
12
+
unit_options_code inline-code list of allowed units, e.g. "`°C` or `°F`"
13
+
unit_default default unit used in the example, e.g. "°C"
14
+
unit_example_entity entity reference used in the example, e.g.
15
+
"input_number.comfort_temperature_min"
16
+
unit_example_value literal number used in the example, e.g. "24"
9
17
{% endcomment %}
10
18
{% options_yaml %}
11
19
threshold:
@@ -19,21 +27,21 @@ threshold:
19
27
- `type: outside` (inclusive): Defines an outside-range. Fires when the reading is at or below `value_min`, or at or above `value_max`. Readings equal to either bound fire the trigger. Provide `value_min` and `value_max`, each with a `number` key (for a {{ include.unit_phrase_yaml }}) or an `entity` key (for an `input_number`, `number`, or `sensor` entity).
20
28
{% if include.has_unit %}
21
29
22
-
When using the `number` key, you must also include `unit_of_measurement` to specify the temperature unit (`°C` or `°F`). When using the `entity` key, the unit is taken from the entity itself, or assumed to be the system temperature unit if the entity has no unit.
30
+
When using the `number` key, you must also include `unit_of_measurement` to specify the {{ include.unit_label }} ({{ include.unit_options_code }}). When using the `entity` key, the unit is taken from the entity itself, or assumed to be the system {{ include.unit_label }} if the entity has no unit.
23
31
24
32
For example:
25
33
26
34
```yaml
27
35
threshold:
28
36
type: outside
29
37
value_min:
30
-
entity: input_number.comfort_temperature_min
38
+
entity: {{ include.unit_example_entity }}
31
39
value_max:
32
-
number: 24
33
-
unit_of_measurement: °C
40
+
number: {{ include.unit_example_value }}
41
+
unit_of_measurement: {{ include.unit_default }}
34
42
```
35
43
36
-
A `sensor` or `number` entity's current value is used as the threshold, which lets you compare two temperature readings dynamically.
44
+
A `sensor` or `number` entity's current value is used as the threshold, which lets you compare two {{ include.reading }} readings dynamically.
Copy file name to clipboardExpand all lines: source/_includes/triggers/threshold_changed_steps.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ Parameters:
9
9
sensor sensor noun, e.g. "humidity sensor"
10
10
areas example areas, e.g. "bathroom or bedroom"
11
11
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
12
-
has_unit set (to anything) to add a "Unit" step for the temperature unit
12
+
has_unit set (to anything) to add a "Unit" step (requires unit_label, unit_options)
13
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
14
+
unit_options bare list of allowed units for prose, e.g. "°C or °F"
13
15
{% endcomment %}
14
16
To use **{{ include.title }}** in an automation:
15
17
@@ -26,6 +28,6 @@ To use **{{ include.title }}** in an automation:
26
28
- For each option, you can enter {{ include.unit_phrase_ui }}, pick a sensor entity or a [number helper](/integrations/input_number/) entity as the threshold.
27
29
- If you don't have a number helper, you can create one by selecting **Create a new number helper**.
28
30
{%- if include.has_unit %}
29
-
7. Under **Unit**, select the temperature unit (°C or °F) to use for the threshold comparison.
31
+
7. Under **Unit**, select the {{ include.unit_label }} ({{ include.unit_options }}) to use for the threshold comparison.
Copy file name to clipboardExpand all lines: source/_includes/triggers/threshold_crossed_options_ui.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,12 @@ Reusable "Options in the UI" block for "crossed threshold" entity triggers that
3
3
use the threshold-mapping schema.
4
4
5
5
Parameters:
6
-
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
7
-
has_unit set (to anything) to add a "Unit" row for the temperature unit
6
+
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
7
+
has_unit set (to anything) to add a "Unit" row (requires unit_label,
8
+
unit_options_code, unit_default)
9
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
10
+
unit_options_code inline-code list of allowed units, e.g. "`°C` or `°F`"
11
+
unit_default default unit, e.g. "°C"
8
12
{% endcomment %}
9
13
{% options_ui %}
10
14
Threshold type:
@@ -19,7 +23,7 @@ Threshold type:
19
23
For each mode you can enter {{ include.unit_phrase_ui }} or reference a sensor entity or a [number helper](/integrations/input_number/) entity.
20
24
{% if include.has_unit %}
21
25
Unit:
22
-
description: The temperature unit to use for threshold comparison. Accepts `°C` or `°F`. Required when using numerical thresholds (not required when using entity references). Default is `°C`.
26
+
description: The {{ include.unit_label }} to use for threshold comparison. Accepts {{ include.unit_options_code }}. Required when using numerical thresholds (not required when using entity references). Default is `{{ include.unit_default }}`.
Copy file name to clipboardExpand all lines: source/_includes/triggers/threshold_crossed_options_yaml.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,22 @@
2
2
Reusable "Options in YAML" block for "crossed threshold" entity triggers that
3
3
use the threshold-mapping schema. The `behavior` and `for` field descriptions
4
4
are identical across the whole family. Suited to unitless members (humidity,
5
-
brightness, battery); members with a temperature unit need an added
6
-
unit_of_measurement note in the threshold description.
5
+
brightness, battery); members with a unit (temperature, energy, etc.) get an
6
+
added unit_of_measurement note in the threshold description.
7
7
8
8
Parameters:
9
-
unit_phrase_yaml literal-value phrasing, e.g. "literal percentage 0–100"
10
-
example_value value used in the inline example (unitless members), e.g. "70"
11
-
has_unit set (to anything) for the temperature unit note + a unit-style example
9
+
reading quantity noun, e.g. "humidity", "temperature"
10
+
unit_phrase_yaml literal-value phrasing, e.g. "literal percentage 0–100"
11
+
example_value value used in the inline example (unitless members), e.g. "70"
12
+
has_unit set (to anything) for unit_of_measurement note + a unit-style
13
+
example (requires unit_label, unit_options_code, unit_default,
14
+
unit_example_entity, unit_example_value)
15
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
16
+
unit_options_code inline-code list of allowed units, e.g. "`°C` or `°F`"
17
+
unit_default default unit used in the example, e.g. "°C"
18
+
unit_example_entity entity reference used in the example, e.g.
19
+
"input_number.max_comfort_temperature"
20
+
unit_example_value literal number used in the example, e.g. "18"
12
21
{% endcomment %}
13
22
{% options_yaml %}
14
23
threshold:
@@ -22,21 +31,21 @@ threshold:
22
31
23
32
{% if include.has_unit %}
24
33
25
-
When using the `number` key, you must also include `unit_of_measurement` to specify the temperature unit (`°C` or `°F`). When using the `entity` key, the unit is taken from the entity itself, or assumed to be the system temperature unit if the entity has no unit.
34
+
When using the `number` key, you must also include `unit_of_measurement` to specify the {{ include.unit_label }} ({{ include.unit_options_code }}). When using the `entity` key, the unit is taken from the entity itself, or assumed to be the system {{ include.unit_label }} if the entity has no unit.
26
35
27
36
For example:
28
37
29
38
```yaml
30
39
threshold:
31
40
type: between
32
41
value_min:
33
-
number: 18
34
-
unit_of_measurement: °C
42
+
number: {{ include.unit_example_value }}
43
+
unit_of_measurement: {{ include.unit_default }}
35
44
value_max:
36
-
entity: input_number.max_comfort_temperature
45
+
entity: {{ include.unit_example_entity }}
37
46
```
38
47
39
-
A `sensor` or `number` entity's current value is used as the threshold, which lets you compare two temperature readings dynamically.
48
+
A `sensor` or `number` entity's current value is used as the threshold, which lets you compare two {{ include.reading }} readings dynamically.
Copy file name to clipboardExpand all lines: source/_includes/triggers/threshold_crossed_steps.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ Parameters:
9
9
sensor sensor noun, e.g. "humidity sensor"
10
10
areas example areas, e.g. "bathroom or basement"
11
11
unit_phrase_ui value-entry phrasing, e.g. "a fixed percentage (0–100%)"
12
-
has_unit set (to anything) to add a "Unit" step for the temperature unit
12
+
has_unit set (to anything) to add a "Unit" step (requires unit_label, unit_options)
13
+
unit_label unit-kind label, e.g. "temperature unit", "energy unit"
14
+
unit_options bare list of allowed units for prose, e.g. "°C or °F"
13
15
{% endcomment %}
14
16
To use **{{ include.title }}** in an automation:
15
17
@@ -25,7 +27,7 @@ To use **{{ include.title }}** in an automation:
25
27
- For each option, you can enter {{ include.unit_phrase_ui }}, pick a sensor entity or a [number helper](/integrations/input_number/) entity as the threshold.
26
28
- If you don't have a number helper, you can create one by selecting **Create a new number helper**.
27
29
{%- if include.has_unit %}
28
-
7. Under **Unit**, select the temperature unit (°C or °F) to use for the threshold comparison.
30
+
7. Under **Unit**, select the {{ include.unit_label }} ({{ include.unit_options }}) to use for the threshold comparison.
29
31
{%- endif %}
30
32
8. Under **Trigger when** (see [Behavior](#behavior-with-multiple-targets)), pick **Each**, **First**, or **All** to control how the trigger behaves when multiple entities are targeted.
31
33
9. Under **For at least**, set how long the reading must stay past the threshold before the trigger fires. Leave it at zero to fire immediately.
0 commit comments