mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-21 10:57:43 +00:00
Switch to zigbee2mqtt auto discovery
This commit is contained in:
@@ -6,27 +6,12 @@ input_number:
|
||||
step: 0.05
|
||||
icon: mdi:speaker
|
||||
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bathroom switch battery"
|
||||
state_topic: "z2m_deconz/bathroom_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bathroom switch LQI"
|
||||
state_topic: "z2m_deconz/bathroom_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
device_class: "signal_strength"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Bathroom · Switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bathroom_switch/action"
|
||||
action_entity: sensor.bathroom_switch_action
|
||||
click:
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.bathroom
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedroom Opple action"
|
||||
state_topic: "z2m_deconz/opple_1/action"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
- 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 }}"
|
||||
- name: "Bedroom Opple LQI"
|
||||
state_topic: "z2m_deconz/opple_1"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Opple
|
||||
id: bedroom_opple
|
||||
use_blueprint:
|
||||
path: oppo_6_btn_switch.yaml
|
||||
input:
|
||||
opple_z2m_name: "z2m_deconz/opple_1"
|
||||
action_sensor: sensor.bedroom_opple_action
|
||||
action_sensor: sensor.opple_1_action
|
||||
|
||||
button_1_single:
|
||||
- service: light.turn_off
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedside switch battery"
|
||||
state_topic: "z2m_deconz/bedside_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bedside switch LQI"
|
||||
state_topic: "z2m_deconz/bedside_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Bedside Switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bedside_switch/action"
|
||||
action_entity: sensor.bedside_switch_action
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
|
||||
@@ -1,25 +1,9 @@
|
||||
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/action"
|
||||
action_entity: sensor.bedroom_wall_switch_action
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#############################
|
||||
# Moved to bedside_switch_2 #
|
||||
#############################
|
||||
|
||||
# mqtt:
|
||||
# sensor:
|
||||
# - name: "Bedroom wall 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: "Bedroom wall 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: Guest Bedroom · Aqara Switch
|
||||
# use_blueprint:
|
||||
# path: aqara_switch.yaml
|
||||
# input:
|
||||
# z2m_topic: "z2m_deconz/bedroom_wall_switch/action"
|
||||
# click:
|
||||
# - choose:
|
||||
# - conditions:
|
||||
# - condition: state
|
||||
# entity_id: input_select.guest_bedroom_mode
|
||||
# state: 'night'
|
||||
# sequence:
|
||||
# - service: light.toggle
|
||||
# entity_id: light.light_lohas_6
|
||||
# data_template:
|
||||
# brightness_pct: 10
|
||||
# color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||
# default:
|
||||
# - service: light.toggle
|
||||
# entity_id: light.light_lohas_6
|
||||
# data_template:
|
||||
# brightness_pct: 100
|
||||
# color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||
|
||||
# double_click:
|
||||
# - service: light.toggle
|
||||
# entity_id: light.light_lohas_6
|
||||
|
||||
# hold:
|
||||
# - service: script.guest_bedroom_bedside_confirm
|
||||
# - service: input_select.select_next
|
||||
# entity_id: input_select.guest_bedroom_mode
|
||||
@@ -36,7 +36,7 @@ automation:
|
||||
message: "Waiting for front door to open. Have a great time!"
|
||||
- wait_for_trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.front_door
|
||||
entity_id: binary_sensor.front_door_contact
|
||||
to: "on"
|
||||
timeout:
|
||||
minutes: 5
|
||||
@@ -44,6 +44,3 @@ automation:
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Goodbye!"
|
||||
# TODO: add conditions
|
||||
# - service: input_boolean.turn_off
|
||||
# entity_id: input_boolean.georgi_home
|
||||
|
||||
@@ -1,25 +1,9 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- 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 }}"
|
||||
- name: "Desk switch LQI"
|
||||
state_topic: "z2m_deconz/desk_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Living room · Desk switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/desk_switch/action"
|
||||
action_entity: sensor.desk_switch_action
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Living room Opple action"
|
||||
state_topic: "z2m_deconz/opple_2/action"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
- name: "Living room Opple battery"
|
||||
state_topic: "z2m_deconz/opple_2"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Living room Opple LQI"
|
||||
state_topic: "z2m_deconz/opple_2"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Living room · Opple
|
||||
id: living_room_opple
|
||||
use_blueprint:
|
||||
path: oppo_6_btn_switch.yaml
|
||||
input:
|
||||
opple_z2m_name: "z2m_deconz/opple_2"
|
||||
action_sensor: sensor.living_room_opple_action
|
||||
action_sensor: sensor.opple_2_action
|
||||
|
||||
button_1_single:
|
||||
- service: light.turn_off
|
||||
|
||||
@@ -73,8 +73,8 @@ template:
|
||||
{% set temp_matching = states('sensor.multisensor_6_temperature')|float >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set outside_temp_high = states('sensor.dark_sky_apparent_temperature')|float + 2 >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set someone_home = is_state('binary_sensor.someone_home', 'on') %}
|
||||
{% set bedroom_ready = is_state('group.bedroom_windows', 'off') or is_state('binary_sensor.bedroom_door', 'off') %}
|
||||
{% set kitchen_ready = is_state('binary_sensor.kitchen_window', 'off') or is_state('binary_sensor.kitchen_door', 'off') %}
|
||||
{% set bedroom_ready = is_state('group.bedroom_windows', 'off') or is_state('binary_sensor.bedroom_door_contact', 'off') %}
|
||||
{% set kitchen_ready = is_state('binary_sensor.kitchen_window_contact', 'off') or is_state('binary_sensor.kitchen_door_contact', 'off') %}
|
||||
{% set ac_off = is_state('climate.toshiba_ac', 'off') %}
|
||||
{{ temp_matching and outside_temp_high and someone_home and bedroom_ready and kitchen_ready and ac_off }}
|
||||
|
||||
@@ -157,10 +157,10 @@ automation:
|
||||
for: "00:05:00"
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.living_room_right_window_contact
|
||||
- group.bedroom_windows
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.kitchen_door
|
||||
- binary_sensor.kitchen_window_contact
|
||||
- binary_sensor.kitchen_door_contact
|
||||
from: "on"
|
||||
to: "off"
|
||||
action:
|
||||
@@ -178,7 +178,7 @@ automation:
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.living_room_right_window_contact
|
||||
- group.bedroom_windows
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
@@ -1,41 +1,22 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Trust remote action"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
value_template: "{{ value_json.action }}"
|
||||
- name: "Trust remote group"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:lightbulb-group"
|
||||
value_template: "{{ value_json.action_group }}"
|
||||
- name: "Trust remote LQI"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Trust remote · Guest bedroom
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
- platform: state
|
||||
entity_id: sensor.trust_remote_action
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ trigger.payload_json.action == 'up-press' }}"
|
||||
- conditions: "{{ trigger.to_state.state == 'up-press' }}"
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.tradfri_large
|
||||
data_template:
|
||||
brightness_pct: "{{ is_state('input_select.guest_bedroom_mode', 'day') | iif(100, 10) }}"
|
||||
color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||
- conditions: "{{ trigger.payload_json.action == 'down-press' }}"
|
||||
- conditions: "{{ trigger.to_state.state == 'down-press' }}"
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
entity_id: light.tradfri_large
|
||||
- conditions: "{{ trigger.payload_json.action == 'on' or trigger.payload_json.action == 'off' }}"
|
||||
- conditions: "{{ trigger.to_state.state == 'on' or trigger.to_state.state == 'off' }}"
|
||||
sequence:
|
||||
- service: script.guest_bedroom_bedside_confirm
|
||||
- service: input_select.select_next
|
||||
@@ -59,7 +40,7 @@ automation:
|
||||
{% elif groupId == 0 %}
|
||||
{% set entityId = 'light.living_room_main' %}
|
||||
{% elif groupId == 1 %}
|
||||
{% set entityId = 'light.pc' %}
|
||||
{% set entityId = 'light.hue_ambiance_7' %}
|
||||
{% elif groupId == 2 %}
|
||||
{% set entityId = 'light.living_room_ambient' %}
|
||||
{% elif groupId == 3 %}
|
||||
@@ -76,54 +57,3 @@ automation:
|
||||
{% else %}
|
||||
-20
|
||||
{% endif %}
|
||||
|
||||
- alias: Trust remote · Turn on
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
condition: "{{ trigger.payload_json.action == 'on' }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% set groupId = (trigger.payload_json.action_group % 10) %}
|
||||
{% if groupId == 5 %}
|
||||
light.living_room
|
||||
{% elif groupId == 0 %}
|
||||
light.living_room_main
|
||||
{% elif groupId == 1 %}
|
||||
light.pc
|
||||
{% elif groupId == 2 %}
|
||||
light.living_room_ambient
|
||||
{% elif groupId == 3 %}
|
||||
light.living_room_ambient_main
|
||||
{% elif groupId == 4 %}
|
||||
light.light_lohas_2
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
- alias: Trust remote · Turn off
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
condition: "{{ trigger.payload_json.action == 'off' }}"
|
||||
action:
|
||||
- service: light.turn_off
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% set groupId = (trigger.payload_json.action_group % 10) %}
|
||||
{% if groupId == 5 %}
|
||||
{% set entityId = 'light.living_room' %}
|
||||
{% elif groupId == 0 %}
|
||||
{% set entityId = 'light.living_room_main' %}
|
||||
{% elif groupId == 1 %}
|
||||
{% set entityId = 'light.pc' %}
|
||||
{% elif groupId == 2 %}
|
||||
{% set entityId = 'light.living_room_ambient' %}
|
||||
{% elif groupId == 3 %}
|
||||
{% set entityId = 'light.living_room_ambient_main' %}
|
||||
{% elif groupId == 4 %}
|
||||
{% set entityId = 'light.light_lohas_2' %}
|
||||
{% endif %}
|
||||
|
||||
{{ entityId }}
|
||||
|
||||
@@ -23,7 +23,7 @@ automation:
|
||||
property_key: "001"
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id: light.pc
|
||||
entity_id: light.hue_ambiance_7
|
||||
|
||||
- alias: Wallmote · Living room · 2 · Tap · Toggle Music
|
||||
trigger:
|
||||
@@ -62,7 +62,7 @@ automation:
|
||||
- service: light.toggle
|
||||
entity_id:
|
||||
- light.living_room_main
|
||||
- light.pc
|
||||
- light.hue_ambiance_7
|
||||
|
||||
- alias: Wallmote · Living room · 3 · Hold · Toggle Ambient lights
|
||||
trigger:
|
||||
|
||||
Reference in New Issue
Block a user