mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-17 10:57:03 +00:00
More consolidation for #56
This commit is contained in:
@@ -17,21 +17,25 @@
|
||||
for: '00:02:00'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.responsibilities
|
||||
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: >
|
||||
personarriving: >
|
||||
{% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
|
||||
{%- macro greeting_sentence(person) -%}
|
||||
{{ [
|
||||
"Welcome back home " ~ person,
|
||||
"Guess who is home? " ~ person +" is!",
|
||||
"Attention! " ~ person + " is now in the house.",
|
||||
"Welcome Home " ~ person + ". We've missed you. Or at least Molly did.",
|
||||
person + " is now in the house.",
|
||||
"Welcome Home " ~ person + ". We have missed you. Or at least Molly did.",
|
||||
"Our home is now complete, Rest your head and relax your feet! Welcome Back " ~ person,
|
||||
"Life is like a song, you’re back where you belong. Welcome home " ~ person,
|
||||
"Hey there " ~ person + " Welcome Home!",
|
||||
"Knock Knock. Who is There? " ~ person +" is!",
|
||||
person ~ "! You're home!"
|
||||
person ~ "! You are home!"
|
||||
] | random }}
|
||||
{%- endmacro -%}
|
||||
"{{greeting_sentence(person)}}"
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} has been {{ (trigger.to_state.state)|replace('_', ' ') }}."
|
||||
DoorOpened: "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} has been {{ (trigger.to_state.state)|replace('_', ' ') }}."
|
||||
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
|
@@ -64,11 +64,7 @@ voice_notify:
|
||||
0.20
|
||||
{% endif %}
|
||||
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
payload: '{{ value1 }}'
|
||||
topic: 'polly/lastmsg'
|
||||
retain: true
|
||||
|
||||
|
||||
- service: tts.amazon_polly_say
|
||||
entity_id: media_player.livingroomCC
|
||||
@@ -82,6 +78,8 @@ voice_notify:
|
||||
"Good evening.
|
||||
{% endif %}
|
||||
|
||||
{{ personarriving }}
|
||||
|
||||
{%- macro responsibilities() -%}
|
||||
{%if now().strftime("%a") == 'Wed' or now().strftime("%a") == 'Sun'%}
|
||||
Today is {{now().strftime("%A")}} and {{now().strftime("%A")}} is garbage day.
|
||||
@@ -100,9 +98,16 @@ voice_notify:
|
||||
{{responsibilities()}}
|
||||
{%endif%}
|
||||
|
||||
{{ DoorOpened }}
|
||||
{{ value1 }}"
|
||||
cache: true
|
||||
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
payload: '{{ value1 }}'
|
||||
topic: 'polly/lastmsg'
|
||||
retain: true
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.last_message
|
||||
|
Reference in New Issue
Block a user