Skip to content

Commit 50d94bb

Browse files
authored
Add bedtime script (#50)
1 parent c363b23 commit 50d94bb

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Runs on a [Raspberry Pi 3B](https://www.raspberrypi.org/products/raspberry-pi-3-
6969

7070
Christmas lights automations aren't available year-round (they're added when the tree goes up, removed again when the tree goes down). See previous years in [#40](https://github.com/tetsuo13/home-assistant-config/pull/40), [#15](https://github.com/tetsuo13/home-assistant-config/pull/15) and [c013a7c](https://github.com/tetsuo13/home-assistant-config/commit/c013a7c10aa19f6366598c1a0cd125f82ec8b465) on what was done.
7171

72+
The [`bedtime.yaml`](scripts/bedtime.yaml) handles turning off services and devices that may have been forgotten on. There's an associated automation to trigger the script late at night.
73+
7274
## [Door Automations](automation/doors.yaml)
7375

7476
Opening and closing doors causes an announcement to be made through all of the Sonos speakers. A chime is played first to grab attention followed by a TTS announcement. See the [`sonos_say`](scripts/sonos_say.yaml) script on how this is done.

automation/bedtime.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
3+
- alias: Bedtime routine
4+
id: bedtime_routine
5+
description: Trigger bedtime routine at 10:30pm.
6+
trigger:
7+
platform: time
8+
at: "22:30:00"
9+
action:
10+
service: script.bedtime
11+

scripts/bedtime.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
3+
icon: mdi:bed-clock
4+
5+
description: >-
6+
Various sequences to run after everyone's gone to bed. Intended to turn off
7+
devices that may have been forgotten on and enable services that were
8+
unintentionally left disabled.
9+
10+
sequence:
11+
- alias: Enable camera notifications
12+
service: automation.turn_on
13+
entity_id: automation.motion_send_camera_snapshot_notification_on_motion
14+
15+
- alias: Enable front door camera notifications
16+
service: switch.turn_on
17+
entity_id: switch.front_door_smart_motion_detection
18+
19+
# Don't call the automation for this as it toggles the lights -- if they're
20+
# already off we don't want to toggle them on.
21+
# Turn off the "main" switch, automation will handle turning off the other.
22+
- alias: Turn off living room bookshelf lamps
23+
service: switch.turn_off
24+
target:
25+
entity_id: switch.tp_link_smart_plug_d6d2
26+
27+
- alias: Turn off living room fan
28+
service: fan.turn_off
29+
target:
30+
entity_id: fan.jasco_products_unknown_type_4944_id_3337_level
31+
32+
- alias: Turn off Sonos speakers
33+
service: media_player.media_stop
34+
target:
35+
entity_id: group.sonos_all
36+

0 commit comments

Comments
 (0)