Migrate time automations and scripts #154
This commit is contained in:
@ -2201,3 +2201,25 @@
|
||||
data:
|
||||
value: '{{ states(''sensor.todays_high_temp'') | int }}'
|
||||
mode: single
|
||||
- id: '1696293127764'
|
||||
alias: Timer Handling
|
||||
description: This automation will handle when house timers (usually set by voice)
|
||||
are finished
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.kitchen_timer
|
||||
id: kitchen-finished
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- conditions: '{{ trigger.id == ''kitchen-finished'' }}'
|
||||
sequence:
|
||||
- service: script.speech_engine
|
||||
data:
|
||||
type: normal
|
||||
who: common
|
||||
message: The timer for the kitchen is finished
|
||||
mode: queued
|
||||
max: 10
|
||||
|
@ -53,48 +53,4 @@ intent_script:
|
||||
target:
|
||||
entity_id: "{{ room }}"
|
||||
speech:
|
||||
text: "Okay"
|
||||
|
||||
automation:
|
||||
- id: 849b72f0-89e9-421b-9e75-01a6d977488d
|
||||
alias: Timer Handling
|
||||
description: This automation will handle when house timers (usually set by voice) are finished
|
||||
mode: queued
|
||||
max: 10
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.kitchen_timer
|
||||
id: kitchen-finished
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ trigger.id == 'kitchen-finished' }}"
|
||||
sequence:
|
||||
- service: script.speech_engine
|
||||
data:
|
||||
type: normal
|
||||
who: common
|
||||
message: "The timer for the kitchen is finished"
|
||||
|
||||
script:
|
||||
timer_modify:
|
||||
alias: Timer Modify
|
||||
description: For adding/subtracting time from a running timer
|
||||
mode: restart
|
||||
sequence:
|
||||
- service: timer.pause
|
||||
target:
|
||||
entity_id: "{{ timer }}"
|
||||
- delay:
|
||||
seconds: 1
|
||||
- variables:
|
||||
modify: >
|
||||
{% set x = state_attr(timer, 'remaining') ~ '-0000' %}
|
||||
{% set y = strptime(x, '%H:%M:%S%z') %}
|
||||
{{ (as_timestamp(y) + change) | timestamp_custom('%H:%M:%S', false) }}
|
||||
- service: timer.start
|
||||
target:
|
||||
entity_id: "{{ timer }}"
|
||||
data:
|
||||
duration: "{{ modify }}"
|
||||
text: "Okay"
|
21
scripts.yaml
21
scripts.yaml
@ -1778,3 +1778,24 @@ bright_mode_in_tina_desk:
|
||||
brightness: 255
|
||||
mode: restart
|
||||
icon: mdi:palette
|
||||
timer_modify:
|
||||
alias: Timer Modify
|
||||
description: For adding/subtracting time from a running timer
|
||||
mode: restart
|
||||
sequence:
|
||||
- service: timer.pause
|
||||
target:
|
||||
entity_id: '{{ timer }}'
|
||||
- delay:
|
||||
seconds: 1
|
||||
- variables:
|
||||
modify: '{% set x = state_attr(timer, ''remaining'') ~ ''-0000'' %} {% set y
|
||||
= strptime(x, ''%H:%M:%S%z'') %} {{ (as_timestamp(y) + change) | timestamp_custom(''%H:%M:%S'',
|
||||
false) }}
|
||||
|
||||
'
|
||||
- service: timer.start
|
||||
target:
|
||||
entity_id: '{{ timer }}'
|
||||
data:
|
||||
duration: '{{ modify }}'
|
||||
|
Reference in New Issue
Block a user