mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
adaptive_lighting:
|
||||
- name: "Southern"
|
||||
lights: []
|
||||
interval: 90
|
||||
transition: 45
|
||||
initial_transition: 1
|
||||
min_brightness: 1
|
||||
max_brightness: 100
|
||||
min_color_temp: 2000
|
||||
max_color_temp: 6500
|
||||
prefer_rgb_color: false
|
||||
sleep_brightness: 1
|
||||
sleep_color_temp: 1000
|
||||
min_sunrise_time: "05:30:00"
|
||||
max_sunrise_time: "07:00:00"
|
||||
min_sunset_time: "19:00:00"
|
||||
max_sunset_time: "21:00:00"
|
||||
take_over_control: true
|
||||
detect_non_ha_changes: false
|
||||
only_once: false
|
||||
# - name: "Southern"
|
||||
# lights: []
|
||||
# interval: 90
|
||||
# transition: 45
|
||||
# initial_transition: 1
|
||||
# min_brightness: 1
|
||||
# max_brightness: 100
|
||||
# min_color_temp: 2000
|
||||
# max_color_temp: 6500
|
||||
# prefer_rgb_color: false
|
||||
# sleep_brightness: 1
|
||||
# sleep_color_temp: 1000
|
||||
# min_sunrise_time: "05:30:00"
|
||||
# max_sunrise_time: "07:00:00"
|
||||
# min_sunset_time: "19:00:00"
|
||||
# max_sunset_time: "21:00:00"
|
||||
# take_over_control: true
|
||||
# detect_non_ha_changes: false
|
||||
# only_once: false
|
||||
|
||||
- name: "Northern"
|
||||
lights: []
|
||||
interval: 90
|
||||
transition: 45
|
||||
initial_transition: 1
|
||||
min_brightness: 1
|
||||
max_brightness: 100
|
||||
min_color_temp: 2000
|
||||
max_color_temp: 6500
|
||||
prefer_rgb_color: false
|
||||
sleep_brightness: 1
|
||||
sleep_color_temp: 1000
|
||||
take_over_control: true
|
||||
detect_non_ha_changes: false
|
||||
only_once: false
|
||||
# - name: "Northern"
|
||||
# lights: []
|
||||
# interval: 90
|
||||
# transition: 45
|
||||
# initial_transition: 1
|
||||
# min_brightness: 1
|
||||
# max_brightness: 100
|
||||
# min_color_temp: 2000
|
||||
# max_color_temp: 6500
|
||||
# prefer_rgb_color: false
|
||||
# sleep_brightness: 1
|
||||
# sleep_color_temp: 1000
|
||||
# take_over_control: true
|
||||
# detect_non_ha_changes: false
|
||||
# only_once: false
|
||||
@@ -28,10 +28,10 @@ group:
|
||||
- media_player.great_room
|
||||
- media_player.kitchen
|
||||
- media_player.front_room_hub
|
||||
- media_player.girls_room_hub
|
||||
- media_player.girls_room_clock
|
||||
- media_player.boys_room_clock
|
||||
- media_player.bathroom_mini
|
||||
- media_player.ma_home_assistant_voice_097b44_media_player
|
||||
- media_player.bedroom_hub
|
||||
- media_player.computer_area_hub
|
||||
|
||||
###### INPUT SELECT ------------------------------------------
|
||||
@@ -101,7 +101,7 @@ script:
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.ma_home_assistant_voice_097b44_media_player
|
||||
{% elif is_state("input_select.google_home", "Master Bathroom") %} media_player.great_room
|
||||
{% elif is_state("input_select.google_home", "Kitchen") %} media_player.kitchen
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_hub
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_clock
|
||||
{% elif is_state("input_select.google_home", "Boys Room") %} media_player.boys_room_clock
|
||||
{% elif is_state("input_select.google_home", "Computer Area") %} media_player.computer_area_hub
|
||||
{% elif is_state("input_select.google_home", "Downstairs") %} media_player.downstairs_public
|
||||
@@ -116,7 +116,7 @@ script:
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.ma_home_assistant_voice_097b44_media_player
|
||||
{% elif is_state("input_select.google_home", "Master Bathroom") %} media_player.great_room
|
||||
{% elif is_state("input_select.google_home", "Kitchen") %} media_player.kitchen
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_hub
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_clock
|
||||
{% elif is_state("input_select.google_home", "Boys Room") %} media_player.boys_room_clock
|
||||
{% elif is_state("input_select.google_home", "Computer Area") %} media_player.computer_area_hub
|
||||
{% elif is_state("input_select.google_home", "Downstairs") %} media_player.downstairs_public
|
||||
@@ -162,10 +162,10 @@ script:
|
||||
data_template:
|
||||
entity_id: >
|
||||
{% if is_state("input_select.google_home", "Front Room") %} media_player.front_room_hub
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.ma_home_assistant_voice_097b44_media_player
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.bedroom_hub
|
||||
{% elif is_state("input_select.google_home", "Master Bathroom") %} media_player.great_room
|
||||
{% elif is_state("input_select.google_home", "Kitchen") %} media_player.kitchen
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_hub
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_clock
|
||||
{% elif is_state("input_select.google_home", "Boys Room") %} media_player.boys_room_clock
|
||||
{% elif is_state("input_select.google_home", "Computer Area") %} media_player.computer_area_hub
|
||||
{% elif is_state("input_select.google_home", "Downstairs") %} media_player.downstairs_public
|
||||
@@ -188,10 +188,10 @@ automation:
|
||||
data_template:
|
||||
entity_id: >
|
||||
{% if is_state("input_select.google_home", "Front Room") %} media_player.front_room_hub
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.ma_home_assistant_voice_097b44_media_player
|
||||
{% elif is_state("input_select.google_home", "Master Bedroom") %} media_player.bedroom_hub
|
||||
{% elif is_state("input_select.google_home", "Master Bathroom") %} media_player.great_room
|
||||
{% elif is_state("input_select.google_home", "Kitchen") %} media_player.kitchen
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_hub
|
||||
{% elif is_state("input_select.google_home", "Girls Room") %} media_player.girls_room_clock
|
||||
{% elif is_state("input_select.google_home", "Boys Room") %} media_player.boys_room_clock
|
||||
{% elif is_state("input_select.google_home", "Computer Area") %} media_player.computer_area_hub
|
||||
{% elif is_state("input_select.google_home", "Downstairs") %} media_player.downstairs_public
|
||||
|
||||
@@ -18,7 +18,7 @@ input_select:
|
||||
name: To Screen
|
||||
options:
|
||||
- Front Room Display
|
||||
- Girls Room Hub
|
||||
- Bedroom Hub
|
||||
- Computer Area Hub
|
||||
|
||||
script:
|
||||
@@ -31,8 +31,8 @@ script:
|
||||
media_player: >
|
||||
{% if is_state('input_select.cast_to_screen_dropdown', 'Front Room Display') %}
|
||||
media_player.front_room_hub
|
||||
{% elif is_state('input_select.cast_to_screen_dropdown', 'Girls Room Hub') %}
|
||||
media_player.girls_room_hub
|
||||
{% elif is_state('input_select.cast_to_screen_dropdown', 'Bedroom Hub') %}
|
||||
media_player.bedroom_hub
|
||||
{% elif is_state('input_select.cast_to_screen_dropdown', 'Computer Area Hub') %}
|
||||
media_player.computer_area_hub
|
||||
{% endif %}
|
||||
@@ -119,7 +119,7 @@ script:
|
||||
# {% if is_state('input_select.cast_to_screen_dropdown', 'Front Room Display') %}
|
||||
# media_player.front_room_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Girls Room Hub') %}
|
||||
# media_player.girls_room_hub
|
||||
# media_player.bedroom_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Computer Area Hub') %}
|
||||
# media_player.computer_area_hub
|
||||
# {% endif %}
|
||||
@@ -152,7 +152,7 @@ script:
|
||||
# {% if is_state('input_select.cast_to_screen_dropdown', 'Front Room Display') %}
|
||||
# media_player.front_room_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Girls Room Hub') %}
|
||||
# media_player.girls_room_hub
|
||||
# media_player.bedroom_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Computer Area Hub') %}
|
||||
# media_player.computer_area_hub
|
||||
# {% endif %}
|
||||
@@ -188,7 +188,7 @@ script:
|
||||
# {% if is_state('input_select.cast_to_screen_dropdown', 'Front Room Display') %}
|
||||
# media_player.front_room_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Girls Room Hub') %}
|
||||
# media_player.girls_room_hub
|
||||
# media_player.bedroom_hub
|
||||
# {% elif is_state('input_select.cast_to_screen_dropdown', 'Computer Area Hub') %}
|
||||
# media_player.computer_area_hub
|
||||
# {% endif %}
|
||||
|
||||
@@ -14,7 +14,7 @@ template:
|
||||
|
||||
- name: Master Bed Occupied
|
||||
unique_id: a5620335-43a1-47ce-bf37-ac8433f3a406
|
||||
state: "{{ is_state('binary_sensor.bed_presence_2d14a4_bed_occupied_either', 'on') }}"
|
||||
state: "{{ is_state('binary_sensor.bed_presence_c175a4_bed_occupied_either', 'on') }}"
|
||||
icon: >
|
||||
{% if is_state("binary_sensor.master_bed_occupied", "on") %}
|
||||
mdi:bed-king
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
logger:
|
||||
default: warning
|
||||
logs:
|
||||
# Adaptive Lighting Issues
|
||||
# custom_components.adaptive_lighting: debug
|
||||
|
||||
# WebRTC issues
|
||||
# custom_components.webrtc: debug
|
||||
|
||||
@@ -254,3 +254,11 @@ template:
|
||||
availability: "{{ (states('climate.thermostat') not in ['unknown', 'unavailable']) }}"
|
||||
device_class: duration
|
||||
unit_of_measurement: min
|
||||
|
||||
- name: HVAC Preset Mode
|
||||
unique_id: templatesensor_hvac_preset_mode
|
||||
state: "{{state_attr('climate.thermostat','preset_mode')}}"
|
||||
availability: "{{ (states('climate.thermostat') not in ['unknown', 'unavailable']) }}"
|
||||
device_class: enum
|
||||
attributes:
|
||||
options: "{{state_attr('climate.thermostat','preset_modes')}}"
|
||||
@@ -7,17 +7,28 @@ template:
|
||||
{{ expand(integration_entities('Z-Wave JS') )| selectattr("entity_id", "search", "node_status") |
|
||||
selectattr('state', 'in', 'alive') |
|
||||
map(attribute='entity_id')| list | count | int(default=0)}}
|
||||
attributes:
|
||||
devices: >-
|
||||
{{ expand(integration_entities('Z-Wave JS') )| selectattr("entity_id", "search", "node_status") |
|
||||
selectattr('state', 'in', 'alive') | map(attribute='entity_id')| list }}
|
||||
|
||||
- name: "Dead ZWave Devices"
|
||||
unique_id: template_sensor_failed_zwave
|
||||
icon: mdi:z-wave
|
||||
state: >-
|
||||
{{ expand(integration_entities('Z-Wave JS') )| selectattr("entity_id", "search", "node_status") |
|
||||
selectattr('state', 'in', 'alive') | map(attribute='entity_id')| list | count | int(default=0)}}
|
||||
selectattr('state', 'in', 'dead') | map(attribute='entity_id')| list | count | int(default=0)}}
|
||||
attributes:
|
||||
devices: >-
|
||||
{{ expand(integration_entities('Z-Wave JS') )| selectattr("entity_id", "search", "node_status") |
|
||||
selectattr('state', 'in', 'alive') | map(attribute='entity_id')| list }}
|
||||
selectattr('state', 'in', 'dead') | map(attribute='entity_id')| list }}
|
||||
|
||||
- name: ZWave Pending Updates
|
||||
unique_id: 6bf2876a-378a-4394-8a97-5b0603b17f2e
|
||||
state: "{{ states.update | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | select ('in',integration_entities('Z-Wave JS')) | list | count }}"
|
||||
icon: mdi:z-wave
|
||||
attributes:
|
||||
devices: "{{ states.update | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | select ('in',integration_entities('Z-Wave JS')) | list }}"
|
||||
|
||||
automation:
|
||||
- id: automation_alert_failed_zwave_nodes
|
||||
|
||||
Reference in New Issue
Block a user