mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-09 10:14:41 +00:00
Add bedside switch
This commit is contained in:
@@ -44,9 +44,7 @@ cards:
|
||||
- type: custom:battery-entity
|
||||
entity: sensor.front_door_battery
|
||||
- type: custom:battery-entity
|
||||
entity: sensor.desk_switch_battery
|
||||
# - type: custom:battery-entity
|
||||
# entity: sensor.living_room_right_window_power
|
||||
entity: sensor.living_room_right_window_battery
|
||||
- type: divider
|
||||
- type: custom:battery-entity
|
||||
entity: sensor.bedroom_door_battery
|
||||
@@ -78,6 +76,8 @@ cards:
|
||||
# - type: custom:battery-entity
|
||||
# entity: sensor.master_bedroom_bedside_switch_power
|
||||
# - type: custom:battery-entity
|
||||
# entity: sensor.master_bedroom_switch_power
|
||||
# - type: custom:battery-entity
|
||||
# entity: sensor.bathroom_switch_power
|
||||
# - type: custom:battery-entity
|
||||
# entity: sensor.cube_power
|
||||
@@ -88,6 +88,8 @@ cards:
|
||||
entities:
|
||||
- sensor.front_door_lqi
|
||||
- sensor.desk_switch_lqi
|
||||
- sensor.bed_led_lqi
|
||||
- sensor.living_room_right_window_lqi
|
||||
- type: divider
|
||||
- sensor.bedroom_door_lqi
|
||||
- sensor.bedroom_left_window_lqi
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
light:
|
||||
- platform: "mqtt"
|
||||
name: "Bed LED"
|
||||
state_topic: "zigbee2mqtt/bed_led"
|
||||
availability_topic: "zigbee2mqtt/bridge/state"
|
||||
brightness: true
|
||||
color_temp: true
|
||||
xy: true
|
||||
schema: "json"
|
||||
command_topic: "zigbee2mqtt/bed_led/set"
|
||||
brightness_scale: 254
|
||||
|
||||
sensor:
|
||||
- platform: "mqtt"
|
||||
name: "Bed LED LQI"
|
||||
state_topic: "zigbee2mqtt/bed_led"
|
||||
availability_topic: "zigbee2mqtt/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
@@ -8,6 +8,15 @@ group:
|
||||
- binary_sensor.kitchen_window
|
||||
|
||||
binary_sensor:
|
||||
- platform: mqtt
|
||||
name: "Living room right window"
|
||||
state_topic: "zigbee2mqtt/living_room_right_window"
|
||||
availability_topic: "zigbee2mqtt/bridge/state"
|
||||
payload_on: false
|
||||
payload_off: true
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
- platform: mqtt
|
||||
name: "Bedroom left window"
|
||||
state_topic: "zigbee2mqtt/bedroom_left_window"
|
||||
@@ -35,20 +44,23 @@ binary_sensor:
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
living_room_right_window:
|
||||
friendly_name: Living room window
|
||||
device_class: window
|
||||
value_template: "{{ is_state('binary_sensor.living_room_right_window_on_off', 'on') }}"
|
||||
entity_id: binary_sensor.living_room_right_window_on_off
|
||||
icon_template: >
|
||||
{% if is_state('binary_sensor.living_room_right_window_on_off', 'on') %} mdi:window-open-variant
|
||||
{% else %} mdi:window-closed-variant
|
||||
{% endif %}
|
||||
|
||||
sensor:
|
||||
- platform: mqtt
|
||||
name: "Living room right window battery"
|
||||
state_topic: "zigbee2mqtt/living_room_right_window"
|
||||
availability_topic: "zigbee2mqtt/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
|
||||
- platform: mqtt
|
||||
name: "Living room right window LQI"
|
||||
state_topic: "zigbee2mqtt/living_room_right_window"
|
||||
availability_topic: "zigbee2mqtt/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
- platform: mqtt
|
||||
name: "Bedroom left window battery"
|
||||
state_topic: "zigbee2mqtt/bedroom_left_window"
|
||||
@@ -109,15 +121,3 @@ sensor:
|
||||
value_template: >-
|
||||
{% set entityStates = states | selectattr('entity_id', 'in', state_attr('group.all_windows', 'entity_id')) %}
|
||||
{{ entityStates | selectattr('state', 'eq', 'on') | list | count | int }}
|
||||
|
||||
#
|
||||
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
||||
#
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
sensor.living_room_right_window_power:
|
||||
friendly_name: Living room window battery
|
||||
|
||||
sensor.kitchen_window_power:
|
||||
friendly_name: Kitchen window battery
|
||||
|
||||
@@ -64,3 +64,5 @@ devices:
|
||||
retain: true
|
||||
'0x00124b001f6fc6a2':
|
||||
friendly_name: bed_led
|
||||
'0x00158d00040249c8':
|
||||
friendly_name: bedside_switch
|
||||
|
||||
Reference in New Issue
Block a user