More bedroom scenes and switch automation

This commit is contained in:
2021-01-16 02:03:26 +02:00
parent 1d8d99356c
commit 2bc5d1c2ce
6 changed files with 86 additions and 97 deletions
@@ -0,0 +1,39 @@
sensor:
- platform: mqtt
name: "Bedroom wall switch battery"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
unit_of_measurement: "%"
device_class: "battery"
value_template: "{{ value_json.battery }}"
- platform: mqtt
name: "Bedroom wall switch LQI"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
icon: "mdi:signal"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"
automation:
- alias: Bedroom · Aqara Switch
use_blueprint:
path: aqara_switch.yaml
input:
z2m_topic: "z2m_deconz/bedroom_wall_switch"
click:
- service: script.apply_bedroom_pink
- service: script.music_play
data:
playlist: "Songs for a Romantic Evening"
volume: 0.1
shuffle: false
- service: script.sonos_volume_10
double_click:
- service: scene.turn_on
entity_id: scene.bedroom_default
hold:
- service: media_player.media_play_pause
entity_id: media_player.master_bedroom
@@ -1,73 +0,0 @@
sensor:
- platform: mqtt
name: "Bedroom wall switch click"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
icon: "mdi:toggle-switch"
value_template: "{{ value_json.click }}"
- platform: mqtt
name: "Bedroom wall switch battery"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
unit_of_measurement: "%"
device_class: "battery"
value_template: "{{ value_json.battery }}"
- platform: mqtt
name: "Bedroom wall switch action"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
icon: "mdi:gesture-double-tap"
value_template: "{{ value_json.action }}"
- platform: mqtt
name: "Bedroom wall switch LQI"
state_topic: "z2m_deconz/bedroom_wall_switch"
availability_topic: "z2m_deconz/bridge/state"
icon: "mdi:signal"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"
automation:
- alias: Lighting · Master bedroom · Toggle lights on switch single click
trigger:
platform: mqtt
topic: "z2m_deconz/bedroom_wall_switch"
condition:
- condition: state
entity_id: sensor.bedroom_wall_switch_click
state: 'single'
action:
- service: light.toggle
data_template:
entity_id: light.master_bedroom_main
brightness_pct: >-
{% if is_state('input_select.house_mode', 'night') %}
40
{% else %}
100
{% endif %}
- alias: Lighting · Master bedroom · Toggle ambient lights on switch double click
trigger:
platform: mqtt
topic: "z2m_deconz/bedroom_wall_switch"
condition:
- condition: state
entity_id: sensor.bedroom_wall_switch_click
state: 'double'
action:
- service: light.toggle
entity_id: light.bedside
data:
brightness_pct: 100
- service: script.bed_led_toggle
- alias: Music · Master bedroom · Play pause on switch hold
trigger:
platform: state
entity_id: sensor.bedroom_wall_switch_action
to: 'hold'
action:
- service: media_player.media_play_pause
entity_id: media_player.master_bedroom
@@ -18,9 +18,24 @@ script:
data:
rgb_color: [255, 0, 63]
brightness: 153
- delay: "00:00:03"
- delay: "00:00:02"
- service: scene.turn_on
entity_id: scene.bedroom_ambient_neon
apply_bedroom_pink:
sequence:
- service: light.turn_off
entity_id: light.bed_led
- service: light.turn_on
entity_id: light.master_bedroom_main
- delay: "00:00:01"
- service: light.turn_on
entity_id: light.master_bedroom_main
data:
rgb_color: [255, 92, 38]
brightness: 120
- delay: "00:00:02"
- service: scene.turn_on
entity_id: scene.bedroom_ambient_pink
scene:
- name: Bedroom Ambient Neon
@@ -35,6 +50,18 @@ scene:
xy_color: [0.66, 0.28]
brightness: 254
- name: Bedroom Ambient Pink
icon: "mdi:weather-night"
entities:
light.bedside:
state: "on"
rgb_color: [255, 36, 145]
brightness: 230
light.bed_led:
state: "on"
xy_color: [0.66, 0.28]
brightness: 254
- name: Bedroom Ambient Default
icon: "mdi:weather-sunny"
entities:
+8 -18
View File
@@ -72,40 +72,30 @@ script:
alias: Sonos · Volume 10
sequence:
- service: media_player.volume_set
entity_id: media_player.master_bedroom
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
data:
volume_level: 0.1
- service: media_player.volume_set
entity_id: media_player.living_room
data:
volume_level: 0.2
- service: media_player.volume_set
entity_id: media_player.bathroom
data:
volume_level: 0.1
- service: media_player.volume_set
entity_id: media_player.kitchen
data:
volume_level: 0.1
sonos_volume_20:
alias: Sonos · Volume 20
sequence:
- service: media_player.volume_set
entity_id: media_player.master_bedroom
entity_id:
- media_player.master_bedroom
- media_player.bathroom
- media_player.kitchen
data:
volume_level: 0.2
- service: media_player.volume_set
entity_id: media_player.living_room
data:
volume_level: 0.3
- service: media_player.volume_set
entity_id: media_player.bathroom
data:
volume_level: 0.2
- service: media_player.volume_set
entity_id: media_player.kitchen
data:
volume_level: 0.2
automation:
- alias: Media · Sonos · Put Beam in night mode