Skip to content

Commit 1f1bbf0

Browse files
committed
update syntax
1 parent 0fd552f commit 1f1bbf0

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

blueprints/automation/awtrix_battery_monitor.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ blueprint:
2222
description: Select the Awtrix light
2323
selector:
2424
device:
25-
integration: mqtt
26-
manufacturer: Blueforcer
27-
model: AWTRIX 3
25+
filter:
26+
integration: mqtt
27+
manufacturer: Blueforcer
28+
model: AWTRIX 3
2829
multiple: true
2930
app_name:
3031
name: Awtrix Applicaiton name
@@ -39,7 +40,8 @@ blueprint:
3940
entity:
4041
multiple: false
4142
filter:
42-
- device_class: battery
43+
- integration: mobile_app
44+
device_class: battery
4345
# multiple: false
4446
message_text:
4547
name: Text to Display
@@ -66,11 +68,23 @@ blueprint:
6668
value: "1"
6769
- label: Icon moves with text but appears again when the text starts to scroll again
6870
value: "2"
71+
show_below:
72+
name: Show Below x percent
73+
description: Only show the application on the clock when the battery level is below the specified percent
74+
75+
selector:
76+
number:
77+
min: 1
78+
max: 101
79+
unit_of_measurement: "percent"
80+
81+
default: 101
6982

7083
mode: restart
7184
variables:
7285
device_ids: !input awtrix
7386
app_name: !input app_name
87+
show_below: !input show_below
7488
devices_topics: >-
7589
{%- macro get_device_topic(device_id) %}
7690
{{- states((device_entities(device_id) | select('search','device_topic') | list)[0]) }}
@@ -99,15 +113,15 @@ variables:
99113
"progress":"{{states[battery_sensor].state}}","pushIcon":1}
100114
101115
trigger:
102-
- platform: time_pattern
116+
- trigger: time_pattern
103117
minutes: /1
104118

105119
condition: []
106120
action:
107121
- repeat:
108122
for_each: "{{ devices_topics }}"
109123
sequence:
110-
- service: mqtt.publish
124+
- action: mqtt.publish
111125
data:
112126
qos: 0
113127
retain: false

0 commit comments

Comments
 (0)