mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-07 18:28:43 +00:00
177 lines
5.2 KiB
YAML
177 lines
5.2 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
|
|
mode: queued
|
|
trigger:
|
|
platform: mqtt
|
|
topic: "z2m_deconz/opple_1"
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_1_single'
|
|
sequence:
|
|
- service: light.turn_off
|
|
entity_id: light.master_bedroom
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_2_single'
|
|
sequence:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id: light.master_bedroom
|
|
brightness_pct: >-
|
|
|
|
{% if not is_state('input_select.house_mode', 'day') %}
|
|
40
|
|
{% else %}
|
|
100
|
|
{% endif %}
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_1_double'
|
|
sequence:
|
|
- service: light.turn_off
|
|
entity_id: light.master_bedroom_main
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_2_double'
|
|
sequence:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id: light.master_bedroom_main
|
|
brightness_pct: >-
|
|
|
|
{% if not is_state('input_select.house_mode', 'day') %}
|
|
40
|
|
{% else %}
|
|
100
|
|
{% endif %}
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_1_triple'
|
|
sequence:
|
|
- service: light.turn_off
|
|
entity_id:
|
|
- light.bedside
|
|
- light.bed_led
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_2_triple'
|
|
sequence:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id:
|
|
- light.bedside
|
|
- light.bed_led
|
|
brightness_pct: >-
|
|
|
|
{% if not is_state('input_select.house_mode', 'day') %}
|
|
40
|
|
{% else %}
|
|
100
|
|
{% endif %}
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_3_single'
|
|
sequence:
|
|
- service: media_player.media_play_pause
|
|
entity_id: media_player.master_bedroom
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_3_double'
|
|
sequence:
|
|
- service: script.sonos_join_tv
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_3_triple'
|
|
sequence:
|
|
- service: script.sonos_join_bedroom
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_3_release'
|
|
sequence:
|
|
- service: media_player.play_next
|
|
entity_id: media_player.master_bedroom
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_4_single'
|
|
sequence:
|
|
- service: script.music_play
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_4_double'
|
|
sequence:
|
|
- service: script.music_play
|
|
data:
|
|
playlist: 'Starred'
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_4_triple'
|
|
sequence:
|
|
- service: script.music_play
|
|
data:
|
|
playlist: 'Retro'
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_5_single'
|
|
sequence:
|
|
- service: fan.turn_off
|
|
entity_id: fan.philips_airpurifier
|
|
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.bedroom_opple_action
|
|
state: 'button_6_single'
|
|
sequence:
|
|
- service: fan.turn_on
|
|
entity_id: fan.philips_airpurifier
|