mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
sensor:
|
|
- platform: mqtt
|
|
name: "Desk switch battery"
|
|
state_topic: "z2m_deconz/desk_switch"
|
|
availability_topic: "z2m_deconz/bridge/state"
|
|
unit_of_measurement: "%"
|
|
device_class: "battery"
|
|
value_template: "{{ value_json.battery }}"
|
|
- platform: mqtt
|
|
name: "Desk switch LQI"
|
|
state_topic: "z2m_deconz/desk_switch"
|
|
availability_topic: "z2m_deconz/bridge/state"
|
|
icon: "mdi:signal"
|
|
unit_of_measurement: "lqi"
|
|
value_template: "{{ value_json.linkquality }}"
|
|
|
|
|
|
automation:
|
|
- alias: Living room · Desk switch
|
|
use_blueprint:
|
|
path: aqara_switch.yaml
|
|
input:
|
|
z2m_topic: "z2m_deconz/desk_switch"
|
|
click:
|
|
- service: light.toggle
|
|
data_template:
|
|
entity_id: light.living_room_main
|
|
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
|
|
|
double_click:
|
|
- service: light.toggle
|
|
data_template:
|
|
entity_id: light.living_room_ambient
|
|
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
|
|
|
hold:
|
|
- service: media_player.media_play_pause
|
|
entity_id: media_player.living_room
|