Initial concept for sleep awareness
This commit is contained in:
@ -2874,3 +2874,75 @@
|
|||||||
alias: TTS notification
|
alias: TTS notification
|
||||||
alias: After wait completed
|
alias: After wait completed
|
||||||
mode: single
|
mode: single
|
||||||
|
- id: '1696884613752'
|
||||||
|
alias: Tony Sleep Handling
|
||||||
|
description: Awareness of when Tony is asleep or wakes up
|
||||||
|
trigger:
|
||||||
|
- platform: event
|
||||||
|
event_type: wakeup_event
|
||||||
|
event_data:
|
||||||
|
who: tony
|
||||||
|
type: alarm
|
||||||
|
context:
|
||||||
|
user_id:
|
||||||
|
- c3909d27048140729f002aaef0391775
|
||||||
|
alias: Any Alarm
|
||||||
|
id: wake-alarm
|
||||||
|
- platform: event
|
||||||
|
event_type: wakeup_event
|
||||||
|
event_data:
|
||||||
|
who: tony
|
||||||
|
type: wakeup
|
||||||
|
context:
|
||||||
|
user_id:
|
||||||
|
- c3909d27048140729f002aaef0391775
|
||||||
|
alias: Wakeup
|
||||||
|
id: wake-sched
|
||||||
|
- platform: zone
|
||||||
|
entity_id: person.tony_stork
|
||||||
|
zone: zone.home
|
||||||
|
event: leave
|
||||||
|
alias: Leave Home
|
||||||
|
id: wake-leave
|
||||||
|
- platform: conversation
|
||||||
|
command: Tony is awake
|
||||||
|
id: wake-sentence
|
||||||
|
alias: Sentence
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- binary_sensor.tony_s_iphone_focus
|
||||||
|
from: 'on'
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: 30
|
||||||
|
alias: Focus off
|
||||||
|
id: wake-focus
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- binary_sensor.tony_desktop_on
|
||||||
|
from: 'off'
|
||||||
|
to: 'on'
|
||||||
|
alias: Computer
|
||||||
|
id: wake-computer
|
||||||
|
condition: []
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
trigger: '{{ trigger.id }}'
|
||||||
|
type: '{{ trigger.split(''-'')[0] }}'
|
||||||
|
reason: '{{ trigger.split(''-'')[1] }}'
|
||||||
|
alias: Define variables
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: '{{ type == ''wake'' }}'
|
||||||
|
alias: Wakeup
|
||||||
|
sequence:
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
data: {}
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.tony_awake
|
||||||
|
alias: Set context that I am awake
|
||||||
|
alias: Routing
|
||||||
|
mode: restart
|
||||||
|
@ -250,6 +250,14 @@ script:
|
|||||||
message: !include ../templates/speech/welcome_home.yaml
|
message: !include ../templates/speech/welcome_home.yaml
|
||||||
mode: restart
|
mode: restart
|
||||||
|
|
||||||
|
master_bedroom_wakeup_briefing:
|
||||||
|
alias: Master Bedroom Wakeup Briefing
|
||||||
|
sequence:
|
||||||
|
- service: script.speech_engine
|
||||||
|
data:
|
||||||
|
who: "{{ who|default('master_bedroom') }}"
|
||||||
|
message: !include ../templates/speech/master_bedroom_wakeup.yaml
|
||||||
|
|
||||||
birthday_announcement:
|
birthday_announcement:
|
||||||
alias: 'Birthday Announcement'
|
alias: 'Birthday Announcement'
|
||||||
sequence:
|
sequence:
|
||||||
|
@ -13,6 +13,9 @@ input_boolean:
|
|||||||
tina_night_meds_taken:
|
tina_night_meds_taken:
|
||||||
name: Tina Night Meds Taken
|
name: Tina Night Meds Taken
|
||||||
icon: mdi:medication
|
icon: mdi:medication
|
||||||
|
tina_awake:
|
||||||
|
name: Tina Awake
|
||||||
|
icon: mdi:eye-check
|
||||||
|
|
||||||
input_datetime:
|
input_datetime:
|
||||||
tina_workday_start:
|
tina_workday_start:
|
||||||
|
@ -16,6 +16,9 @@ input_boolean:
|
|||||||
tony_custom_meds_taken_p1:
|
tony_custom_meds_taken_p1:
|
||||||
name: Tony Custom Meds Taken P1
|
name: Tony Custom Meds Taken P1
|
||||||
icon: mdi:medication
|
icon: mdi:medication
|
||||||
|
tony_awake:
|
||||||
|
name: Tony Awake
|
||||||
|
icon: mdi:eye-check
|
||||||
|
|
||||||
input_datetime:
|
input_datetime:
|
||||||
tony_streaming_start_time:
|
tony_streaming_start_time:
|
||||||
|
51
templates/speech/master_bedroom_wakeup.yaml
Normal file
51
templates/speech/master_bedroom_wakeup.yaml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
>
|
||||||
|
{# Master Bedroom Wakeup #}
|
||||||
|
{%- macro getReport() -%}
|
||||||
|
{% from 'speech.jinja' import greeting, today_is %}
|
||||||
|
{% from 'status.jinja' import tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
|
||||||
|
{% from 'weather.jinja' import weatherReport %}
|
||||||
|
<p>
|
||||||
|
{{ greeting('date') }}
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ today_is() }}
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ weatherReport('alerts','tts','day') }}
|
||||||
|
|
||||||
|
{{ tonyStatusReport('full','tts') }}
|
||||||
|
|
||||||
|
{{ tinaStatusReport('full','tts') }}
|
||||||
|
|
||||||
|
{{ kallenStatusReport('full','tts') }}
|
||||||
|
|
||||||
|
{{ emmaStatusReport('full','tts') }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Do not forget to set the living room thermostat to your desired daytime temperature!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% if is_state('input_boolean.briefing_extras','on') %}
|
||||||
|
"And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} "
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||||
|
{%- macro cleanup(data) -%}
|
||||||
|
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||||
|
{{ item | trim }} {% endfor -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{# a macro to call all macros :) #}
|
||||||
|
{%- macro mother_of_all_macros() -%}
|
||||||
|
{{ getReport() }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{# Call the macro #}
|
||||||
|
{{- cleanup(mother_of_all_macros()) -}}
|
Reference in New Issue
Block a user