diff --git a/config/configuration.yaml b/config/configuration.yaml index feb980f..fb4197a 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -124,6 +124,7 @@ logbook: - light - input_boolean - climate + - media_player entities: - media_player.living_room_tv - media_player.nvidia_shield diff --git a/config/lovelace/advanced_dashboard/08_automations.yaml b/config/lovelace/advanced_dashboard/08_automations.yaml index 474dad1..0387635 100644 --- a/config/lovelace/advanced_dashboard/08_automations.yaml +++ b/config/lovelace/advanced_dashboard/08_automations.yaml @@ -204,10 +204,10 @@ cards: show_header_toggle: true icon: mdi:light-switch entities: - - automation.lighting_master_bedroom_opple_turn_off_lights_on_1_click - - automation.lighting_master_bedroom_opple_turn_on_lights_on_2_click - - automation.lighting_master_bedroom_opple_turn_off_all_lights_on_1_double - - automation.lighting_master_bedroom_opple_turn_on_all_lights_on_2_double + - automation.lighting_master_bedroom_opple_turn_off_all_lights_on_1_click + - automation.lighting_master_bedroom_opple_turn_on_all_lights_on_2_click + - automation.lighting_master_bedroom_opple_turn_off_lights_on_1_double + - automation.lighting_master_bedroom_opple_turn_on_lights_on_2_double - automation.lighting_master_bedroom_opple_turn_off_all_ambient_lights_on_1_triple - automation.lighting_master_bedroom_opple_turn_on_ambient_lights_on_2_triple - automation.media_master_bedroom_opple_toggle_music_on_3_single @@ -225,12 +225,13 @@ cards: show_header_toggle: true icon: mdi:light-switch entities: - - automation.lighting_living_room_opple_turn_off_lights_on_1_click - - automation.lighting_living_room_opple_turn_on_lights_on_2_click - - automation.lighting_living_room_opple_turn_off_all_lights_on_1_double - - automation.lighting_living_room_opple_turn_on_all_lights_on_2_double + - automation.lighting_living_room_opple_turn_off_all_lights_on_1_click + - automation.lighting_living_room_opple_turn_on_all_lights_on_2_click + - automation.lighting_living_room_opple_turn_off_lights_on_1_double + - automation.lighting_living_room_opple_turn_on_lights_on_2_double - automation.lighting_living_room_opple_turn_off_all_ambient_lights_on_1_triple - automation.lighting_living_room_opple_turn_on_ambient_lights_on_2_triple + - automation.lighting_living_room_opple_ambient_lights_neon_on_2_release - automation.media_living_room_opple_toggle_music_on_3_single - automation.media_living_room_opple_bring_tv_on_3_double - automation.media_living_room_opple_bring_bedroom_on_3_triple diff --git a/config/packages/devices/bedroom/bedroom_opple.yaml b/config/packages/devices/bedroom/bedroom_opple.yaml index 6145326..cf1ba32 100644 --- a/config/packages/devices/bedroom/bedroom_opple.yaml +++ b/config/packages/devices/bedroom/bedroom_opple.yaml @@ -23,7 +23,7 @@ sensor: automation: # Lights - - alias: Lighting · Master bedroom · Opple · Turn off lights on 1 click + - alias: Lighting · Master bedroom · Opple · Turn off all lights on 1 click trigger: platform: mqtt topic: "z2m_deconz/opple_1" @@ -33,9 +33,9 @@ automation: state: 'button_1_single' action: - service: light.turn_off - entity_id: light.master_bedroom_main + entity_id: light.master_bedroom - - alias: Lighting · Master bedroom · Opple · Turn on lights on 2 click + - alias: Lighting · Master bedroom · Opple · Turn on all lights on 2 click trigger: platform: mqtt topic: "z2m_deconz/opple_1" @@ -46,7 +46,7 @@ automation: action: - service: light.turn_on data_template: - entity_id: light.master_bedroom_main + entity_id: light.master_bedroom brightness_pct: >- {% if not is_state('input_select.house_mode', 'day') %} @@ -55,7 +55,7 @@ automation: 100 {% endif %} - - alias: Lighting · Master bedroom · Opple · Turn off all lights on 1 double + - alias: Lighting · Master bedroom · Opple · Turn off lights on 1 double trigger: platform: mqtt topic: "z2m_deconz/opple_1" @@ -65,9 +65,9 @@ automation: state: 'button_1_double' action: - service: light.turn_off - entity_id: light.master_bedroom + entity_id: light.master_bedroom_main - - alias: Lighting · Master bedroom · Opple · Turn on all lights on 2 double + - alias: Lighting · Master bedroom · Opple · Turn on lights on 2 double trigger: platform: mqtt topic: "z2m_deconz/opple_1" @@ -78,7 +78,7 @@ automation: action: - service: light.turn_on data_template: - entity_id: light.master_bedroom + entity_id: light.master_bedroom_main brightness_pct: >- {% if not is_state('input_select.house_mode', 'day') %} diff --git a/config/packages/devices/living_room/living_room_opple.yaml b/config/packages/devices/living_room/living_room_opple.yaml index c03340d..e504112 100644 --- a/config/packages/devices/living_room/living_room_opple.yaml +++ b/config/packages/devices/living_room/living_room_opple.yaml @@ -23,7 +23,7 @@ sensor: automation: # Lights - - alias: Lighting · Living room · Opple · Turn off lights on 1 click + - alias: Lighting · Living room · Opple · Turn off all lights on 1 click trigger: platform: mqtt topic: "z2m_deconz/opple_2" @@ -33,9 +33,9 @@ automation: state: 'button_1_single' action: - service: light.turn_off - entity_id: light.living_room_main + entity_id: light.living_room - - alias: Lighting · Living room · Opple · Turn on lights on 2 click + - alias: Lighting · Living room · Opple · Turn on all lights on 2 click trigger: platform: mqtt topic: "z2m_deconz/opple_2" @@ -45,9 +45,9 @@ automation: state: 'button_2_single' action: - service: light.turn_on - entity_id: light.living_room_main + entity_id: light.living_room - - alias: Lighting · Living room · Opple · Turn off all lights on 1 double + - alias: Lighting · Living room · Opple · Turn off lights on 1 double trigger: platform: mqtt topic: "z2m_deconz/opple_2" @@ -57,9 +57,9 @@ automation: state: 'button_1_double' action: - service: light.turn_off - entity_id: light.living_room + entity_id: light.living_room_main - - alias: Lighting · Living room · Opple · Turn on all lights on 2 double + - alias: Lighting · Living room · Opple · Turn on lights on 2 double trigger: platform: mqtt topic: "z2m_deconz/opple_2" @@ -69,7 +69,7 @@ automation: state: 'button_2_double' action: - service: light.turn_on - entity_id: light.living_room + entity_id: light.living_room_main - alias: Lighting · Living room · Opple · Turn off all ambient lights on 1 triple trigger: @@ -95,6 +95,17 @@ automation: - service: light.turn_on entity_id: light.living_room_ambient + - alias: Lighting · Living room · Opple · Ambient lights neon on 2 release + trigger: + platform: mqtt + topic: "z2m_deconz/opple_2" + condition: + - condition: state + entity_id: sensor.living_room_opple_action + state: 'button_2_release' + action: + - service: script.scene_living_room_ambient_neon + # Audio - alias: Media · Living room · Opple · Toggle music on 3 single @@ -242,5 +253,33 @@ automation: entity_id: sensor.living_room_opple_action state: 'button_6_triple' action: + - service: automation.turn_off + entity_id: automation.tv_sonos_join_tv_on_google_cast + - service: script.tv_fireplace + - service: sonos.join + entity_id: + - media_player.kitchen + - media_player.bathroom + data: + master: media_player.master_bedroom + + # Music play, without the join + - service: media_player.volume_set + entity_id: media_player.master_bedroom + data: + volume_level: 0.2 + - service: media_player.shuffle_set + entity_id: media_player.master_bedroom + data: + shuffle: true + - service: media_player.select_source + entity_id: media_player.master_bedroom + data: + source: "Evening Chill" + + - delay: 00:01:00 + - service: automation.turn_on + entity_id: automation.tv_sonos_join_tv_on_google_cast + diff --git a/config/packages/devices/living_room/tv.yaml b/config/packages/devices/living_room/tv.yaml index 5cb7fde..f5cdf0b 100644 --- a/config/packages/devices/living_room/tv.yaml +++ b/config/packages/devices/living_room/tv.yaml @@ -28,8 +28,8 @@ script: alias: TV · Fireplace sequence: - service: script.tv_prepare_for_playback - data: - volume_level: 0.08 + data_template: + volume_level: "{{ volume_level | default(0.1) }}" - service: media_extractor.play_media entity_id: media_player.shield data: @@ -92,10 +92,7 @@ automation: entity_id: input_select.house_mode state: "day" action: - - service: sonos.join - data: - master: media_player.master_bedroom - entity_id: media_player.living_room + - service: script.sonos_join_bedroom - service: logbook.log data: name: "📺 Media Module · " @@ -116,7 +113,6 @@ automation: message: "Sync TV state · Turning Shield on - TV is on" domain: media_player - - alias: TV · State · Sync on TV off trigger: platform: state @@ -170,11 +166,17 @@ automation: trigger: platform: state entity_id: media_player.nvidia_shield + to: 'playing' condition: - condition: template value_template: "{{ state_attr('media_player.nvidia_shield', 'source') == 'Google Cast' }}" action: - service: script.sonos_join_tv + - service: logbook.log + data: + name: "📺 Media Module · " + message: "TV · Google Cast - Joining Sonoses" + domain: media_player homeassistant: customize: diff --git a/config/packages/modules/lighting/by_rooms/master_bedroom.yaml b/config/packages/modules/lighting/by_rooms/bedroom.yaml similarity index 100% rename from config/packages/modules/lighting/by_rooms/master_bedroom.yaml rename to config/packages/modules/lighting/by_rooms/bedroom.yaml diff --git a/config/packages/modules/lighting/by_rooms/living_room.yaml b/config/packages/modules/lighting/by_rooms/living_room.yaml new file mode 100644 index 0000000..4dad5b5 --- /dev/null +++ b/config/packages/modules/lighting/by_rooms/living_room.yaml @@ -0,0 +1,14 @@ +script: + scene_living_room_ambient_neon: + icon: "mdi:weather-night" + sequence: + - service: light.turn_on + entity_id: light.light_avatar_small_1 + data: + xy_color: [0.668, 0.284] + brightness_pct: 80 + - service: light.turn_on + entity_id: light.living_room_ambient_main + data: + rgb_color: [0, 255, 190] + brightness_pct: 100 diff --git a/config/packages/modules/media/sonos.yaml b/config/packages/modules/media/sonos.yaml index cce6336..15bdd5b 100644 --- a/config/packages/modules/media/sonos.yaml +++ b/config/packages/modules/media/sonos.yaml @@ -51,6 +51,10 @@ script: entity_id: group.all_sonos data: master: media_player.living_room + - service: media_player.select_source + entity_id: media_player.living_room + data: + source: TV sonos_bathroom_up: alias: Sonos · Bathroom up sequence: