mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-21 10:57:43 +00:00
Move config out of subfolder
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
sensor:
|
||||
- platform: waqi
|
||||
token: !secret waqi_key
|
||||
locations:
|
||||
- "mladost"
|
||||
- "druzhba"
|
||||
|
||||
binary_sensor:
|
||||
- platform: threshold
|
||||
entity_id: sensor.waqi_mladost_sofia
|
||||
upper: 35
|
||||
name: aqi_above_threshold
|
||||
|
||||
automation:
|
||||
- alias: Cliamate · Air Quality · Alert when opening a window
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
state: "on"
|
||||
action:
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, the air outside is pretty bad. I suggest closing the windows."
|
||||
|
||||
- alias: Cliamate · Air Quality · Alert when AQI drops
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
state: "on"
|
||||
action:
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, the air outside is getting worse, and you have some windows open. I suggest closing them."
|
||||
|
||||
- alias: Cliamate · Air Quality · Turn on purifier in bedroom on window open
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: group.bedroom_windows
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
state: "on"
|
||||
|
||||
action:
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier On · Air quality is bad outside and a window was opened"
|
||||
domain: fan
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
speed: "Speed 3"
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_speed
|
||||
data:
|
||||
option: 100
|
||||
- service: philips_airpurifier_http.set_function
|
||||
data:
|
||||
entity_id: fan.philips_airpurifier
|
||||
function: "Purification"
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
@@ -0,0 +1,246 @@
|
||||
sensor:
|
||||
- platform: min_max
|
||||
type: mean
|
||||
name: Average temperature
|
||||
entity_ids:
|
||||
- sensor.trisensor_temperature
|
||||
- sensor.bedroom_weather_temperature
|
||||
- sensor.kitchen_weather_temperature
|
||||
- sensor.hallway_weather_temperature
|
||||
- sensor.guest_bedroom_weather_temperature
|
||||
|
||||
- platform: min_max
|
||||
type: mean
|
||||
name: Average humidity
|
||||
entity_ids:
|
||||
- sensor.multisensor_6_relative_humidity
|
||||
- sensor.bedroom_weather_humidity
|
||||
- sensor.kitchen_weather_humidity
|
||||
- sensor.hallway_weather_humidity
|
||||
- sensor.guest_bedroom_weather_humidity
|
||||
|
||||
mqtt:
|
||||
sensor:
|
||||
# Bedroom weather sensor
|
||||
- name: "Bedroom weather temperature"
|
||||
state_topic: "z2m_deconz/bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Bedroom weather humidity"
|
||||
state_topic: "z2m_deconz/bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Bedroom weather pressure"
|
||||
state_topic: "z2m_deconz/bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Bedroom weather battery"
|
||||
state_topic: "z2m_deconz/bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bedroom weather LQI"
|
||||
state_topic: "z2m_deconz/bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Kitchen weather sensor
|
||||
- name: "Kitchen weather temperature"
|
||||
state_topic: "z2m_deconz/kitchen_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Kitchen weather humidity"
|
||||
state_topic: "z2m_deconz/kitchen_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Kitchen weather pressure"
|
||||
state_topic: "z2m_deconz/kitchen_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Kitchen weather battery"
|
||||
state_topic: "z2m_deconz/kitchen_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Kitchen weather LQI"
|
||||
state_topic: "z2m_deconz/kitchen_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Bathroom weather sensor
|
||||
- name: "Bathroom weather temperature"
|
||||
state_topic: "z2m_deconz/bathroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Bathroom weather humidity"
|
||||
state_topic: "z2m_deconz/bathroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Bathroom weather pressure"
|
||||
state_topic: "z2m_deconz/bathroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Bathroom weather battery"
|
||||
state_topic: "z2m_deconz/bathroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bathroom weather LQI"
|
||||
state_topic: "z2m_deconz/bathroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Hallway weather sensor
|
||||
- name: "Hallway weather temperature"
|
||||
state_topic: "z2m_deconz/hallway_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Hallway weather humidity"
|
||||
state_topic: "z2m_deconz/hallway_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Hallway weather pressure"
|
||||
state_topic: "z2m_deconz/hallway_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Hallway weather battery"
|
||||
state_topic: "z2m_deconz/hallway_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Hallway weather LQI"
|
||||
state_topic: "z2m_deconz/hallway_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Guest bedroom weather sensor
|
||||
- name: "Guest bedroom weather temperature"
|
||||
state_topic: "z2m_deconz/guest_bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Guest bedroom weather humidity"
|
||||
state_topic: "z2m_deconz/guest_bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Guest bedroom weather pressure"
|
||||
state_topic: "z2m_deconz/guest_bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Guest bedroom weather battery"
|
||||
state_topic: "z2m_deconz/guest_bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Guest bedroom weather LQI"
|
||||
state_topic: "z2m_deconz/guest_bedroom_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Terrarium weather sensor
|
||||
- name: "Terrarium weather temperature"
|
||||
state_topic: "z2m_deconz/terrarium_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Terrarium weather humidity"
|
||||
state_topic: "z2m_deconz/terrarium_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Terrarium weather pressure"
|
||||
state_topic: "z2m_deconz/terrarium_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "hPa"
|
||||
device_class: "pressure"
|
||||
value_template: "{{ value_json.pressure }}"
|
||||
- name: "Terrarium weather battery"
|
||||
state_topic: "z2m_deconz/terrarium_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Terrarium weather LQI"
|
||||
state_topic: "z2m_deconz/terrarium_weather"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
# Terrarium weather sensor
|
||||
- name: "Aqara TVOC temperature"
|
||||
state_topic: "z2m_deconz/aqara_tvoc"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "°C"
|
||||
device_class: "temperature"
|
||||
value_template: "{{ value_json.temperature }}"
|
||||
- name: "Aqara TVOC humidity"
|
||||
state_topic: "z2m_deconz/aqara_tvoc"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "humidity"
|
||||
value_template: "{{ value_json.humidity }}"
|
||||
- name: "Aqara TVOC voc"
|
||||
state_topic: "z2m_deconz/aqara_tvoc"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "ppb"
|
||||
device_class: "volatile_organic_compounds"
|
||||
value_template: "{{ value_json.voc }}"
|
||||
- name: "Aqara TVOC battery"
|
||||
state_topic: "z2m_deconz/aqara_tvoc"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Aqara TVOC LQI"
|
||||
state_topic: "z2m_deconz/aqara_tvoc"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
device_class: "signal_strength"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
@@ -0,0 +1,127 @@
|
||||
input_boolean:
|
||||
heating_enabled:
|
||||
name: Heating enabled centrally
|
||||
icon: mdi:radiator
|
||||
|
||||
input_number:
|
||||
radiators_temperature:
|
||||
name: Radiators target temperature
|
||||
unit_of_measurement: "°C"
|
||||
min: 22
|
||||
max: 27
|
||||
step: 0.5
|
||||
icon: mdi:temperature-celsius
|
||||
|
||||
group:
|
||||
all_radiators:
|
||||
name: "All Radiators"
|
||||
entities:
|
||||
- climate.living_room_radiator_mode
|
||||
- climate.bedroom_radiator_mode
|
||||
- climate.kitchen_radiator_mode
|
||||
|
||||
script:
|
||||
maybe_turn_radiator_on:
|
||||
alias: Climate · Heating · Maybe turn radiator on
|
||||
sequence:
|
||||
- and:
|
||||
- condition: state
|
||||
entity_id: input_boolean.heating_enabled
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.someone_home
|
||||
state: "on"
|
||||
- service: climate.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ entity_id }}"
|
||||
- service: climate.set_temperature
|
||||
data_template:
|
||||
entity_id: "{{ entity_id }}"
|
||||
temperature: "{{ states('input_number.radiators_temperature') | int | default(25) }}"
|
||||
|
||||
toggle_radiator:
|
||||
alias: Climate · Heating · Toggle radiator
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: "{{ is_state(entity_id, 'off') }}"
|
||||
sequence:
|
||||
- service: script.maybe_turn_radiator_on
|
||||
data_template:
|
||||
entity_id: "{{ entity_id }}"
|
||||
default:
|
||||
- service: climate.turn_off
|
||||
data_template:
|
||||
entity_id: "{{ entity_id }}"
|
||||
|
||||
turn_on_all_radiators:
|
||||
alias: Climate · Heating · Turn on all radiators
|
||||
sequence:
|
||||
- and:
|
||||
- condition: state
|
||||
entity_id: input_boolean.heating_enabled
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.someone_home
|
||||
state: "on"
|
||||
- service: script.maybe_turn_radiator_on
|
||||
data:
|
||||
entity_id: climate.living_room_radiator_mode
|
||||
- service: script.maybe_turn_radiator_on
|
||||
data:
|
||||
entity_id: climate.bedroom_radiator_mode
|
||||
- service: script.maybe_turn_radiator_on
|
||||
data:
|
||||
entity_id: climate.kitchen_radiator_mode
|
||||
|
||||
automation:
|
||||
- alias: Climate · Heating · Turn on all radiators at 5 am
|
||||
trigger:
|
||||
platform: time
|
||||
at: "05:00:00"
|
||||
action:
|
||||
- service: script.turn_on_all_radiators
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate module · "
|
||||
message: "Heating On · All rooms · 5 AM"
|
||||
domain: climate
|
||||
|
||||
- alias: Climate · Heating · Link living room radiator to windows
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.living_room_right_window
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.living_room_right_window
|
||||
state: "on"
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: climate.living_room_radiator_mode
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: climate.turn_off
|
||||
entity_id: climate.living_room_radiator_mode
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate module · "
|
||||
message: "Heating Off · Living room · Window opened"
|
||||
domain: climate
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.living_room_right_window
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: climate.living_room_radiator_mode
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: script.maybe_turn_radiator_on
|
||||
data:
|
||||
entity_id: climate.living_room_radiator_mode
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate module · "
|
||||
message: "Heating On · Living room · Window closed"
|
||||
domain: climate
|
||||
@@ -0,0 +1,48 @@
|
||||
# https://www.home-assistant.io/integrations/weather.darksky
|
||||
weather:
|
||||
- platform: darksky
|
||||
api_key: !secret darksky_key
|
||||
mode: daily
|
||||
|
||||
sensor:
|
||||
- platform: darksky
|
||||
api_key: !secret darksky_key
|
||||
scan_interval: "00:15:00"
|
||||
forecast:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- 4
|
||||
- 5
|
||||
- 6
|
||||
monitored_conditions:
|
||||
- summary
|
||||
- minutely_summary
|
||||
- hourly_summary
|
||||
- daily_summary
|
||||
- precip_type
|
||||
- precip_intensity
|
||||
- precip_intensity_max
|
||||
- precip_probability
|
||||
- precip_accumulation
|
||||
- temperature
|
||||
- temperature_high
|
||||
- temperature_low
|
||||
- apparent_temperature
|
||||
- apparent_temperature_high
|
||||
- apparent_temperature_low
|
||||
- wind_speed
|
||||
- wind_gust
|
||||
- wind_bearing
|
||||
- cloud_cover
|
||||
- dew_point
|
||||
- visibility
|
||||
- icon
|
||||
- humidity
|
||||
- pressure
|
||||
- ozone
|
||||
- uv_index
|
||||
- nearest_storm_distance
|
||||
- nearest_storm_bearing
|
||||
- alerts
|
||||
@@ -0,0 +1,114 @@
|
||||
group:
|
||||
all_windows:
|
||||
name: All windows
|
||||
entities:
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
- binary_sensor.kitchen_window
|
||||
|
||||
bedroom_windows:
|
||||
name: Bedroom windows
|
||||
entities:
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
|
||||
mqtt:
|
||||
binary_sensor:
|
||||
- name: "Living room right window"
|
||||
state_topic: "z2m_deconz/living_room_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
payload_on: false
|
||||
payload_off: true
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
- name: "Bedroom left window"
|
||||
state_topic: "z2m_deconz/bedroom_left_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
payload_on: false
|
||||
payload_off: true
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
- name: "Bedroom right window"
|
||||
state_topic: "z2m_deconz/bedroom_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
payload_on: false
|
||||
payload_off: true
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
- name: "Kitchen window"
|
||||
state_topic: "z2m_deconz/kitchen_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
payload_on: false
|
||||
payload_off: true
|
||||
value_template: "{{ value_json.contact }}"
|
||||
device_class: "window"
|
||||
|
||||
sensor:
|
||||
- name: "Living room right window battery"
|
||||
state_topic: "z2m_deconz/living_room_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
|
||||
- name: "Living room right window LQI"
|
||||
state_topic: "z2m_deconz/living_room_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
- name: "Bedroom left window battery"
|
||||
state_topic: "z2m_deconz/bedroom_left_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
|
||||
- name: "Bedroom left window LQI"
|
||||
state_topic: "z2m_deconz/bedroom_left_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
- name: "Bedroom right window battery"
|
||||
state_topic: "z2m_deconz/bedroom_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
|
||||
- name: "Bedroom right window LQI"
|
||||
state_topic: "z2m_deconz/bedroom_right_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
- name: "Kitchen window battery"
|
||||
state_topic: "z2m_deconz/kitchen_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
|
||||
- name: "Kitchen window LQI"
|
||||
state_topic: "z2m_deconz/kitchen_window"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
open_window_count:
|
||||
friendly_name: Open window count
|
||||
value_template: >-
|
||||
{% set entityStates = states | selectattr('entity_id', 'in', state_attr('group.all_windows', 'entity_id')) %}
|
||||
{{ entityStates | selectattr('state', 'eq', 'on') | list | count | int }}
|
||||
Reference in New Issue
Block a user