Music improvements

This commit is contained in:
2022-06-22 00:19:20 +03:00
parent e5f0be4417
commit a061d88fe4
8 changed files with 81 additions and 30 deletions
@@ -76,22 +76,6 @@
entity: input_boolean.simulation_mode
name: Simulation
- type: horizontal-stack
cards:
- type: custom:button-card
template: v3_button
entity: binary_sensor.pi_hole_enabled
name: Pi-Hole
icon: mdi:pi-hole
- type: custom:button-card
template: v3_button
entity: switch.mercury_home_mode
name: Mercury
- type: custom:button-card
template: v3_button
entity: input_boolean.coming_home_play_music
name: Coming home music?
- type: horizontal-stack
cards:
- type: custom:button-card
@@ -112,13 +96,28 @@
service_data:
entity_id: input_select.guest_bedroom_mode
- type: horizontal-stack
cards:
- type: custom:button-card
template: v3_button
entity: binary_sensor.pi_hole_enabled
name: Pi-Hole
icon: mdi:pi-hole
- type: custom:button-card
template: v3_button
entity: switch.mercury_home_mode
name: Mercury
- type: custom:decluttering-card
template: v3_section_title
variables:
- title: Media
- type: entities
entities:
- input_boolean.coming_home_play_music
- input_number.bathroom_high_volume
- input_number.wake_up_volume
- input_text.wake_up_spotify_playlist
- type: vertical-stack
cards:
@@ -1,7 +1,6 @@
input_number:
bathroom_high_volume:
name: Bathroom high volume
mode: box
min: 0
max: 1
step: 0.05
@@ -35,8 +35,8 @@ automation:
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
double_click:
- service: media_player.media_play_pause
entity_id: media_player.master_bedroom
- service: light.toggle
entity_id: light.bedside
hold:
- service: script.toggle_bedroom_mode
+15 -3
View File
@@ -46,7 +46,11 @@ automation:
- service: light.turn_off
entity_id: light.all
- service: media_player.media_stop
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
- alias: Simulation mode · 1100
trigger:
@@ -61,7 +65,11 @@ automation:
at: "14:00:00"
action:
- service: media_player.media_stop
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
- alias: Simulation mode · 1700
trigger:
@@ -78,4 +86,8 @@ automation:
at: "22:00:00"
action:
- service: media_player.media_stop
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
+17 -3
View File
@@ -1,16 +1,30 @@
script:
music_play:
alias: Music · Play
music_prepare:
alias: Music · Prepare
mode: queued
sequence:
- service: script.sonos_join_bedroom
- service: media_player.volume_set
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
data_template:
volume_level: "{{ volume_level | default(0.2) }}"
- service: media_player.shuffle_set
entity_id: media_player.master_bedroom
data_template:
shuffle: "{{ shuffle | default(true) }}"
music_play:
alias: Music · Play
mode: queued
sequence:
- service: script.music_prepare
data_template:
shuffle: "{{ shuffle | default(true) }}"
volume_level: "{{ volume_level | default(0.2) }}"
- service: media_player.select_source
entity_id: media_player.master_bedroom
data_template:
+5 -1
View File
@@ -31,7 +31,11 @@ script:
alias: Routine · Going to sleep
sequence:
- service: media_player.media_stop
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
# Turn off everything else
- service: homeassistant.turn_off
+5 -1
View File
@@ -13,7 +13,11 @@ script:
- fan.philips_airpurifier
- service: media_player.media_stop
entity_id: group.all_sonos
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
- media_player.living_room
- service: light.turn_on
entity_id:
+22 -3
View File
@@ -1,3 +1,16 @@
input_text:
wake_up_spotify_playlist:
name: Waking up Spotify playlist
icon: mdi:spotify
input_number:
wake_up_volume:
name: Waking up volume
min: 0
max: 1
step: 0.05
icon: mdi:volume-high
script:
routine_waking_up:
alias: Routine · Waking up
@@ -29,10 +42,16 @@ script:
# data:
# message: "Here's some music to start the day!"
# - delay: 00:00:02
- service: script.music_play
data:
volume_level: 0.1
- service: script.music_prepare
data_template:
volume_level: "{{ states('input_number.wake_up_volume') | float }}"
shuffle: true
- service: media_player.play_media
target:
entity_id: media_player.master_bedroom
data_template:
media_content_type: "music"
media_content_id: "{{ states('input_text.wake_up_spotify_playlist') }}"
routine_bedroom_morning:
alias: Routine · Bedroom · Morning