From 77d71bf7fcf261d442a0522a7c7a2fb2ec9dfebe Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 22 Mar 2018 22:00:28 -0400 Subject: [PATCH] Dim living room lights when watching Plex --- automations.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ customize.yaml | 4 ++++ groups.yaml | 11 +++++++++++ scenes.yaml | 15 +++++++++++++++ 4 files changed, 76 insertions(+) diff --git a/automations.yaml b/automations.yaml index d44336e..1d1a413 100644 --- a/automations.yaml +++ b/automations.yaml @@ -59,3 +59,49 @@ platform: state from: not_home to: home +- action: + - service: scene.turn_on + entity_id: scene.dimmed_brightness + alias: Dim when Plex is active + trigger: + - platform: state + entity_id: media_player.plex_ps4 + to: playing + from: idle + condition: + - condition: state + entity_id: light.living_room + state: 'on' +- action: + - service: scene.turn_on + entity_id: scene.nighttime_brightness + alias: Restore nighttime lights after Plex + trigger: + - platform: state + entity_id: media_player.plex_ps4 + to: idle + from: playing + condition: + - condition: state + entity_id: light.living_room + state: 'on' + - condition: state + entity_id: sun.sun + state: 'below_horizon' +- action: + - service: scene.turn_on + entity_id: scene.normal_brightness + alias: Restore normal lights after Plex + trigger: + - platform: state + entity_id: media_player.plex_ps4 + to: idle + from: playing + condition: + - condition: state + entity_id: light.living_room + state: 'on' + - condition: state + entity_id: sun.sun + state: 'above_horizon' + diff --git a/customize.yaml b/customize.yaml index e69de29..09f18b9 100644 --- a/customize.yaml +++ b/customize.yaml @@ -0,0 +1,4 @@ +group.all_automations: + hidden: false +group.all_scripts: + hidden: false diff --git a/groups.yaml b/groups.yaml index 8817437..bcb44be 100644 --- a/groups.yaml +++ b/groups.yaml @@ -22,6 +22,13 @@ Entertainment: - group.chromecast - group.consoles +Automation: + view: yes + name: Automation + entities: + - group.all_scripts + - group.all_automations + livingroom_lights: name: Living Room entities: @@ -30,6 +37,9 @@ livingroom_lights: - scene.bright - scene.energize - scene.stephanie + - scene.normal_brightness + - scene.nighttime_brightness + - scene.dimmed_brightness bedroom_lights: name: Bedroom @@ -68,3 +78,4 @@ phones: entities: - device_tracker.homeassistant_pixel - device_tracker.StephaniesIphone + diff --git a/scenes.yaml b/scenes.yaml index d8f6d94..3614569 100644 --- a/scenes.yaml +++ b/scenes.yaml @@ -16,6 +16,21 @@ state: on brightness: 254 xy_color: [0.3146,0.3303] +- name: Normal Brightness + entities: + light.living_room: + state: on + brightness_pct: 100 +- name: Nighttime Brightness + entities: + light.living_room: + state: on + brightness_pct: 60 +- name: Dimmed Brightness + entities: + light.living_room: + state: on + brightness_pct: 20 - name: Dawn entities: light.standing_lamp: