Skip to content

Commit 3f7cbfa

Browse files
committed
upgrading scripts to recent syntax changes
1 parent 85d648c commit 3f7cbfa

File tree

4 files changed

+87
-37
lines changed

4 files changed

+87
-37
lines changed

blueprints/automation/awtrix_calendar_countdown.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,21 @@ variables:
4343
{{ ns.devices | reject('match','unavailable') | list}}
4444
4545
trigger:
46-
- platform: time_pattern
46+
- trigger: time_pattern
4747
seconds: /1
4848
id: temporal
4949

5050
action:
51-
- service: calendar.list_events
51+
- action: calendar.get_events
52+
target: "{{ calendar }}"
53+
data:
54+
duration:
55+
hours: 8
56+
minutes: 0
57+
secons: 0
58+
response_variable: v2_events
59+
60+
- action: calendar.list_events
5261
data:
5362
duration:
5463
hours: 8
@@ -231,7 +240,7 @@ action:
231240
232241
{"stack":false, "text":"{{time_remaining}}", "progress":"{{progress}}" }
233242
234-
- service: mqtt.publish
243+
- action: mqtt.publish
235244
data:
236245
qos: 0
237246
topic: awtrix_1/notify

blueprints/automation/awtrix_door_status.yaml

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ blueprint:
2424
description: Select the Awtrix light
2525
selector:
2626
device:
27-
integration: mqtt
28-
manufacturer: Blueforcer
29-
model: AWTRIX 3
27+
filter:
28+
integration: mqtt
29+
manufacturer: Blueforcer
30+
model: AWTRIX 3
3031
multiple: true
3132
app_name:
3233
name: Awtrix Applicaiton name
@@ -39,10 +40,11 @@ blueprint:
3940
description: Binary sensor to track door status
4041
selector:
4142
entity:
42-
domain:
43-
- binary_sensor
44-
- input_boolean
45-
- cover
43+
filter:
44+
domain:
45+
- binary_sensor
46+
- input_boolean
47+
- cover
4648
open_text:
4749
name: 📝 Device Opened Message
4850
description: Text to be displayed when an open event occurs
@@ -176,6 +178,18 @@ blueprint:
176178
`garage_open.gif`,`garage_is_open.gif` `garage_close.gif` `garage_error.gif`
177179
178180
181+
### Blinds
182+
183+
(Images are blurry because they are resized)
184+
185+
<img src="https://raw.githubusercontent.com/jeeftor/HomeAssistant/master/icons/door_monitor_blinds/blinds_open.gif" width="16">
186+
<img src="https://raw.githubusercontent.com/jeeftor/HomeAssistant/master/icons/door_monitor_blinds/blinds_is_open.gif" width="16">
187+
<img src="https://raw.githubusercontent.com/jeeftor/HomeAssistant/master/icons/door_monitor_blinds/blinds_close.gif" width="16">
188+
<img src="https://raw.githubusercontent.com/jeeftor/HomeAssistant/master/icons/door_monitor_blinds/blinds_error.gif" width="16">
189+
190+
`blinds_open.gif`,`blinds_is_open.gif` `blinds_close.gif` `blinds_error.gif`
191+
192+
179193
# CUSTOM ICONS BELOW
180194
181195
The icon settings below only will take effect if you've selected custom
@@ -192,6 +206,8 @@ blueprint:
192206
value: garage
193207
- label: Window
194208
value: window
209+
- label: Blinds
210+
value: blinds
195211
- label: Use Custom icons
196212
value: custom
197213

@@ -352,17 +368,17 @@ trigger_variables:
352368
trigger_sensor: !input trigger_sensor
353369

354370
trigger:
355-
- platform: time_pattern
371+
- trigger: time_pattern
356372
minutes: /1
357373
id: time
358-
- platform: template
374+
- trigger: template
359375
id: opened
360376
value_template: "{{ states(trigger_sensor) in ['on', 'open'] }}"
361-
- platform: template
377+
- trigger: template
362378
value_template: "{{ states(trigger_sensor) in ['closed','off'] }}"
363379
id: closed
364-
- platform: template
365-
value_template: "{{ states(trigger_sensor) not in ['off','on', 'open','closed'] }}"
380+
- trigger: template
381+
value_template: "{{ states(trigger_sensor) not in ['off','on', 'open','closed', 'closing', 'opening'] }}"
366382
id: error
367383

368384
condition: []
@@ -382,12 +398,29 @@ action:
382398
- repeat:
383399
for_each: "{{ message_topics }}"
384400
sequence:
385-
- service: mqtt.publish
401+
- action: mqtt.publish
386402
data:
387403
qos: 0
388404
retain: false
389405
topic: "{{ repeat.item }}"
390406
payload: "{{is_open_payload}}"
407+
# Fix an issue with a lingering close state after reboot
408+
- conditions:
409+
- and:
410+
- condition: trigger
411+
id: time
412+
- condition: template
413+
value_template: "{{ states(trigger_sensor) in ['off', 'closed'] }}"
414+
sequence:
415+
- repeat:
416+
for_each: "{{ message_topics }}"
417+
sequence:
418+
- action: mqtt.publish
419+
data:
420+
qos: 0
421+
retain: false
422+
topic: "{{ repeat.item }}"
423+
payload: "{}"
391424

