mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
101 lines
2.9 KiB
YAML
101 lines
2.9 KiB
YAML
sensor:
|
|
- platform: mqtt
|
|
name: "Bedroom Opple action"
|
|
state_topic: "z2m_deconz/opple_1"
|
|
availability_topic: "z2m_deconz/bridge/state"
|
|
icon: "mdi:gesture-double-tap"
|
|
value_template: "{{ value_json.action }}"
|
|
- platform: mqtt
|
|
name: "Bedroom Opple battery"
|
|
state_topic: "z2m_deconz/opple_1"
|
|
availability_topic: "z2m_deconz/bridge/state"
|
|
unit_of_measurement: "%"
|
|
device_class: "battery"
|
|
value_template: "{{ value_json.battery }}"
|
|
- platform: mqtt
|
|
name: "Bedroom Opple LQI"
|
|
state_topic: "z2m_deconz/opple_1"
|
|
availability_topic: "z2m_deconz/bridge/state"
|
|
icon: "mdi:signal"
|
|
unit_of_measurement: "lqi"
|
|
value_template: "{{ value_json.linkquality }}"
|
|
|
|
automation:
|
|
- alias: Bedroom · Opple
|
|
use_blueprint:
|
|
path: oppo_6_btn_switch.yaml
|
|
input:
|
|
opple_z2m_name: "z2m_deconz/opple_1"
|
|
action_sensor: sensor.bedroom_opple_action
|
|
|
|
button_1_single:
|
|
- service: light.turn_off
|
|
entity_id: light.master_bedroom
|
|
|
|
button_2_single:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id:
|
|
- light.master_bedroom
|
|
brightness_pct: >-
|
|
{% if not is_state('input_select.bedroom_mode', 'day') %} 40 {% else %} 100 {% endif %}
|
|
|
|
button_1_double:
|
|
- service: light.turn_off
|
|
entity_id: light.master_bedroom_main
|
|
|
|
button_2_double:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id: light.master_bedroom_main
|
|
brightness_pct: "{{ is_state('input_select.bedroom_mode', 'day') | iif(100, 40) }}"
|
|
|
|
button_1_triple:
|
|
- service: light.turn_off
|
|
entity_id:
|
|
- light.bedside
|
|
- light.bed_led
|
|
|
|
button_2_triple:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id:
|
|
- light.bedside
|
|
- light.bed_led
|
|
brightness_pct: "{{ is_state('input_select.bedroom_mode', 'day') | iif(100, 40) }}"
|
|
|
|
button_3_single:
|
|
- service: media_player.media_play_pause
|
|
entity_id: media_player.master_bedroom
|
|
|
|
button_3_double:
|
|
- service: script.sonos_join_tv
|
|
|
|
button_3_triple:
|
|
- service: script.sonos_join_bedroom
|
|
|
|
button_3_release:
|
|
- service: media_player.play_next
|
|
entity_id: media_player.master_bedroom
|
|
|
|
button_4_single:
|
|
- service: script.music_play
|
|
|
|
button_4_double:
|
|
- service: script.music_play
|
|
data:
|
|
playlist: 'Starred'
|
|
|
|
button_4_triple:
|
|
- service: script.music_play
|
|
data:
|
|
playlist: 'Retro'
|
|
|
|
button_5_single:
|
|
- service: fan.turn_off
|
|
entity_id: fan.philips_airpurifier
|
|
|
|
button_6_single:
|
|
- service: fan.turn_on
|
|
entity_id: fan.philips_airpurifier
|