Different way to do this. #895
This commit is contained in:
parent
9d4d5cde30
commit
247cd4a774
|
@ -1 +1 @@
|
||||||
0.115.3
|
0.115.6
|
|
@ -243,19 +243,23 @@ automation:
|
||||||
entity_id: climate.downstairs
|
entity_id: climate.downstairs
|
||||||
- service: script.speech_engine
|
- service: script.speech_engine
|
||||||
data:
|
data:
|
||||||
value1: >
|
value1: >-
|
||||||
|
{% set opening = state_attr(trigger.entity_id, "friendly_name")%}
|
||||||
|
{%- macro opening_sentence(opening) -%}
|
||||||
{{ [
|
{{ [
|
||||||
"The {{ trigger.to_state.attributes.friendly_name }} has been opened for about 5 minutes. I will shut down the Air Conditioner so you can enjoy the fresh air.",
|
"The " ~ opening +" has been opened for about 5 minutes. I will shut down the Air Conditioner so you can enjoy the fresh air.",
|
||||||
"Since the {{ trigger.to_state.attributes.friendly_name }} is still open, I will turn off the air conditioners until you close it",
|
"Since the " ~ opening +" is still open, I will turn off the air conditioners until you close it",
|
||||||
"The {{ trigger.to_state.attributes.friendly_name }} has been left open, I will turn off the AC to save some money for you.",
|
"The " ~ opening +" has been left open, I will turn off the AC to save some money for you.",
|
||||||
"We cant have the Air Conditioning running AND have {{ trigger.to_state.attributes.friendly_name }} open so I will turn off the AC.",
|
"We cant have the Air Conditioning running AND have " ~ opening +" open so I will turn off the AC.",
|
||||||
"Since running the AC while {{ trigger.to_state.attributes.friendly_name }} is open, I will turn off the Air Conditioner.",
|
"Since running the AC while " ~ opening +" is open, I will turn off the Air Conditioner.",
|
||||||
"Once the {{ trigger.to_state.attributes.friendly_name }} is closed, I will turn the Air Conditioner back on",
|
"Once the " ~ opening +" is closed, I will turn the Air Conditioner back on",
|
||||||
"So we dont waste money, I will turn off the AC until {{ trigger.to_state.attributes.friendly_name }} has been closed.",
|
"So we dont waste money, I will turn off the AC until " ~ opening +" has been closed.",
|
||||||
"The {{ trigger.to_state.attributes.friendly_name }} is open and we are cooling the outside. I will fix that by turning off the AC for now.",
|
"The " ~ opening +" is open and we are cooling the outside. I will fix that by turning off the AC for now.",
|
||||||
"The fresh Air from the {{ trigger.to_state.attributes.friendly_name }} is great so I will turn off the AC until it is closed again.",
|
"The fresh Air from the " ~ opening +" is great so I will turn off the AC until it is closed again.",
|
||||||
"When Doors and windows are left open like the {{ trigger.to_state.attributes.friendly_name }}, I will remember to turn off the AC."
|
"When Doors and windows are left open like the " ~ opening +", I will remember to turn off the AC."
|
||||||
] | random }}
|
] | random }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{{opening_sentence(opening)}}
|
||||||
call_outside_weather: 1
|
call_outside_weather: 1
|
||||||
call_inside_weather: 1
|
call_inside_weather: 1
|
||||||
#-------------------------------------------#-------------------------------------------
|
#-------------------------------------------#-------------------------------------------
|
||||||
|
|
|
@ -12,7 +12,7 @@ rest_command:
|
||||||
method: POST
|
method: POST
|
||||||
headers:
|
headers:
|
||||||
Authorization: !secret github_token
|
Authorization: !secret github_token
|
||||||
payload: '{"title":"HACS {{ repo }} Update Available","body":"{{ message }}"}'
|
payload: '{"title":"HACS {{ repo }}","body":"{{ message }}"}'
|
||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue