mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-07 10:18:44 +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.living_room_desk_switch
|
||||||
- automation.bedroom_opple
|
- automation.bedroom_opple
|
||||||
- automation.bedroom_bedside_switch
|
- automation.bedroom_bedside_switch
|
||||||
|
- automation.bedroom_bedside_second_switch
|
||||||
- automation.guest_bedroom_aqara_switch
|
- automation.guest_bedroom_aqara_switch
|
||||||
- automation.bathroom_switch
|
- automation.bathroom_switch
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ cards:
|
|||||||
- type: custom:battery-entity-row
|
- type: custom:battery-entity-row
|
||||||
entity: sensor.bedside_switch_battery
|
entity: sensor.bedside_switch_battery
|
||||||
- type: custom:battery-entity-row
|
- type: custom:battery-entity-row
|
||||||
entity: sensor.bedroom_wall_switch_battery
|
entity: sensor.bedside_second_switch_battery
|
||||||
- type: custom:battery-entity-row
|
- type: custom:battery-entity-row
|
||||||
entity: sensor.bathroom_switch_battery
|
entity: sensor.bathroom_switch_battery
|
||||||
- type: custom:battery-entity-row
|
- type: custom:battery-entity-row
|
||||||
@@ -110,7 +110,7 @@ cards:
|
|||||||
- type: divider
|
- type: divider
|
||||||
- sensor.bedside_switch_lqi
|
- sensor.bedside_switch_lqi
|
||||||
# - sensor.bed_led_lqi
|
# - sensor.bed_led_lqi
|
||||||
- sensor.bedroom_wall_switch_lqi
|
- sensor.bedside_second_switch_lqi
|
||||||
- sensor.bedroom_opple_lqi
|
- sensor.bedroom_opple_lqi
|
||||||
- sensor.bedroom_door_lqi
|
- sensor.bedroom_door_lqi
|
||||||
- sensor.bedroom_left_window_lqi
|
- sensor.bedroom_left_window_lqi
|
||||||
|
|||||||
@@ -35,13 +35,8 @@ automation:
|
|||||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
||||||
|
|
||||||
double_click:
|
double_click:
|
||||||
- service: light.toggle
|
- service: media_player.media_play_pause
|
||||||
entity_id: light.bedside
|
entity_id: media_player.master_bedroom
|
||||||
data:
|
|
||||||
brightness_pct: 100
|
|
||||||
# - service: script.bed_led_toggle
|
|
||||||
# data_template:
|
|
||||||
# brightness_pct: "{{ is_state('input_select.bedroom_mode', 'night') | iif(40, 100)}}"
|
|
||||||
|
|
||||||
hold:
|
hold:
|
||||||
- service: script.toggle_bedroom_mode
|
- service: script.toggle_bedroom_mode
|
||||||
|
|||||||
@@ -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:
|
# Moved to bedside_switch_2 #
|
||||||
- name: "Bedroom wall switch battery"
|
#############################
|
||||||
state_topic: "z2m_deconz/bedroom_wall_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
# mqtt:
|
||||||
unit_of_measurement: "%"
|
# sensor:
|
||||||
device_class: "battery"
|
# - name: "Bedroom wall switch battery"
|
||||||
value_template: "{{ value_json.battery }}"
|
# state_topic: "z2m_deconz/bedroom_wall_switch"
|
||||||
- name: "Bedroom wall switch LQI"
|
# availability_topic: "z2m_deconz/bridge/state"
|
||||||
state_topic: "z2m_deconz/bedroom_wall_switch"
|
# unit_of_measurement: "%"
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
# device_class: "battery"
|
||||||
unit_of_measurement: "lqi"
|
# value_template: "{{ value_json.battery }}"
|
||||||
device_class: "signal_strength"
|
# - name: "Bedroom wall switch LQI"
|
||||||
value_template: "{{ value_json.linkquality }}"
|
# 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:
|
# automation:
|
||||||
- alias: Guest Bedroom · Aqara Switch
|
# - alias: Guest Bedroom · Aqara Switch
|
||||||
use_blueprint:
|
# use_blueprint:
|
||||||
path: aqara_switch.yaml
|
# path: aqara_switch.yaml
|
||||||
input:
|
# input:
|
||||||
z2m_topic: "z2m_deconz/bedroom_wall_switch"
|
# z2m_topic: "z2m_deconz/bedroom_wall_switch"
|
||||||
click:
|
# click:
|
||||||
- choose:
|
# - choose:
|
||||||
- conditions:
|
# - conditions:
|
||||||
- condition: state
|
# - condition: state
|
||||||
entity_id: input_select.guest_bedroom_mode
|
# entity_id: input_select.guest_bedroom_mode
|
||||||
state: 'night'
|
# state: 'night'
|
||||||
sequence:
|
# sequence:
|
||||||
- service: light.toggle
|
# - service: light.toggle
|
||||||
entity_id: light.light_lohas_6
|
# entity_id: light.light_lohas_6
|
||||||
data_template:
|
# data_template:
|
||||||
brightness_pct: 10
|
# brightness_pct: 10
|
||||||
color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
# color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||||
default:
|
# default:
|
||||||
- service: light.toggle
|
# - service: light.toggle
|
||||||
entity_id: light.light_lohas_6
|
# entity_id: light.light_lohas_6
|
||||||
data_template:
|
# data_template:
|
||||||
brightness_pct: 100
|
# brightness_pct: 100
|
||||||
color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
# color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||||
|
|
||||||
double_click:
|
# double_click:
|
||||||
- service: light.toggle
|
# - service: light.toggle
|
||||||
entity_id: light.light_lohas_6
|
# entity_id: light.light_lohas_6
|
||||||
|
|
||||||
hold:
|
# hold:
|
||||||
- service: script.guest_bedroom_bedside_confirm
|
# - service: script.guest_bedroom_bedside_confirm
|
||||||
- service: input_select.select_next
|
# - service: input_select.select_next
|
||||||
entity_id: input_select.guest_bedroom_mode
|
# entity_id: input_select.guest_bedroom_mode
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ automation:
|
|||||||
- sensor.bedroom_weather_battery
|
- sensor.bedroom_weather_battery
|
||||||
- sensor.bedroom_opple_battery
|
- sensor.bedroom_opple_battery
|
||||||
- sensor.bedside_switch_battery
|
- sensor.bedside_switch_battery
|
||||||
- sensor.bedroom_wall_switch_battery
|
- sensor.bedside_second_switch_battery
|
||||||
- sensor.bedroom_radiator_battery_level
|
- sensor.bedroom_radiator_battery_level
|
||||||
|
|
||||||
- sensor.kitchen_window_battery
|
- sensor.kitchen_window_battery
|
||||||
|
|||||||
Reference in New Issue
Block a user