mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-17 01:52:58 +00:00
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
sensor:
|
|
- platform: mqtt
|
|
name: "Bathroom switch click"
|
|
state_topic: "zigbee2mqtt/bathroom_switch"
|
|
availability_topic: "zigbee2mqtt/bridge/state"
|
|
icon: "mdi:toggle-switch"
|
|
value_template: "{{ value_json.click }}"
|
|
- platform: mqtt
|
|
name: "Bathroom switch battery"
|
|
state_topic: "zigbee2mqtt/bathroom_switch"
|
|
availability_topic: "zigbee2mqtt/bridge/state"
|
|
unit_of_measurement: "%"
|
|
device_class: "battery"
|
|
value_template: "{{ value_json.battery }}"
|
|
- platform: mqtt
|
|
name: "Bathroom switch action"
|
|
state_topic: "zigbee2mqtt/bathroom_switch"
|
|
availability_topic: "zigbee2mqtt/bridge/state"
|
|
icon: "mdi:gesture-double-tap"
|
|
value_template: "{{ value_json.action }}"
|
|
- platform: mqtt
|
|
name: "Bathroom switch LQI"
|
|
state_topic: "zigbee2mqtt/bathroom_switch"
|
|
availability_topic: "zigbee2mqtt/bridge/state"
|
|
icon: "mdi:signal"
|
|
unit_of_measurement: "lqi"
|
|
value_template: "{{ value_json.linkquality }}"
|
|
|
|
|
|
automation:
|
|
- alias: Media · Sonos · Volume up on bathroom switch click
|
|
trigger:
|
|
platform: mqtt
|
|
topic: "zigbee2mqtt/bathroom_switch"
|
|
condition:
|
|
- condition: state
|
|
entity_id: sensor.bathroom_switch_click
|
|
state: 'single'
|
|
action:
|
|
- service: media_player.volume_set
|
|
entity_id: media_player.bathroom
|
|
data_template:
|
|
volume_level: >-
|
|
|
|
{% if state_attr('media_player.bathroom', 'volume_level')|float > 0.45 %}
|
|
0.25
|
|
{% else %}
|
|
0.5
|
|
{% endif %}
|
|
|
|
- alias: Youtube · play latest pds on bathroom switch dobule click
|
|
trigger:
|
|
platform: mqtt
|
|
topic: "zigbee2mqtt/bathroom_switch"
|
|
condition:
|
|
- condition: state
|
|
entity_id: sensor.bathroom_switch_click
|
|
state: 'double'
|
|
action:
|
|
- service: media_player.volume_set
|
|
entity_id: media_player.bathroom
|
|
data:
|
|
volume_level: 0.5
|
|
- service: script.youtube_play_latest_pds
|