Refactor climate config

This commit is contained in:
2020-06-01 22:51:14 +03:00
parent aec58777eb
commit b164b52041
3 changed files with 62 additions and 24 deletions
+22 -6
View File
@@ -1,3 +1,12 @@
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
binary_sensor:
- platform: template
sensors:
@@ -41,12 +50,19 @@ binary_sensor:
{% else %} mdi:window-closed-variant
{% endif %}
group:
all_windows:
name: All windows
entities:
- binary_sensor.living_room_right_window_on_off
- binary_sensor.bedroom_right_window_on_off
sensor:
- platform: template
sensors:
open_window_count:
entity_id:
- binary_sensor.living_room_right_window
- binary_sensor.bedroom_left_window
- binary_sensor.bedroom_right_window
- binary_sensor.kitchen_window
friendly_name: Open window count
value_template: >-
{{ states | selectattr('entity_id', 'in', state_attr('group.all_windows', 'entity_id')) | selectattr('state', 'eq', 'on') | list | count | int }}
#
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────