From 48edc10df4006a7bca5b1a6126355e09382b8ea0 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sat, 6 Aug 2022 23:41:47 +0200 Subject: [PATCH] Bedroom automation changes Change sleep/wakeup automation button to be held Disable bedroom light when tv is on Add bedroom bet tv scene --- .../automations/bedroom-bed-button.yaml | 4 ++-- configuration/automations/bedroom-motion.yaml | 24 ++++--------------- configuration/automations/bedroom-tv.yaml | 8 +++++++ scripts/91.lights-bedroom.yaml | 15 ++++++++++++ 4 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 configuration/automations/bedroom-tv.yaml diff --git a/configuration/automations/bedroom-bed-button.yaml b/configuration/automations/bedroom-bed-button.yaml index ebbd4a3..14c0ed8 100644 --- a/configuration/automations/bedroom-bed-button.yaml +++ b/configuration/automations/bedroom-bed-button.yaml @@ -15,8 +15,8 @@ - device_id: 0d584dbfe721e00880b38c4dfc1c108e domain: zha platform: device - type: remote_button_short_press - subtype: turn_on + type: remote_button_long_press + subtype: dim_up condition: - condition: not conditions: diff --git a/configuration/automations/bedroom-motion.yaml b/configuration/automations/bedroom-motion.yaml index 45a2a9a..c286a6f 100644 --- a/configuration/automations/bedroom-motion.yaml +++ b/configuration/automations/bedroom-motion.yaml @@ -13,27 +13,11 @@ - condition: state entity_id: input_select.home_mode state: Day + - condition: state + entity_id: media_player.bedroom_tv + state: 'off' action: - - choose: - - conditions: - - condition: state - entity_id: media_player.bedroom_tv - state: 'on' - sequence: - - choose: - - conditions: - - condition: state - entity_id: sensor.bedroom_tv_media_input_source - state: HDMI2 - - condition: not - conditions: - - condition: state - entity_id: media_player.bedroom_atv - state: playing - sequence: - - service: script.bedroom_lights_on - default: - - service: script.bedroom_lights_on + - service: script.bedroom_lights_on - id: bedroom-motion-off alias: '[Bedroom] Motion Off' diff --git a/configuration/automations/bedroom-tv.yaml b/configuration/automations/bedroom-tv.yaml new file mode 100644 index 0000000..621791d --- /dev/null +++ b/configuration/automations/bedroom-tv.yaml @@ -0,0 +1,8 @@ +- id: bedroom-tv-on + alias: '[Bedroom] TV ON' + trigger: + - platform: state + entity_id: media_player.bedroom_tv + to: 'on' + action: + - service: script.bedroom_tv_scene diff --git a/scripts/91.lights-bedroom.yaml b/scripts/91.lights-bedroom.yaml index 5e2b421..d65328e 100644 --- a/scripts/91.lights-bedroom.yaml +++ b/scripts/91.lights-bedroom.yaml @@ -94,6 +94,21 @@ bedroom_bed_lamp_on: brightness_pct: 30 kelvin: 3200 +bedroom_tv_scene: + alias: '[Bedroom] TV Scene' + sequence: + - service: light.turn_on + entity_id: light.bed_lamps + data: + brightness_pct: 10 + kelvin: 2000 + - service: light.turn_off + entity_id: light.bedroom_lights + - service: light.turn_off + entity_id: light.bed_lightstrip + - service: light.turn_off + entity_id: light.bed_lamps + bedroom_bed_lamp_off: alias: '[Bedroom] Bed lamps off' sequence: