Skip to content

Commit 83d6b37

Browse files
Update threshold blueprint
1 parent 12d8b5b commit 83d6b37

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/blueprints/battery_notes_battery_threshold.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ blueprint:
1818
default: True
1919
selector:
2020
boolean:
21+
exclude_devices_enabled:
22+
name: Enable Exclude Devices Filter
23+
description: Do not trigger for specific devices when enabled.
24+
default: true
25+
selector:
26+
boolean:
2127
excluded_devices:
2228
name: Devices to exclude (Optional)
2329
description: Devices that you do not want to trigger this automation.
@@ -66,6 +72,7 @@ blueprint:
6672
variables:
6773
low_notification: !input low_notification
6874
high_notification: !input high_notification
75+
exclude_devices_enabled: !input exclude_devices_enabled
6976
excluded_devices: !input excluded_devices
7077
include_devices_enabled: !input include_devices_enabled
7178
include_devices: !input include_devices
@@ -87,10 +94,10 @@ triggers:
8794
conditions:
8895
- condition: template
8996
value_template: |-
90-
{{ excluded_devices == none or excluded_devices | length == 0 or trigger.event.data.device_id not in excluded_devices }}
97+
{{ not exclude_devices_enabled or (excluded_devices == none or excluded_devices | length == 0 or trigger.event.data.device_id not in excluded_devices) }}
9198
- condition: template
9299
value_template: |-
93-
{{ not include_devices_enabled or trigger.event.data.device_id in include_devices }}
100+
{{ not include_devices_enabled or (include_devices != none and include_devices | length > 0 and trigger.event.data.device_id in include_devices) }}
94101
- alias: User pick
95102
condition: !input additional_conditions
96103

0 commit comments

Comments
 (0)