mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-04-25 04:48:17 +00:00
Refactor guest bedroom switch as second bedside switch
This commit is contained in:
@@ -63,6 +63,7 @@ cards:
|
||||
- automation.living_room_desk_switch
|
||||
- automation.bedroom_opple
|
||||
- automation.bedroom_bedside_switch
|
||||
- automation.bedroom_bedside_second_switch
|
||||
- automation.guest_bedroom_aqara_switch
|
||||
- automation.bathroom_switch
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ cards:
|
||||
- type: custom:battery-entity-row
|
||||
entity: sensor.bedside_switch_battery
|
||||
- type: custom:battery-entity-row
|
||||
entity: sensor.bedroom_wall_switch_battery
|
||||
entity: sensor.bedside_second_switch_battery
|
||||
- type: custom:battery-entity-row
|
||||
entity: sensor.bathroom_switch_battery
|
||||
- type: custom:battery-entity-row
|
||||
@@ -110,7 +110,7 @@ cards:
|
||||
- type: divider
|
||||
- sensor.bedside_switch_lqi
|
||||
# - sensor.bed_led_lqi
|
||||
- sensor.bedroom_wall_switch_lqi
|
||||
- sensor.bedside_second_switch_lqi
|
||||
- sensor.bedroom_opple_lqi
|
||||
- sensor.bedroom_door_lqi
|
||||
- sensor.bedroom_left_window_lqi
|
||||
|
||||
@@ -35,13 +35,8 @@ automation:
|
||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
entity_id: light.bedside
|
||||
data:
|
||||
brightness_pct: 100
|
||||
# - service: script.bed_led_toggle
|
||||
# data_template:
|
||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
|
||||
43
config/packages/devices/bedroom/bedside_switch_2.yaml
Normal file
43
config/packages/devices/bedroom/bedside_switch_2.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
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"
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'day') %}
|
||||
['light.master_bedroom_main', 'light.bedside']
|
||||
{% else %}
|
||||
light.bedside
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
# - service: script.bed_led_toggle
|
||||
# data_template:
|
||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||
|
||||
double_click:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
@@ -1,49 +1,53 @@
|
||||
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 }}"
|
||||
#############################
|
||||
# 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"
|
||||
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') }}"
|
||||
# automation:
|
||||
# - alias: Guest Bedroom · Aqara Switch
|
||||
# use_blueprint:
|
||||
# path: aqara_switch.yaml
|
||||
# input:
|
||||
# z2m_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
# 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
|
||||
# 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
|
||||
# hold:
|
||||
# - service: script.guest_bedroom_bedside_confirm
|
||||
# - service: input_select.select_next
|
||||
# entity_id: input_select.guest_bedroom_mode
|
||||
|
||||
@@ -19,7 +19,7 @@ automation:
|
||||
- sensor.bedroom_weather_battery
|
||||
- sensor.bedroom_opple_battery
|
||||
- sensor.bedside_switch_battery
|
||||
- sensor.bedroom_wall_switch_battery
|
||||
- sensor.bedside_second_switch_battery
|
||||
- sensor.bedroom_radiator_battery_level
|
||||
|
||||
- sensor.kitchen_window_battery
|
||||
|
||||
Reference in New Issue
Block a user