Update more speech logic to use OpenAI. #1368

This commit is contained in:
CCOSTAN
2024-05-25 00:23:12 +00:00
parent 1ce3d22013
commit 12104c2e83
12 changed files with 29 additions and 232 deletions

View File

@@ -261,18 +261,8 @@ automation:
value1: >-
{% set opening = state_attr(trigger.entity_id, "friendly_name")%}
{%- macro opening_sentence(opening) -%}
{{ [
"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 " ~ opening +" is still open, I will turn off the air conditioners until you close it",
"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 " ~ opening +" open so I will turn off the AC.",
"Since running the AC while " ~ opening +" is open, I will turn off the Air Conditioner.",
"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 " ~ opening +" has been closed.",
"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 " ~ opening +" is great so I will turn off the AC until it is closed again.",
"When Doors and windows are left open like the " ~ opening +", I will remember to turn off the AC."
] | random }}
{{"Since the " ~ opening +" has been left open, I will turn off the air conditioners until you close it" }}
[Give a snarky reason for this action]
{%- endmacro -%}
{{opening_sentence(opening)}}
call_outside_weather: 1
@@ -294,10 +284,9 @@ automation:
value_template: "{{ states('climate.downstairs') == 'off' }}"
action:
- service: climate.set_hvac_mode
- service: climate.turn_on
data:
entity_id: climate.downstairs
hvac_mode: 'auto'
#-------------------------------------------#-------------------------------------------
- alias: 'Alarm lights in Living room'