392425
# Door open logic (Notification + message)
393426
- conditions:
@@ -397,7 +430,7 @@ action:
397430
- repeat:
398431
for_each: "{{ notification_topics }}"
399432
sequence:
400-
- service: mqtt.publish
433+
- action: mqtt.publish
401434
data:
402435
qos: 0
403436
retain: false
@@ -412,7 +445,7 @@ action:
412445
- repeat:
413446
for_each: "{{ notification_topics }}"
414447
sequence:
415-
- service: mqtt.publish
448+
- action: mqtt.publish
416449
data:
417450
qos: 0
418451
retain: false
@@ -422,7 +455,7 @@ action:
422455
- repeat:
423456
for_each: "{{ message_topics }}"
424457
sequence:
425-
- service: mqtt.publish
458+
- action: mqtt.publish
426459
data:
427460
qos: 0
428461
retain: false
@@ -437,7 +470,7 @@ action:
437470
- repeat:
438471
for_each: "{{ notification_topics }}"
439472
sequence:
440-
- service: mqtt.publish
473+
- action: mqtt.publish
441474
data:
442475
qos: 0
443476
retain: false
@@ -447,7 +480,7 @@ action:
447480
- repeat:
448481
for_each: "{{ message_topics }}"
449482
sequence:
450-
- service: mqtt.publish
483+
- action: mqtt.publish
451484
data:
452485
qos: 0
453486
retain: false

blueprints/automation/awtrix_hvac.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ blueprint:
2323
description: Select the Awtrix light
2424
selector:
2525
device:
26-
integration: mqtt
27-
manufacturer: Blueforcer
28-
model: AWTRIX 3
26+
filter:
27+
integration: mqtt
28+
manufacturer: Blueforcer
29+
model: AWTRIX 3
2930
multiple: true
3031
hvac:
3132
name: Climate Device / HVAC
3233
description: HVAC Device (Ecobee, Nest etc)
3334
selector:
3435
entity:
35-
domain: climate
36+
filter:
37+
domain: climate
3638
heat_icon:
3739
name: Heating icon name
3840
selector:
@@ -74,36 +76,40 @@ variables:
7476
temp_current_floor: "{{ temp_current | round(0,'floor') }}"
7577

7678
is_running: "{{ not state_attr('climate.downstairs', 'temperature') is none }}"
79+
is_ac_on: "{{ mode == 'cool' and (target_temp < temp_current) }}"
80+
is_heat_on: "{{ mode == 'heat' and (target_temp > temp_current) }}"
7781

7882
payload: >-
7983
{%- if not is_running %}
8084
{}
81-
{%- elif mode == 'heat' %}
85+
{%- elif mode == 'heat' and is_heat_on%}
8286
{ "icon": "heat",
8387
"text": [
8488
{"t":"{{temp_current_floor}}", "c":"#ffffff"},
8589
{"t":">","c":"#9c9d97"},
8690
{"t":"{{target_temp}}", "c":"#ffffff"}
8791
] }
88-
{% elif mode == 'cool' %}
92+
{% elif mode == 'cool' and is_ac_on %}
8993
{ "icon": "cool",
9094
"text": [
9195
{"t":"{{temp_current_ceil}}", "c":"#ffffff"},
9296
{"t":">","c":"#9c9d97"},
9397
{"t":"{{target_temp}}", "c":"#ffffff"}
9498
] }
99+
{% else %}
100+
{}
95101
{% endif %}
96102
97103
trigger:
98-
- platform: time_pattern
104+
- trigger: time_pattern
99105
seconds: /5
100106

101107
condition: []
102108
action:
103109
- repeat:
104110
for_each: "{{ devices_topics }}"
105111
sequence:
106-
- service: mqtt.publish
112+
- action: mqtt.publish
107113
data:
108114
qos: 0
109115
retain: false

blueprints/automation/awtrix_uv_hum.yaml

Lines changed: 10 additions & 8 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
hum:
3031
name: Humidity Sensor
@@ -69,8 +70,9 @@ blueprint:
6970
- NOTE: [Openweather](https://www.home-assistant.io/integrations/openweathermap/) DOES NOT HAVE AN HOURLY UV FORECAST
7071
selector:
7172
entity:
72-
domain:
73-
- weather
73+
filter:
74+
domain:
75+
- weather
7476
multiple: false
7577

7678
mode: restart
@@ -99,12 +101,12 @@ variables:
99101
show_forecast: !input show_forecast
100102

101103
trigger:
102-
- platform: time_pattern
104+
- trigger: time_pattern
103105
minutes: "/5"
104106

105107
condition: []
106108
action:
107-
- service: weather.get_forecasts
109+
- action: weather.get_forecasts
108110
target:
109111
entity_id: "{{forecast_var}}"
110112
data:
@@ -114,7 +116,7 @@ action:
114116
- repeat:
115117
for_each: "{{ devices_topics }}"
116118
sequence:
117-
- service: mqtt.publish
119+
- action: mqtt.publish
118120
data:
119121
qos: 0
120122
retain: false

0 commit comments

Comments
 (0)