Skip to content

Instantly share code, notes, and snippets.

@jordanlambrecht
Created February 20, 2021 03:32
Show Gist options
  • Save jordanlambrecht/d32f0fe441ee2963f30f50431199b44b to your computer and use it in GitHub Desktop.
Save jordanlambrecht/d32f0fe441ee2963f30f50431199b44b to your computer and use it in GitHub Desktop.
Home Assistant - Google Home - N Bathroom - Ambient Sounds To Poop To
alias: Google Home - N Bathroom - Ambient Sounds To Poop To
description: 'After the N bathroom light has been on for 20s, Check to make sure GH is not in use, then set the volume to 0 and select an ambient track based on time of day, and cast it to the google home for 10 minutes.'
trigger:
- platform: device
type: turned_on
device_id: 43159d577b25076ba654bfbe4f07b252
entity_id: switch.north_bathroom_light
domain: switch
for:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
condition:
- condition: not
conditions:
- condition: device
device_id: cf9667e2e205065d2011aa9e0e293368
domain: media_player
entity_id: media_player.bathroom_speaker
type: is_playing
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_select.time_of_day
state: Early Morning
- condition: state
entity_id: input_select.time_of_day
state: Late Night
sequence:
- service: media_player.volume_set
data:
volume_level: 0.33
entity_id: media_player.bathroom_speaker
- service: media_player.play_media
data:
media_content_type: music
media_content_id: >-
https://www.gstatic.com/voice_delight/sounds/long/country_night.mp3
entity_id: media_player.bathroom_speaker
- conditions:
- condition: state
entity_id: input_select.time_of_day
state: Morning
sequence:
- service: media_player.volume_set
data:
volume_level: 0.55
entity_id: media_player.bathroom_speaker
- service: media_player.play_media
data:
media_content_type: music
media_content_id: 'https://www.gstatic.com/voice_delight/sounds/long/forest.mp3'
entity_id: media_player.bathroom_speaker
- conditions:
- condition: state
entity_id: input_select.time_of_day
state: Afternoon
sequence:
- service: media_player.volume_set
data:
volume_level: 0.66
entity_id: media_player.bathroom_speaker
- service: media_player.play_media
data:
media_content_type: music
media_content_id: 'https://www.gstatic.com/voice_delight/sounds/long/thunder.mp3'
entity_id: media_player.bathroom_speaker
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_select.time_of_day
state: Evening
- condition: state
entity_id: input_select.time_of_day
state: Night
sequence:
- service: media_player.volume_set
data:
volume_level: 0.55
entity_id: media_player.bathroom_speaker
- service: media_player.play_media
data:
media_content_type: music
media_content_id: 'https://www.gstatic.com/voice_delight/sounds/long/brook.mp3'
entity_id: media_player.bathroom_speaker
default: []
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- service: media_player.media_stop
data: {}
entity_id: media_player.bathroom_speaker
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment