You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

######################################################################
## Good night Routine
######################################################################
- alias: 'Good Night Trigger'
trigger:
- platform: state
entity_id: input_boolean.good_night
to: 'on'
from: 'off'
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state: 'on'
- condition: state
entity_id: device_tracker.carlo
state: 'not_home'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state: 'on'
- condition: state
entity_id: device_tracker.stacey
state: 'not_home'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.good_night
- service: script.speech_engine
data_template:
value1: >
{{ [
"Sleep Tight, Don't let the bedbugs bite.",
"Have pleasant dreams",
"As they say in the Navy, See you in the rise."
"Dream pleasant dreams. Tomorrow is a new day.",
"Early sleep and early wake up gives health and makes you grow.",
"Good night, good night! Parting is such sweet sorrow that I shall say goodnight till it is Morrow.",
"There is a time for many words, and there is also a time for sleep.",
"This good night isnt meant to bring an end to this day. Its intended to wish you awesomeness in what lies ahead.",
"Stuff your worries in your pillow, wrap your troubles in your blanket and spread your anxieties on your sheets. When you wake up tomorrow, you may have dirty linen, but more importantly, youll have a fresh mind and a happy heart. Good night."
] | random }}
- service: script.interior_off

Powered by TurnKey Linux.