mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 17:12:59 +00:00
Refactor guest bedroom switch as second bedside switch
This commit is contained in:
@@ -35,13 +35,8 @@ automation:
|
||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
entity_id: light.bedside
|
||||
data:
|
||||
brightness_pct: 100
|
||||
# - service: script.bed_led_toggle
|
||||
# data_template:
|
||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedside second 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 }}"
|
||||
- name: "Bedside second switch LQI"
|
||||
state_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Bedside Second Switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'day') %}
|
||||
['light.master_bedroom_main', 'light.bedside']
|
||||
{% else %}
|
||||
light.bedside
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
# - service: script.bed_led_toggle
|
||||
# data_template:
|
||||
# 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
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
Reference in New Issue
Block a user