mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 17:12:59 +00:00
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
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
|
|
|
|
double_click:
|
|
- service: media_player.media_play_pause
|
|
entity_id: media_player.master_bedroom
|
|
|
|
hold:
|
|
- service: script.toggle_bedroom_mode
|