Update template sensor definitions to current standard, close #109

This commit is contained in:
2023-08-25 18:29:12 -04:00
parent 11d18595b0
commit ba0a90a990
20 changed files with 2859 additions and 2972 deletions

View File

@ -17,12 +17,11 @@ scene:
token: !secret lifx_token
input_boolean: !include input_boolean.yaml
binary_sensor: !include binary_sensor.yaml
sensor: !include_dir_merge_list sensors
switch: !include switches.yaml
input_select: !include input_select.yaml
input_text: !include input_text.yaml
input_datetime: !include input_datetime.yaml
template: !include template.yaml
template: !include_dir_merge_list sensors
input_number: !include input_number.yaml
frontend:

View File

@ -1,50 +1,3 @@
sensor:
- platform: template
sensors:
master_bedroom_current_temp:
friendly_name: "Master Bedroom Current Temp"
unique_id: 40c6b591-09d3-45cd-8cab-9838517cc08a
value_template: "{{ state_attr('climate.master_bedroom_aircon','current_temperature') | float }}"
availability_template: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
master_bedroom_outdoor_temp:
friendly_name: "Master Bedroom Outdoor Temp"
unique_id: 1a79ac59-0faf-4de5-b546-5d6d5e151dd6
value_template: "{{ state_attr('climate.master_bedroom_aircon','outdoor_temperature') | float }}"
availability_template: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
master_bedroom_target_temp:
friendly_name: "Master Bedroom Target Temp"
unique_id: 2ce31844-b115-42b8-8213-feccf24e236c
value_template: "{{ state_attr('climate.master_bedroom_aircon','temperature') | float }}"
availability_template: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
master_bedroom_aircon_eco_mode:
friendly_name: "Master Bedroom Eco Mode"
unique_id: edf36e23-adcf-4506-80eb-a14f4ea2fce0
value_template: "{{ is_state_attr('climate.master_bedroom_aircon','preset_mode','eco') }}"
icon_template: >-
{% if is_state_attr('climate.master_bedroom_aircon','preset_mode','eco') %}
mdi:home-lightning-bolt
{% else %}
mdi:home-lightning-bolt-outline
{% endif %}
availability_template: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
master_bedroom_aircon_fan_mode:
friendly_name: "Master Bedroom Aircon Fan Mode"
unique_id: c0e4f9ba-0c6c-4673-9a75-13f253f2f2e8
value_template: "{{ state_attr('climate.master_bedroom_aircon','fan_mode') }}"
icon_template: >
{% if is_state_attr('climate.master_bedroom_aircon','fan_mode','Auto') %}
mdi:fan-auto
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','Low') %}
mdi:fan-speed-1
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','Medium') %}
mdi:fan-speed-2
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','High') %}
mdi:fan-speed-3
{% else %}
mdi:fan-off
{% endif %}
availability_template: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
template:
- binary_sensor:
- name: Emma Aircon - Compressor
@ -66,6 +19,45 @@ template:
- name: Kallen Fan - Separate Schedule
unique_id: 3f243861-6a1f-412f-b9e3-933b54793b08
state: "{{ states('input_datetime.kallen_fan') != states('input_datetime.kallen_bedtime') }}"
- sensor:
- name: "Master Bedroom Current Temp"
unique_id: 40c6b591-09d3-45cd-8cab-9838517cc08a
state: "{{ state_attr('climate.master_bedroom_aircon','current_temperature') | float }}"
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Outdoor Temp"
unique_id: 1a79ac59-0faf-4de5-b546-5d6d5e151dd6
state: "{{ state_attr('climate.master_bedroom_aircon','outdoor_temperature') | float }}"
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Target Temp"
unique_id: 2ce31844-b115-42b8-8213-feccf24e236c
state: "{{ state_attr('climate.master_bedroom_aircon','temperature') | float }}"
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Eco Mode"
unique_id: edf36e23-adcf-4506-80eb-a14f4ea2fce0
state: "{{ is_state_attr('climate.master_bedroom_aircon','preset_mode','eco') }}"
icon: >-
{% if is_state_attr('climate.master_bedroom_aircon','preset_mode','eco') %}
mdi:home-lightning-bolt
{% else %}
mdi:home-lightning-bolt-outline
{% endif %}
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Aircon Fan Mode"
unique_id: c0e4f9ba-0c6c-4673-9a75-13f253f2f2e8
state: "{{ state_attr('climate.master_bedroom_aircon','fan_mode') }}"
icon: >
{% if is_state_attr('climate.master_bedroom_aircon','fan_mode','Auto') %}
mdi:fan-auto
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','Low') %}
mdi:fan-speed-1
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','Medium') %}
mdi:fan-speed-2
{% elif is_state_attr('climate.master_bedroom_aircon','fan_mode','High') %}
mdi:fan-speed-3
{% else %}
mdi:fan-off
{% endif %}
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
input_boolean:
master_bedroom_climate_protocol:

File diff suppressed because it is too large Load Diff

121
packages/history_stats.yaml Normal file
View File

@ -0,0 +1,121 @@
sensor:
- platform: history_stats
name: Basement TV Time
entity_id: media_player.basement_tv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Basement TV Chromecast Time
entity_id: media_player.basement_tv_chromecast
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Living Room TV Time
entity_id: media_player.living_room_tv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Living Room TV Chromecast Time
entity_id: media_player.living_room_tv_chromecast
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom TV Time
entity_id: media_player.master_bedroom_firetv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Outside Lights
entity_id: light.outside_lights
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Windows Open Time
entity_id: sensor.windows_open
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Doors Open Time
entity_id: sensor.doors_open
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Emma A/C Compressor Time
entity_id: binary_sensor.emma_aircon_compressor
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Emma A/C Fan Time
entity_id: binary_sensor.emma_aircon_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom A/C Compressor Time
entity_id: binary_sensor.master_bedroom_aircon_compressor
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom A/C Fan Time
entity_id: binary_sensor.master_bedroom_aircon_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom Fan Time
entity_id: fan.master_bedroom_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Kallen Fan Time
entity_id: fan.kallen_bedroom_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Basement Fan Time
entity_id: fan.basement_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24

View File

@ -78,6 +78,21 @@ input_datetime:
has_time: true
icon: mdi:alarm
sensor:
- platform: rest
name: Kallen Tasks
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
params:
project_id: 2285969005
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
json_attributes:
- project
- items
scan_interval: 30
automation:
- id: 67fbdb66-b94b-4351-86de-a388d601e93c
alias: Kallen Meds Handler

View File

@ -303,135 +303,6 @@ input_text:
tina_desk_selected_scene:
name: Tina Desk Selected Scene
sensor:
- platform: template
sensors:
basement_studio_lights_brightness_actual:
friendly_name: "Basement Studio Lights - Brightness Actual"
unique_id: dee4dc84-a6a0-4150-903e-5b8bd436d962
value_template: >
{% from 'lighting.jinja' import get_brightness_pct %}
{{ get_brightness_pct('light.basement_studio_lights') }}
availability_template: "{{ is_state('light.basement_studio_lights','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
basement_studio_lights_brightness_intended:
friendly_name: "Basement Studio Lights - Brightness Intended"
unique_id: 3542077f-24c6-460c-a73f-fe7bc8413b81
value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','brightness_pct') | float | round(2) }}"
availability_template: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
basement_studio_lights_colortemp_actual:
friendly_name: "Basement Studio Lights - Colortemp Actual"
unique_id: 93cb2a2f-c8a7-44bf-813f-26ce349a072f
value_template: "{{ state_attr('light.basement_studio_lights','color_temp_kelvin') | int }}"
availability_template: "{{ is_state('light.basement_studio_lights','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
basement_studio_lights_colortemp_intended:
friendly_name: "Basement Studio Lights - Colortemp Intended"
unique_id: 85d4b063-bae8-43c2-9fea-35820b13f26f
value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','color_temp_kelvin') | int }}"
availability_template: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
basement_studio_lights_brightness_diff:
friendly_name: "Basement Studio Lights - Brightness Diff"
unique_id: ab24a44c-6c6b-4ae9-b256-52592b0503bb
value_template: >
{% set current = states('sensor.basement_studio_lights_brightness_actual') | float %}
{% set intended = states('sensor.basement_studio_lights_brightness_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability_template: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
basement_studio_lights_colortemp_diff:
friendly_name: "Basement Studio Lights - Colortemp Diff"
unique_id: fecf7d42-9a5c-471e-9af3-e1a330a6ae3e
value_template: >
{% set current = states('sensor.basement_studio_lights_colortemp_actual') | float %}
{% set intended = states('sensor.basement_studio_lights_colortemp_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability_template: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
living_room_lights_brightness_actual:
friendly_name: "Living Room Lights - Brightness Actual"
unique_id: e557022a-184f-4111-bb6a-6c0869cce42c
value_template: >
{% from 'lighting.jinja' import get_brightness_pct %}
{{ get_brightness_pct('light.living_room_lights') }}
availability_template: "{{ is_state('light.living_room_lights','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
living_room_lights_brightness_intended:
friendly_name: "Living Room Lights - Brightness Intended"
unique_id: a758742f-6724-4920-a9d1-325fe4f02664
value_template: "{{ state_attr('switch.adaptive_lighting_living_room','brightness_pct') | float | round(2) }}"
availability_template: "{{ is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
living_room_lights_colortemp_actual:
friendly_name: "Living Room Lights - Colortemp Actual"
unique_id: dbe08826-e113-4474-bbca-60d3c32a4b65
value_template: "{{ state_attr('light.living_room_lights','color_temp_kelvin') | int }}"
availability_template: "{{ is_state('light.living_room_lights','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
living_room_lights_colortemp_intended:
friendly_name: "Living Room Lights - Colortemp Intended"
unique_id: 8b974c03-ab5b-4b89-97bf-afee78fa1a40
value_template: "{{ state_attr('switch.adaptive_lighting_living_room','color_temp_kelvin') | int }}"
availability_template: "{{ is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
living_room_lights_brightness_diff:
friendly_name: "Living Room Lights - Brightness Diff"
unique_id: 05f911d3-3b6a-4ca2-8181-5365707b2456
value_template: >
{% set current = states('sensor.living_room_lights_brightness_actual') | float %}
{% set intended = states('sensor.living_room_lights_brightness_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability_template: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: '%'
icon_template: mdi:brightness-percent
living_room_lights_colortemp_diff:
friendly_name: "Living Room Lights - Colortemp Diff"
unique_id: d8fcaa26-d3dc-48d8-b4b9-9e701a1506a8
value_template: >
{% set current = states('sensor.living_room_lights_colortemp_actual') | float %}
{% set intended = states('sensor.living_room_lights_colortemp_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability_template: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: 'K'
icon_template: mdi:thermometer-lines
basement_led_strip_resets:
friendly_name: "Basement LED Strip Resets"
unique_id: 0d016f09-a89b-4616-83b7-934580612d00
value_template: "{{ states('input_number.basement_led_strip_resets') | int }}"
unit_of_measurement: 'resets'
icon_template: mdi:restore
tina_desk_scene:
friendly_name: Tina Desk Scene
unique_id: 0d94ba35-bc9d-40a2-aa77-776d26bc3538
value_template: >
{% if is_state('input_boolean.give_me_darkness','on') %}
Night Mode
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
Evening Mode
{% else %}
Day Mode
{% endif %}
icon_template: >
{% if is_state('input_boolean.give_me_darkness','on') %}
mdi:weather-night
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
mdi:lightbulb-night
{% else %}
mdi:lightbulb
{% endif %}
template:
- binary_sensor:
- name: Basement Lights Sync Issue
@ -532,6 +403,118 @@ template:
{% endif %}
device_class: problem
delay_on: "00:00:10"
- sensor:
- name: "Basement Studio Lights - Brightness Actual"
unique_id: dee4dc84-a6a0-4150-903e-5b8bd436d962
state: >
{% from 'lighting.jinja' import get_brightness_pct %}
{{ get_brightness_pct('light.basement_studio_lights') }}
availability: "{{ is_state('light.basement_studio_lights','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Basement Studio Lights - Brightness Intended"
unique_id: 3542077f-24c6-460c-a73f-fe7bc8413b81
state: "{{ state_attr('switch.adaptive_lighting_basement_studio','brightness_pct') | float | round(2) }}"
availability: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Basement Studio Lights - Colortemp Actual"
unique_id: 93cb2a2f-c8a7-44bf-813f-26ce349a072f
state: "{{ state_attr('light.basement_studio_lights','color_temp_kelvin') | int }}"
availability: "{{ is_state('light.basement_studio_lights','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Basement Studio Lights - Colortemp Intended"
unique_id: 85d4b063-bae8-43c2-9fea-35820b13f26f
state: "{{ state_attr('switch.adaptive_lighting_basement_studio','color_temp_kelvin') | int }}"
availability: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Basement Studio Lights - Brightness Diff"
unique_id: ab24a44c-6c6b-4ae9-b256-52592b0503bb
state: >
{% set current = states('sensor.basement_studio_lights_brightness_actual') | float %}
{% set intended = states('sensor.basement_studio_lights_brightness_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Basement Studio Lights - Colortemp Diff"
unique_id: fecf7d42-9a5c-471e-9af3-e1a330a6ae3e
state: >
{% set current = states('sensor.basement_studio_lights_colortemp_actual') | float %}
{% set intended = states('sensor.basement_studio_lights_colortemp_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Living Room Lights - Brightness Actual"
unique_id: e557022a-184f-4111-bb6a-6c0869cce42c
state: >
{% from 'lighting.jinja' import get_brightness_pct %}
{{ get_brightness_pct('light.living_room_lights') }}
availability: "{{ is_state('light.living_room_lights','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Living Room Lights - Brightness Intended"
unique_id: a758742f-6724-4920-a9d1-325fe4f02664
state: "{{ state_attr('switch.adaptive_lighting_living_room','brightness_pct') | float | round(2) }}"
availability: "{{ is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Living Room Lights - Colortemp Actual"
unique_id: dbe08826-e113-4474-bbca-60d3c32a4b65
state: "{{ state_attr('light.living_room_lights','color_temp_kelvin') | int }}"
availability: "{{ is_state('light.living_room_lights','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Living Room Lights - Colortemp Intended"
unique_id: 8b974c03-ab5b-4b89-97bf-afee78fa1a40
state: "{{ state_attr('switch.adaptive_lighting_living_room','color_temp_kelvin') | int }}"
availability: "{{ is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Living Room Lights - Brightness Diff"
unique_id: 05f911d3-3b6a-4ca2-8181-5365707b2456
state: >
{% set current = states('sensor.living_room_lights_brightness_actual') | float %}
{% set intended = states('sensor.living_room_lights_brightness_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: '%'
icon: mdi:brightness-percent
- name: "Living Room Lights - Colortemp Diff"
unique_id: d8fcaa26-d3dc-48d8-b4b9-9e701a1506a8
state: >
{% set current = states('sensor.living_room_lights_colortemp_actual') | float %}
{% set intended = states('sensor.living_room_lights_colortemp_intended') | float %}
{{ (current - intended) | float | round(2) }}
availability: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}"
unit_of_measurement: 'K'
icon: mdi:thermometer-lines
- name: "Basement LED Strip Resets"
unique_id: 0d016f09-a89b-4616-83b7-934580612d00
state: "{{ states('input_number.basement_led_strip_resets') | int }}"
unit_of_measurement: 'resets'
icon: mdi:restore
- name: Tina Desk Scene
unique_id: 0d94ba35-bc9d-40a2-aa77-776d26bc3538
state: >
{% if is_state('input_boolean.give_me_darkness','on') %}
Night Mode
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
Evening Mode
{% else %}
Day Mode
{% endif %}
icon: >
{% if is_state('input_boolean.give_me_darkness','on') %}
mdi:weather-night
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
mdi:lightbulb-night
{% else %}
mdi:lightbulb
{% endif %}
switch:
- platform: animated_scenes

View File

@ -153,6 +153,9 @@ binary_sensor:
template:
- binary_sensor:
- name: People Present
state: >
{{ is_state('person.tony_stork', 'home') or is_state('person.christina_stork', 'home') }}
- name: "Tony Home"
unique_id: 4f0d8c3d-dc49-4b7a-a1fc-5d286b4a954d
state: "{{ is_state('device_tracker.tony_s_iphone', 'home') or is_state('device_tracker.life360_tony_stork','home') }}"

View File

@ -85,155 +85,150 @@ template:
off
{% endif %}
icon: mdi:school
sensor:
- platform: template
sensors:
school_start_days2go:
unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_first_day') }}
attribute_templates:
date: "{{ state_attr('input_datetime.school_first_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
school_end_days2go:
unique_id: 589c44ec-7e16-4c72-a264-cdf54de409a9
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_last_day') | int }}
attribute_templates:
date: "{{ state_attr('input_datetime.school_last_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
vacation_days2go:
unique_id: f1628d87-e58a-4d1a-8a49-a71f0a9ed3e5
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{% if state_attr('calendar.vacation', 'start_time') %}
{{ count_the_days('calendar.vacation','start_time') }}
{% else %}
999
{% endif %}
unit_of_measurement: 'Days'
thanksgiving_break_days2go:
unique_id: 2381e9de-407b-4304-b09a-448c169bbaf2
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.thanksgiving_break_start') }}
attribute_templates:
date: "{{ state_attr('input_datetime.thanksgiving_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
christmas_break_days2go:
unique_id: 851700f7-c593-4db8-ba4f-001cbffcfc4a
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.christmas_break_start') }}
attribute_templates:
date: "{{ state_attr('input_datetime.christmas_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
spring_break_days2go:
unique_id: cec6e687-8999-4548-991c-02ba546335f5
value_template: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.spring_break_start') }}
attribute_templates:
date: "{{ state_attr('input_datetime.spring_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
kallen_lunch_menu_week:
friendly_name: Lunch Menu Week
unique_id: 62ba9dcb-3cd3-4875-8e6f-86bebf542c37
value_template: >
{% if is_state('calendar.elementary_school_lunch','on') %}
{{ state_attr('calendar.elementary_school_lunch','message') }}
{% else %}
No Menu
{% endif %}
icon_template: >
{% if is_state_attr('calendar.elementary_school_lunch','message','First Menu') %}
mdi:numeric-1-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Second Menu') %}
mdi:numeric-2-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Third Menu') %}
mdi:numeric-3-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Fourth Menu') %}
mdi:numeric-4-circle
{% else %}
mdi:calendar-end
{% endif %}
kallen_lunch_menu_items:
friendly_name: Lunch Menu Items
unique_id: a2cb62d7-ae9f-4bab-81c1-81f2006391b2
icon_template: >
- sensor:
- name: School Start Days2go
unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9
state: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_first_day') }}
attributes:
date: "{{ state_attr('input_datetime.school_first_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
- name: School End Days2go
unique_id: 589c44ec-7e16-4c72-a264-cdf54de409a9
state: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_last_day') | int }}
attributes:
date: "{{ state_attr('input_datetime.school_last_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
- name: Vacation Days2go
unique_id: f1628d87-e58a-4d1a-8a49-a71f0a9ed3e5
state: >
{% from 'easy_time.jinja' import count_the_days %}
{% if state_attr('calendar.vacation', 'start_time') %}
{{ count_the_days('calendar.vacation','start_time') }}
{% else %}
999
{% endif %}
unit_of_measurement: 'Days'
- name: Thanksgiving Break Days2go
unique_id: 2381e9de-407b-4304-b09a-448c169bbaf2
state: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.thanksgiving_break_start') }}
attributes:
date: "{{ state_attr('input_datetime.thanksgiving_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
- name: Christmas Break Days2go
unique_id: 851700f7-c593-4db8-ba4f-001cbffcfc4a
state: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.christmas_break_start') }}
attributes:
date: "{{ state_attr('input_datetime.christmas_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
- name: Spring Break Days2go
unique_id: cec6e687-8999-4548-991c-02ba546335f5
state: >
{% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.spring_break_start') }}
attributes:
date: "{{ state_attr('input_datetime.spring_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days'
- name: Lunch Menu Week
unique_id: 62ba9dcb-3cd3-4875-8e6f-86bebf542c37
state: >
{% if is_state('calendar.elementary_school_lunch','on') %}
{{ state_attr('calendar.elementary_school_lunch','message') }}
{% else %}
No Menu
{% endif %}
icon: >
{% if is_state_attr('calendar.elementary_school_lunch','message','First Menu') %}
mdi:numeric-1-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Second Menu') %}
mdi:numeric-2-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Third Menu') %}
mdi:numeric-3-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Fourth Menu') %}
mdi:numeric-4-circle
{% else %}
mdi:calendar-end
{% endif %}
- name: Lunch Menu Items
unique_id: a2cb62d7-ae9f-4bab-81c1-81f2006391b2
icon: >
{% set week = states('sensor.kallen_lunch_menu_week') %}
{% if week == 'First Menu' %}
mdi:numeric-1-circle
{% elif week == 'Second Menu' %}
mdi:numeric-2-circle
{% elif week == 'Third Menu' %}
mdi:numeric-3-circle
{% elif week == 'Fourth Menu' %}
mdi:numeric-4-circle
{% else %}
mdi:calendar-end
{% endif %}
state: >
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% set week = states('sensor.kallen_lunch_menu_week') %}
{% set dow = now().strftime('%A') %}
{% if week == 'First Menu' %}
mdi:numeric-1-circle
{% elif week == 'Second Menu' %}
mdi:numeric-2-circle
{% elif week == 'Third Menu' %}
mdi:numeric-3-circle
{% elif week == 'Fourth Menu' %}
mdi:numeric-4-circle
{% else %}
mdi:calendar-end
{% endif %}
value_template: >
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% set week = states('sensor.kallen_lunch_menu_week') %}
{% set dow = now().strftime('%A') %}
{% if week == 'First Menu' %}
{% if dow == 'Monday' %}
Sloppy Joe, tomatoes or dip, green beans, mixed fruit, and milk.
{% elif dow == 'Tuesday' %}
Beef, taco salad, refried beans, spanish rice, peaches, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, pulled pork, steamed broccoli, carrots, apples, and milk.
{% elif dow == 'Thursday' %}
Beef Stroganoff, steamed cauliflower, cucumbers, fresh fruit, and milk.
{% elif dow == 'Friday' %}
Hamburger, spinach salad, oven potatoes, applesauce, and milk.
{% endif %}
{% elif week == 'Second Menu' %}
{% if dow == 'Monday' %}
Popcorn chicken, mashed potatoes, corn, pears, bread, and milk.
{% elif dow == 'Tuesday' %}
Lasagna, garlic bread, celery, tomatoes, apple crisp, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, hot ham and cheese, spinach salad, broccoli, fresh fruit, and milk.
{% elif dow == 'Thursday' %}
Turkey and noodles, mashed potatoes, carrots, peaches, bread, and milk.
{% elif down == 'Friday' %}
Hot dog with chili sauce, oven potatoes, backed beans, mixed fruit, and milk.
{% endif %}
{% elif week == 'Third Menu' %}
{% if dow == 'Monday' %}
Bosco sticks with pizza sauce, black bean salad, oven potatoes, peach crisp, and milk.
{% elif dow == 'Tuesday' %}
Toasted cheese, tomato soup, mixed vegetables, fresh fruit, treat, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, popcorn chicken, mashed potatoes, carrots, apples, corn bread, and milk.
{% elif dow == 'Thursday' %}
Spaghetti, broccoli, green beans, fresh fruit, breadsticks, and milk.
{% elif dow == 'Friday' %}
Cold cut sub, spinach salad, tomatoes, pears, and milk.
{% endif %}
{% elif week == 'Fourth Menu' %}
{% if dow == 'Monday' %}
Chicken patty, baked beans, celery, mixed fruit, and milk.
{% elif dow == 'Tuesday' %}
Omelet or french toast, sausage, hash browns, tomatoes, orange, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, hamburger, green beans, cauliflower, apple crisp, and milk.
{% elif dow == 'Thursday' %}
Mac and cheese, steamed broccoli, carrots, pears, bread, and milk.
{% elif dow == 'Friday' %}
Hot dog, spinach salad, oven potatoes, fresh fruit, and milk.
{% endif %}
{% else %}
No menu for the current day.
{% if dow == 'Monday' %}
Sloppy Joe, tomatoes or dip, green beans, mixed fruit, and milk.
{% elif dow == 'Tuesday' %}
Beef, taco salad, refried beans, spanish rice, peaches, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, pulled pork, steamed broccoli, carrots, apples, and milk.
{% elif dow == 'Thursday' %}
Beef Stroganoff, steamed cauliflower, cucumbers, fresh fruit, and milk.
{% elif dow == 'Friday' %}
Hamburger, spinach salad, oven potatoes, applesauce, and milk.
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% elif week == 'Second Menu' %}
{% if dow == 'Monday' %}
Popcorn chicken, mashed potatoes, corn, pears, bread, and milk.
{% elif dow == 'Tuesday' %}
Lasagna, garlic bread, celery, tomatoes, apple crisp, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, hot ham and cheese, spinach salad, broccoli, fresh fruit, and milk.
{% elif dow == 'Thursday' %}
Turkey and noodles, mashed potatoes, carrots, peaches, bread, and milk.
{% elif down == 'Friday' %}
Hot dog with chili sauce, oven potatoes, backed beans, mixed fruit, and milk.
{% endif %}
{% elif week == 'Third Menu' %}
{% if dow == 'Monday' %}
Bosco sticks with pizza sauce, black bean salad, oven potatoes, peach crisp, and milk.
{% elif dow == 'Tuesday' %}
Toasted cheese, tomato soup, mixed vegetables, fresh fruit, treat, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, popcorn chicken, mashed potatoes, carrots, apples, corn bread, and milk.
{% elif dow == 'Thursday' %}
Spaghetti, broccoli, green beans, fresh fruit, breadsticks, and milk.
{% elif dow == 'Friday' %}
Cold cut sub, spinach salad, tomatoes, pears, and milk.
{% endif %}
{% elif week == 'Fourth Menu' %}
{% if dow == 'Monday' %}
Chicken patty, baked beans, celery, mixed fruit, and milk.
{% elif dow == 'Tuesday' %}
Omelet or french toast, sausage, hash browns, tomatoes, orange, and milk.
{% elif dow == 'Wednesday' %}
Optionally, Papa Johns Pizza. Otherwise, hamburger, green beans, cauliflower, apple crisp, and milk.
{% elif dow == 'Thursday' %}
Mac and cheese, steamed broccoli, carrots, pears, bread, and milk.
{% elif dow == 'Friday' %}
Hot dog, spinach salad, oven potatoes, fresh fruit, and milk.
{% endif %}
{% else %}
No menu for the current day.
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
# - platform: rest

View File

@ -126,96 +126,91 @@ alarm_control_panel:
who: living_room
call_security_not_armed: 1
sensor:
- platform: template
sensors:
windows_open:
friendly_name: "Windows"
unique_id: 780770d2-8b5a-4c96-aee4-459281cc3471
unit_of_measurement: 'open'
value_template: >-
{% set windows = [
states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window,
states.binary_sensor.mud_room_window,
states.binary_sensor.stairway_window_lower,
] %}
{% set windows_open = windows | selectattr('state','eq','on') | list | count %}
{{ windows_open }}
icon_template: >-
{% set windows = [
states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window,
states.binary_sensor.mud_room_window,
states.binary_sensor.stairway_window_lower,
] %}
{% set windows_open = windows | selectattr('state','eq','on') | list | count %}
{% if windows_open == 0 %}
mdi:window-closed
{% else %}
mdi:window-open
{% endif %}
doors_open: #! This sensor is only for exterior doors, and interior doors that are NOT excluded from security protocols
friendly_name: "Doors"
unique_id: 61b1a98a-51a4-4faa-947d-7883de2430c0
unit_of_measurement: 'open'
value_template: >-
{% set doors = [
states.binary_sensor.front_door,
states.binary_sensor.back_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }}
icon_template: >-
{% set doors = [
states.binary_sensor.front_door,
states.binary_sensor.back_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{% if doors_open == 0 %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
interior_doors_open: # This sensor is not used for security purposes, only for information
friendly_name: "Interior Doors"
unique_id: 772aa056-881a-4778-ba5b-19e46afc107a
unit_of_measurement: 'open'
value_template: >-
{% set doors = [
states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }}
icon_template: >-
{% set doors = [
states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{% if doors_open == 0 %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
total_faults:
friendly_name: Faults
unique_id: 1629a83a-a46c-4041-9e49-8e54c5195388
unit_of_measurement: 'open'
value_template: >-
{% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %}
{{ doors_open + windows_open }}
icon_template: >-
{% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %}
{% set faults = ( doors_open + windows_open ) %}
{% if faults == 0 %}
mdi:shield-home
{% else %}
mdi:shield-off
{% endif %}
template:
- sensor:
- name: "Windows"
unique_id: 780770d2-8b5a-4c96-aee4-459281cc3471
unit_of_measurement: 'open'
state: >-
{% set windows = [
states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window,
states.binary_sensor.mud_room_window,
states.binary_sensor.stairway_window_lower,
] %}
{% set windows_open = windows | selectattr('state','eq','on') | list | count %}
{{ windows_open }}
icon: >-
{% set windows = [
states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window,
states.binary_sensor.mud_room_window,
states.binary_sensor.stairway_window_lower,
] %}
{% set windows_open = windows | selectattr('state','eq','on') | list | count %}
{% if windows_open == 0 %}
mdi:window-closed
{% else %}
mdi:window-open
{% endif %}
- name: "Doors" #! This sensor is only for exterior doors, and interior doors that are NOT excluded from security protocols
unique_id: 61b1a98a-51a4-4faa-947d-7883de2430c0
unit_of_measurement: 'open'
state: >-
{% set doors = [
states.binary_sensor.front_door,
states.binary_sensor.back_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }}
icon: >-
{% set doors = [
states.binary_sensor.front_door,
states.binary_sensor.back_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{% if doors_open == 0 %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
- name: "Interior Doors" # This sensor is not used for security purposes, only for information
unique_id: 772aa056-881a-4778-ba5b-19e46afc107a
unit_of_measurement: 'open'
state: >-
{% set doors = [
states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }}
icon: >-
{% set doors = [
states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door,
] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{% if doors_open == 0 %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
- name: Faults
unique_id: 1629a83a-a46c-4041-9e49-8e54c5195388
unit_of_measurement: 'open'
state: >-
{% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %}
{{ doors_open + windows_open }}
icon: >-
{% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %}
{% set faults = ( doors_open + windows_open ) %}
{% if faults == 0 %}
mdi:shield-home
{% else %}
mdi:shield-off
{% endif %}
automation:
- id: 51819f36-2407-496c-afcd-ae160d747f0a

View File

@ -50,28 +50,6 @@ command_line:
scan_interval: 20000
unit_of_measurement: ''
sensor:
- platform: template
sensors:
min_ping:
friendly_name: "Min Ping"
unique_id: ddcb9f6f-7c94-41fe-9453-2a2205b078e0
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_min') }}"
availability_template: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
avg_ping:
friendly_name: "Avg Ping"
unique_id: 79a13c64-7508-48de-8b44-2a23c59917c8
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_avg') }}"
availability_template: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
max_ping:
friendly_name: "Max Ping"
unique_id: c9c71ab6-c7fa-4425-a4ed-768d60e93781
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_max') }}"
availability_template: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
mqtt:
sensor:
- name: "Uptime Kuma Status"
@ -127,6 +105,22 @@ template:
state: "{{ states('sensor.asus_laptop_system_idle_time') | int > 1800 }}"
attributes:
idle_time: "{{ states('sensor.asus_laptop_system_idle_time') }}s"
- sensor:
- name: "Min Ping"
unique_id: ddcb9f6f-7c94-41fe-9453-2a2205b078e0
state: "{{ state_attr('binary_sensor.internet','round_trip_time_min') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
- name: "Avg Ping"
unique_id: 79a13c64-7508-48de-8b44-2a23c59917c8
state: "{{ state_attr('binary_sensor.internet','round_trip_time_avg') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
- name: "Max Ping"
unique_id: c9c71ab6-c7fa-4425-a4ed-768d60e93781
state: "{{ state_attr('binary_sensor.internet','round_trip_time_max') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
# - platform: influxdb
# host: 192.168.1.26

View File

@ -1,3 +1,13 @@
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'
intent_script:
SetTimer:
action:

View File

@ -38,6 +38,21 @@ input_datetime:
has_time: true
icon: mdi:medical-bag
sensor:
- platform: rest
name: Home Tech
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
params:
project_id: 2285967948
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
json_attributes:
- project
- items
scan_interval: 30
automation:
- id: c583aebf-4500-412c-9436-e1b534ba1a44
alias: Tony Meds Handler

10
packages/twitch.yaml Normal file
View File

@ -0,0 +1,10 @@
sensor:
- platform: twitch_helix
client_id: !secret twitch_client_id
client_secret: !secret twitch_client_secret
own_channel: ironnerd24
thumbnail_dimensions: 320x180
entity_prefix: Twitch_
channels:
- ironnerd24
- Xia_P988

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +1,54 @@
- platform: template
sensors:
tony_current_age:
friendly_name: 'Tony Current Age'
unique_id: a9178c12-6bc6-435d-9055-5e8adf31e2ff
value_template: "{{ state_attr('sensor.anniversary_tony_s_birthday','current_years') }}"
icon_template: >
{% if is_state('sensor.anniversary_tony_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
tina_current_age:
friendly_name: 'Tina Current Age'
unique_id: 56453052-150c-47bf-a351-2f8ce0d43378
value_template: "{{ state_attr('sensor.anniversary_tina_s_birthday','current_years') }}"
icon_template: >
{% if is_state('sensor.anniversary_tina_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
kallen_current_age:
friendly_name: 'Kallen Current Age'
unique_id: f601002c-e6f0-4a19-bf13-1193ba1910d0
value_template: "{{ state_attr('sensor.anniversary_kallen_s_birthday','current_years') }}"
icon_template: >
{% if is_state('sensor.anniversary_kallen_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
emma_current_age:
friendly_name: 'Emma Current Age'
unique_id: a9af85ab-ea43-4541-8e97-2d596dab5e69
value_template: "{{ state_attr('sensor.anniversary_emmalynn_s_birthday','current_years') }}"
icon_template: >
{% if is_state('sensor.anniversary_emmalynn_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
- sensor:
- name: 'Tony Current Age'
unique_id: a9178c12-6bc6-435d-9055-5e8adf31e2ff
state: "{{ state_attr('sensor.anniversary_tony_s_birthday','current_years') }}"
icon: >
{% if is_state('sensor.anniversary_tony_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
- name: 'Tina Current Age'
unique_id: 56453052-150c-47bf-a351-2f8ce0d43378
state: "{{ state_attr('sensor.anniversary_tina_s_birthday','current_years') }}"
icon: >
{% if is_state('sensor.anniversary_tina_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
- name: 'Kallen Current Age'
unique_id: f601002c-e6f0-4a19-bf13-1193ba1910d0
state: "{{ state_attr('sensor.anniversary_kallen_s_birthday','current_years') }}"
icon: >
{% if is_state('sensor.anniversary_kallen_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
- name: 'Emma Current Age'
unique_id: a9af85ab-ea43-4541-8e97-2d596dab5e69
state: "{{ state_attr('sensor.anniversary_emmalynn_s_birthday','current_years') }}"
icon: >
{% if is_state('sensor.anniversary_emmalynn_s_birthday','0') %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
# The sum of all the years of life in our household, because why not LOL
total_age_years:
friendly_name: Total Age Years
unique_id: c1380627-b3a5-43ce-811d-3fb856c062a1
unit_of_measurement: ''
value_template: >
{% set tony = states('sensor.tony_current_age') | int %}
{% set tina = states('sensor.tina_current_age') | int %}
{% set kallen = states('sensor.kallen_current_age') | int %}
{% set emmalynn = states('sensor.emma_current_age') | int %}
{{ tony + tina + kallen + emmalynn }}
icon_template: >
{% if (states('sensor.birthdays_today') | int) > 0 %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
# The sum of all the years of life in our household, because why not LOL
- name: Total Age Years
unique_id: c1380627-b3a5-43ce-811d-3fb856c062a1
unit_of_measurement: ''
state: >
{% set tony = states('sensor.tony_current_age') | int %}
{% set tina = states('sensor.tina_current_age') | int %}
{% set kallen = states('sensor.kallen_current_age') | int %}
{% set emmalynn = states('sensor.emma_current_age') | int %}
{{ tony + tina + kallen + emmalynn }}
icon: >
{% if (states('sensor.birthdays_today') | int) > 0 %}
mdi:cake
{% else %}
mdi:eye
{% endif %}

View File

@ -1,38 +1,25 @@
- platform: twitch_helix
client_id: !secret twitch_client_id
client_secret: !secret twitch_client_secret
own_channel: ironnerd24
thumbnail_dimensions: 320x180
entity_prefix: Twitch_
channels:
- ironnerd24
- Xia_P988
- platform: template
sensors:
basement_tv_current_app:
friendly_name: 'Basement TV Current App'
unique_id: 838c2320-24b6-4555-959e-0546580ae8b2
value_template: >-
{% if is_state('media_player.basement_tv','off') %}
Off
{% else %}
{{ state_attr('media_player.basement_tv','app_name') }}
{% endif %}
living_room_tv_current_app:
friendly_name: 'Living Room TV Current App'
unique_id: b03de99d-b7fa-4f4c-8cdf-758c906dffe4
value_template: >-
{% if is_state('media_player.living_room_tv','off') %}
Off
{% else %}
{{ state_attr('media_player.living_room_tv','app_name') }}
{% endif %}
master_bedroom_tv_current_app:
friendly_name: 'Master Bedroom TV Current App'
unique_id: 4bf4bef3-fc81-4259-a75c-6693ceba0926
value_template: >-
{% if is_state('media_player.master_bedroom_firetv','off') %}
Off
{% else %}
{{ state_attr('media_player.master_bedroom_firetv','app_name') }}
{% endif %}
- sensor:
- name: 'Basement TV Current App'
unique_id: 838c2320-24b6-4555-959e-0546580ae8b2
state: >-
{% if is_state('media_player.basement_tv','off') %}
Off
{% else %}
{{ state_attr('media_player.basement_tv','app_name') }}
{% endif %}
- name: 'Living Room TV Current App'
unique_id: b03de99d-b7fa-4f4c-8cdf-758c906dffe4
state: >-
{% if is_state('media_player.living_room_tv','off') %}
Off
{% else %}
{{ state_attr('media_player.living_room_tv','app_name') }}
{% endif %}
- name: 'Master Bedroom TV Current App'
unique_id: 4bf4bef3-fc81-4259-a75c-6693ceba0926
state: >-
{% if is_state('media_player.master_bedroom_firetv','off') %}
Off
{% else %}
{{ state_attr('media_player.master_bedroom_firetv','app_name') }}
{% endif %}

View File

@ -1,426 +1,276 @@
- platform: template
sensors:
sensor_count:
friendly_name: 'Number of Sensors'
unique_id: e068dac5-a6f8-438d-a5df-93fa2c4eee2e
value_template: >-
{{ states.sensor | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
automation_count:
friendly_name: 'Number of Automations'
unique_id: ff75e7c9-1eac-4254-9a8d-4ed742a95233
value_template: >-
{{ states.automation| rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
script_count:
friendly_name: 'Number of Scripts'
unique_id: 29827719-36a0-4dad-9527-6b60aba3c4aa
value_template: >-
{{ states.script | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
binary_sensor_count:
friendly_name: 'Number of Binary Sensors'
unique_id: ffee9622-84f6-40df-b870-b8f79aa01943
value_template: >-
{{ states.binary_sensor | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
tracker_count:
friendly_name: 'Number of Devices'
unique_id: bc5c5934-084d-4bcb-930b-d48347ba1b3c
value_template: >-
{{ states.device_tracker| rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
lights_count:
friendly_name: 'Number of Lights'
unique_id: 71b7d157-4701-49dd-9145-41c5c93e22b4
value_template: >-
{{ states.light | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
switches_count:
friendly_name: 'Number of Switches'
unique_id: d2d60031-818c-475f-8243-c0101616847d
value_template: >-
{{ states.switch | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
camera_count:
friendly_name: 'Number of online Cameras'
unique_id: 46cefd93-b7d5-4fbf-b6d4-2fe94a053122
value_template: >-
{{ states.camera | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
media_player_count:
friendly_name: 'Number of Media Players'
unique_id: 295c724c-2044-4d06-8272-d92b086ff76f
value_template: >-
{{ states.media_player | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
entities_count:
friendly_name: 'Number of Entities'
unique_id: f2b17937-59ca-4a84-9a1b-a666bfb0566b
value_template: >-
{{ states | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
na_entities_count:
friendly_name: 'Number of NA Entities'
unique_id: cf2e5f8c-7f82-40c6-ae76-b587b7945c41
value_template: >-
{{ states | selectattr('state', 'eq', 'unavailable') | map(attribute='entity_id') | list | count | int }}
unit_of_measurement: ''
current_lights_on:
friendly_name: Current Lights On
unique_id: ea4afe4a-d0ac-4fce-968f-b181e50f4dc8
unit_of_measurement: ''
value_template: >-
{% set lights = [
states.light.living_room_color_1,
states.light.living_room_color_2,
states.light.living_room_color_3,
states.light.dining_room_lamp,
states.light.mud_room_overhead,
states.light.downstairs_bathroom_left,
states.light.downstairs_bathroom_right,
states.light.tina_lamp_top,
states.light.tina_lamp_side,
states.light.tina_desk_strip,
states.light.basement_tall_lamp,
states.light.basement_short_lamp,
states.light.basement_stairwell,
states.light.basement_led_strip_1,
states.light.hallway_overhead,
states.light.upstairs_bathroom_left,
states.light.upstairs_bathroom_middle_left,
states.light.upstairs_bathroom_middle_right,
states.light.upstairs_bathroom_right,
states.light.upstairs_bathroom_wall,
states.light.master_bedroom_front,
states.light.master_bedroom_side,
states.light.master_bedroom_closet,
states.light.kallen_bedroom_wall,
states.light.kallen_bedroom_overhead,
states.light.emma_bedroom_light,
states.light.front_porch_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
first_floor_lights_on:
friendly_name: First Floor Lights On
unique_id: fca1468d-4e0c-40ff-8c7f-251f99ee1b5b
unit_of_measurement: ''
value_template: >-
{% set lights = [
states.light.living_room_color_1,
states.light.living_room_color_2,
states.light.living_room_color_3,
states.light.dining_room_lamp,
states.light.mud_room_overhead,
states.light.downstairs_bathroom_left,
states.light.downstairs_bathroom_right,
states.light.tina_lamp_top,
states.light.tina_lamp_side,
states.light.tina_desk_strip
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
second_floor_lights_on:
friendly_name: Second Floor Lights On
unique_id: 517a73c0-67a0-44f9-99f3-5dfec784da18
unit_of_measurement: ''
value_template: >-
{% set lights = [
states.light.hallway_overhead,
states.light.upstairs_bathroom_left,
states.light.upstairs_bathroom_middle_left,
states.light.upstairs_bathroom_middle_right,
states.light.upstairs_bathroom_right,
states.light.upstairs_bathroom_wall,
states.light.master_bedroom_front,
states.light.master_bedroom_side,
states.light.master_bedroom_closet,
states.light.kallen_bedroom_wall,
states.light.kallen_bedroom_overhead,
states.light.emma_bedroom_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
basement_lights_on:
friendly_name: Basement Lights On
unique_id: 1a9e13d1-c2bd-44e4-82b2-b975ca61eed3
unit_of_measurement: ''
value_template: >-
{% set lights = [
states.light.basement_stairwell,
states.light.basement_tall_lamp,
states.light.basement_short_lamp,
states.light.basement_led_strip_1
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
current_outdoor_lights_on:
friendly_name: Current Outdoor Lights On
unique_id: 252981eb-e7bf-464a-9bfb-ab14dec4eb70
unit_of_measurement: ''
value_template: >-
{% set lights = [
states.light.front_porch_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
current_computers_on:
friendly_name: Current Computers On
unique_id: fb3f14f3-d0c9-4880-88c6-143d56248f13
unit_of_measurement: ''
value_template: >-
{% set computers = [
states.binary_sensor.tony_desktop_on,
states.binary_sensor.tina_desktop_on,
states.binary_sensor.kallen_desktop_on,
states.binary_sensor.basement_server_on
] %}
{{ computers | selectattr('state','eq','on') | list | count | int }}
climate_devices_installed:
friendly_name: Climate Devices Installed
unique_id: e227272d-a10b-4641-ad27-39dc88a1ac2a
unit_of_measurement: ''
value_template: >-
{% set devices = [
states.input_boolean.master_bedroom_aircon_installed,
states.input_boolean.emma_bedroom_aircon_installed
] %}
{{ devices | selectattr('state','eq','on') | list | count | int }}
ac_compressors_running:
friendly_name: A/C Compressors Running
unique_id: f27854e4-3a87-478e-9cdc-491cdb215d41
unit_of_measurement: ''
value_template: >-
{% set compressors = [
states.binary_sensor.emma_aircon_compressor,
states.binary_sensor.master_bedroom_aircon_compressor
] %}
{{ compressors | selectattr('state','eq','on') | list | count | int }}
ac_fans_running:
friendly_name: A/C Fans Running
unique_id: 0b4b4362-4c35-42a0-98ba-55ac49ca2dbb
unit_of_measurement: ''
value_template: >-
{% set fans = [
states.binary_sensor.emma_aircon_fan,
states.binary_sensor.master_bedroom_aircon_fan
] %}
{{ fans | selectattr('state','eq','on') | list | count | int }}
fans_running:
friendly_name: Fans Running
unique_id: 31f2b8d8-4d21-4328-bb03-482943795359
unit_of_measurement: ''
value_template: >-
{% set fans = [
states.fan.basement_fan,
states.fan.master_bedroom_fan,
states.fan.kallen_bedroom_fan
] %}
{{ fans | selectattr('state','eq','on') | list | count | int }}
aircons_running:
friendly_name: Air Conditioners Running
unique_id: e1a2a8d6-75d9-4de5-9b4b-449681ca27a4
unit_of_measurement: ''
value_template: >-
{% set climate = states.climate | selectattr('state','ne','off') | rejectattr('state','eq','unavailable') | rejectattr('state','eq','unknown') | list | count | int %}
{% set fans = [
states.fan.emma_air_conditioner
] %}
{% set fans_on = fans | selectattr('state','eq','on') | list | count | int %}
{{ climate + fans_on | int }}
climate_devices_running:
friendly_name: Climate Devices Running
unique_id: 3c61c756-2934-4294-8085-7d3855b692dd
unit_of_measurement: ''
value_template: >-
{{ (states('sensor.fans_running') | int) + (states('sensor.aircons_running') | int) | int }}
front_porch_color_temp:
friendly_name: Front Porch Color Temp
unique_id: 21a01514-d382-4c57-9add-3d500464b22b
unit_of_measurement: 'mireds'
value_template: >
{% if is_state('light.front_porch_light','off') %}
{{ 0 | int }}
{% else %}
{{ state_attr('light.front_porch_light','color_temp') | int }}
{% endif %}
birthdays_today:
friendly_name: Birthdays Today
unique_id: ec61c919-60a0-47a2-978c-aa2453267d3d
unit_of_measurement: ''
value_template: >
{% set birthdays = [
states.sensor.anniversary_tony_s_birthday,
states.sensor.anniversary_tina_s_birthday,
states.sensor.anniversary_kallen_s_birthday,
states.sensor.anniversary_emmalynn_s_birthday
] %}
{{ birthdays | selectattr('state','eq','0') | list | count | int }}
icon_template: >
{% set birthdays = [
states.sensor.anniversary_tony_s_birthday,
states.sensor.anniversary_tina_s_birthday,
states.sensor.anniversary_kallen_s_birthday,
states.sensor.anniversary_emmalynn_s_birthday
] %}
{% set status = birthdays | selectattr('state','eq','0') | list | count | int %}
{% if status > 0 %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
# The sum of all the years of life in our household, because why not LOL
second_floor_plugs_current:
friendly_name: Second Floor Plugs Current
unique_id: 7f78e126-3986-4a91-8815-8a9435541bea
unit_of_measurement: A
value_template: >
{% set outlets = [
states.sensor.master_bedroom_fan_current.state,
states.sensor.master_bedroom_aircon_current.state,
states.sensor.kallen_bedroom_fan_current.state,
states.sensor.emma_air_conditioner_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon_template: mdi:lightning-bolt-circle
first_floor_plugs_current:
friendly_name: First Floor Plugs Current
unique_id: 29ffd18a-c961-4022-82f3-9aca6919fb84
unit_of_measurement: A
value_template: >
{% set outlets = [
states.sensor.tina_desktop_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon_template: mdi:lightning-bolt-circle
basement_plugs_current:
friendly_name: Basement Plugs Current
unique_id: 79052046-80ac-43e4-8fd4-ec7e36cefe3d
unit_of_measurement: A
value_template: >
{% set outlets = [
states.sensor.basement_fan_current.state,
states.sensor.basement_led_strip_current.state,
states.sensor.basement_server_current.state,
states.sensor.kallen_desktop_current.state,
states.sensor.tony_desktop_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon_template: mdi:lightning-bolt-circle
- platform: history_stats
name: Basement TV Time
entity_id: media_player.basement_tv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Basement TV Chromecast Time
entity_id: media_player.basement_tv_chromecast
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Living Room TV Time
entity_id: media_player.living_room_tv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Living Room TV Chromecast Time
entity_id: media_player.living_room_tv_chromecast
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom TV Time
entity_id: media_player.master_bedroom_firetv
state: 'playing'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Outside Lights
entity_id: light.outside_lights
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Windows Open Time
entity_id: sensor.windows_open
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Doors Open Time
entity_id: sensor.doors_open
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Emma A/C Compressor Time
entity_id: binary_sensor.emma_aircon_compressor
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Emma A/C Fan Time
entity_id: binary_sensor.emma_aircon_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom A/C Compressor Time
entity_id: binary_sensor.master_bedroom_aircon_compressor
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom A/C Fan Time
entity_id: binary_sensor.master_bedroom_aircon_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Master Bedroom Fan Time
entity_id: fan.master_bedroom_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Kallen Fan Time
entity_id: fan.kallen_bedroom_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- platform: history_stats
name: Basement Fan Time
entity_id: fan.basement_fan
state: 'on'
type: time
end: '{{ now() }}'
duration:
hours: 24
- sensor:
- name: 'Number of Sensors'
unique_id: e068dac5-a6f8-438d-a5df-93fa2c4eee2e
state: >-
{{ states.sensor | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Automations'
unique_id: ff75e7c9-1eac-4254-9a8d-4ed742a95233
state: >-
{{ states.automation| rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Scripts'
unique_id: 29827719-36a0-4dad-9527-6b60aba3c4aa
state: >-
{{ states.script | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Binary Sensors'
unique_id: ffee9622-84f6-40df-b870-b8f79aa01943
state: >-
{{ states.binary_sensor | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Devices'
unique_id: bc5c5934-084d-4bcb-930b-d48347ba1b3c
state: >-
{{ states.device_tracker| rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Lights'
unique_id: 71b7d157-4701-49dd-9145-41c5c93e22b4
state: >-
{{ states.light | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Switches'
unique_id: d2d60031-818c-475f-8243-c0101616847d
state: >-
{{ states.switch | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of online Cameras'
unique_id: 46cefd93-b7d5-4fbf-b6d4-2fe94a053122
state: >-
{{ states.camera | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Media Players'
unique_id: 295c724c-2044-4d06-8272-d92b086ff76f
state: >-
{{ states.media_player | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of Entities'
unique_id: f2b17937-59ca-4a84-9a1b-a666bfb0566b
state: >-
{{ states | rejectattr('state', 'eq', 'unavailable') | list | count | int }}
unit_of_measurement: ''
- name: 'Number of NA Entities'
unique_id: cf2e5f8c-7f82-40c6-ae76-b587b7945c41
state: >-
{{ states | selectattr('state', 'eq', 'unavailable') | map(attribute='entity_id') | list | count | int }}
unit_of_measurement: ''
- name: Current Lights On
unique_id: ea4afe4a-d0ac-4fce-968f-b181e50f4dc8
unit_of_measurement: ''
state: >-
{% set lights = [
states.light.living_room_color_1,
states.light.living_room_color_2,
states.light.living_room_color_3,
states.light.dining_room_lamp,
states.light.mud_room_overhead,
states.light.downstairs_bathroom_left,
states.light.downstairs_bathroom_right,
states.light.tina_lamp_top,
states.light.tina_lamp_side,
states.light.tina_desk_strip,
states.light.basement_tall_lamp,
states.light.basement_short_lamp,
states.light.basement_stairwell,
states.light.basement_led_strip_1,
states.light.hallway_overhead,
states.light.upstairs_bathroom_left,
states.light.upstairs_bathroom_middle_left,
states.light.upstairs_bathroom_middle_right,
states.light.upstairs_bathroom_right,
states.light.upstairs_bathroom_wall,
states.light.master_bedroom_front,
states.light.master_bedroom_side,
states.light.master_bedroom_closet,
states.light.kallen_bedroom_wall,
states.light.kallen_bedroom_overhead,
states.light.emma_bedroom_light,
states.light.front_porch_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
- name: First Floor Lights On
unique_id: fca1468d-4e0c-40ff-8c7f-251f99ee1b5b
unit_of_measurement: ''
state: >-
{% set lights = [
states.light.living_room_color_1,
states.light.living_room_color_2,
states.light.living_room_color_3,
states.light.dining_room_lamp,
states.light.mud_room_overhead,
states.light.downstairs_bathroom_left,
states.light.downstairs_bathroom_right,
states.light.tina_lamp_top,
states.light.tina_lamp_side,
states.light.tina_desk_strip
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
- name: Second Floor Lights On
unique_id: 517a73c0-67a0-44f9-99f3-5dfec784da18
unit_of_measurement: ''
state: >-
{% set lights = [
states.light.hallway_overhead,
states.light.upstairs_bathroom_left,
states.light.upstairs_bathroom_middle_left,
states.light.upstairs_bathroom_middle_right,
states.light.upstairs_bathroom_right,
states.light.upstairs_bathroom_wall,
states.light.master_bedroom_front,
states.light.master_bedroom_side,
states.light.master_bedroom_closet,
states.light.kallen_bedroom_wall,
states.light.kallen_bedroom_overhead,
states.light.emma_bedroom_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
- name: Basement Lights On
unique_id: 1a9e13d1-c2bd-44e4-82b2-b975ca61eed3
unit_of_measurement: ''
state: >-
{% set lights = [
states.light.basement_stairwell,
states.light.basement_tall_lamp,
states.light.basement_short_lamp,
states.light.basement_led_strip_1
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
- name: Current Outdoor Lights On
unique_id: 252981eb-e7bf-464a-9bfb-ab14dec4eb70
unit_of_measurement: ''
state: >-
{% set lights = [
states.light.front_porch_light
] %}
{{ lights | selectattr('state','eq','on') | list | count | int }}
- name: Current Computers On
unique_id: fb3f14f3-d0c9-4880-88c6-143d56248f13
unit_of_measurement: ''
state: >-
{% set computers = [
states.binary_sensor.tony_desktop_on,
states.binary_sensor.tina_desktop_on,
states.binary_sensor.kallen_desktop_on,
states.binary_sensor.basement_server_on
] %}
{{ computers | selectattr('state','eq','on') | list | count | int }}
- name: Climate Devices Installed
unique_id: e227272d-a10b-4641-ad27-39dc88a1ac2a
unit_of_measurement: ''
state: >-
{% set devices = [
states.input_boolean.master_bedroom_aircon_installed,
states.input_boolean.emma_bedroom_aircon_installed
] %}
{{ devices | selectattr('state','eq','on') | list | count | int }}
- name: A/C Compressors Running
unique_id: f27854e4-3a87-478e-9cdc-491cdb215d41
unit_of_measurement: ''
state: >-
{% set compressors = [
states.binary_sensor.emma_aircon_compressor,
states.binary_sensor.master_bedroom_aircon_compressor
] %}
{{ compressors | selectattr('state','eq','on') | list | count | int }}
- name: A/C Fans Running
unique_id: 0b4b4362-4c35-42a0-98ba-55ac49ca2dbb
unit_of_measurement: ''
state: >-
{% set fans = [
states.binary_sensor.emma_aircon_fan,
states.binary_sensor.master_bedroom_aircon_fan
] %}
{{ fans | selectattr('state','eq','on') | list | count | int }}
- name: Fans Running
unique_id: 31f2b8d8-4d21-4328-bb03-482943795359
unit_of_measurement: ''
state: >-
{% set fans = [
states.fan.basement_fan,
states.fan.master_bedroom_fan,
states.fan.kallen_bedroom_fan
] %}
{{ fans | selectattr('state','eq','on') | list | count | int }}
- name: Air Conditioners Running
unique_id: e1a2a8d6-75d9-4de5-9b4b-449681ca27a4
unit_of_measurement: ''
state: >-
{% set climate = states.climate | selectattr('state','ne','off') | rejectattr('state','eq','unavailable') | rejectattr('state','eq','unknown') | list | count | int %}
{% set fans = [
states.fan.emma_air_conditioner
] %}
{% set fans_on = fans | selectattr('state','eq','on') | list | count | int %}
{{ climate + fans_on | int }}
- name: Climate Devices Running
unique_id: 3c61c756-2934-4294-8085-7d3855b692dd
unit_of_measurement: ''
state: >-
{{ (states('sensor.fans_running') | int) + (states('sensor.aircons_running') | int) | int }}
- name: Front Porch Color Temp
unique_id: 21a01514-d382-4c57-9add-3d500464b22b
unit_of_measurement: 'mireds'
state: >
{% if is_state('light.front_porch_light','off') %}
{{ 0 | int }}
{% else %}
{{ state_attr('light.front_porch_light','color_temp') | int }}
{% endif %}
- name: Birthdays Today
unique_id: ec61c919-60a0-47a2-978c-aa2453267d3d
unit_of_measurement: ''
state: >
{% set birthdays = [
states.sensor.anniversary_tony_s_birthday,
states.sensor.anniversary_tina_s_birthday,
states.sensor.anniversary_kallen_s_birthday,
states.sensor.anniversary_emmalynn_s_birthday
] %}
{{ birthdays | selectattr('state','eq','0') | list | count | int }}
icon: >
{% set birthdays = [
states.sensor.anniversary_tony_s_birthday,
states.sensor.anniversary_tina_s_birthday,
states.sensor.anniversary_kallen_s_birthday,
states.sensor.anniversary_emmalynn_s_birthday
] %}
{% set status = birthdays | selectattr('state','eq','0') | list | count | int %}
{% if status > 0 %}
mdi:cake
{% else %}
mdi:eye
{% endif %}
# The sum of all the years of life in our household, because why not LOL
- name: Second Floor Plugs Current
unique_id: 7f78e126-3986-4a91-8815-8a9435541bea
unit_of_measurement: A
state: >
{% set outlets = [
states.sensor.master_bedroom_fan_current.state,
states.sensor.master_bedroom_aircon_current.state,
states.sensor.kallen_bedroom_fan_current.state,
states.sensor.emma_air_conditioner_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon: mdi:lightning-bolt-circle
- name: First Floor Plugs Current
unique_id: 29ffd18a-c961-4022-82f3-9aca6919fb84
unit_of_measurement: A
state: >
{% set outlets = [
states.sensor.tina_desktop_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon: mdi:lightning-bolt-circle
- name: Basement Plugs Current
unique_id: 79052046-80ac-43e4-8fd4-ec7e36cefe3d
unit_of_measurement: A
state: >
{% set outlets = [
states.sensor.basement_fan_current.state,
states.sensor.basement_led_strip_current.state,
states.sensor.basement_server_current.state,
states.sensor.kallen_desktop_current.state,
states.sensor.tony_desktop_current.state
] | map('float') | list %}
{{ outlets | sum | round(2) }}
icon: mdi:lightning-bolt-circle

View File

@ -1,63 +1,31 @@
- platform: rest
name: Kallen Tasks
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
params:
project_id: 2285969005
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
json_attributes:
- project
- items
scan_interval: 30
- platform: rest
name: Home Tech
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
params:
project_id: 2285967948
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
json_attributes:
- project
- items
scan_interval: 30
- platform: template
sensors:
home_tech_bug_reports:
friendly_name: 'Bug Reports'
unique_id: d9c3d6c5-f28f-4b60-a19f-355c8e58f9cb
value_template: "{{ states('sensor.home_tech') }}"
attribute_templates:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '94865633')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_improvements:
friendly_name: 'Improvements'
unique_id: f1af501a-de94-4951-a841-9ef82a08bb95
value_template: "{{ states('sensor.home_tech') }}"
attribute_templates:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '114199257')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_in_progress:
friendly_name: 'In Progress'
unique_id: ea820db3-3b17-49a5-8ab9-b5d1e89c5da1
value_template: "{{ states('sensor.home_tech') }}"
attribute_templates:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '81234677')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_long_term:
friendly_name: 'Long Term or Maintaining'
unique_id: 4c807471-6d9a-4f64-bad9-893a330a9499
value_template: "{{ states('sensor.home_tech') }}"
attribute_templates:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '88456343')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_postponed_indefinitely:
friendly_name: 'Postponed Indefinitely'
unique_id: eadb779a-eb65-4cc8-a184-fb5d6f29c48d
value_template: "{{ states('sensor.home_tech') }}"
attribute_templates:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '81234736')|list|selectattr('parent_id','eq',none)|list }}"
- sensor:
- name: 'Bug Reports'
unique_id: d9c3d6c5-f28f-4b60-a19f-355c8e58f9cb
state: "{{ states('sensor.home_tech') }}"
attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '94865633')|list|selectattr('parent_id','eq',none)|list }}"
- name: 'Improvements'
unique_id: f1af501a-de94-4951-a841-9ef82a08bb95
state: "{{ states('sensor.home_tech') }}"
attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '114199257')|list|selectattr('parent_id','eq',none)|list }}"
- name: 'In Progress'
unique_id: ea820db3-3b17-49a5-8ab9-b5d1e89c5da1
state: "{{ states('sensor.home_tech') }}"
attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '81234677')|list|selectattr('parent_id','eq',none)|list }}"
- name: 'Long Term or Maintaining'
unique_id: 4c807471-6d9a-4f64-bad9-893a330a9499
state: "{{ states('sensor.home_tech') }}"
attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '88456343')|list|selectattr('parent_id','eq',none)|list }}"
- name: 'Postponed Indefinitely'
unique_id: eadb779a-eb65-4cc8-a184-fb5d6f29c48d
state: "{{ states('sensor.home_tech') }}"
attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}"
items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '81234736')|list|selectattr('parent_id','eq',none)|list }}"

View File

@ -1,33 +1,19 @@
- platform: template
sensors:
today_is:
friendly_name: 'Today is'
unique_id: 18e7d262-14f6-4f67-a291-8faf85d4104d
value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}"
month_is:
friendly_name: 'Month is'
unique_id: fd7a9fe3-4a29-4235-8959-b26d79c6646c
value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}"
kallen_timer_remaining_minutes:
friendly_name: 'Kallen Timer Remaining Minutes'
unique_id: ca06c860-2bc7-4c16-810b-c338724459ca
value_template: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%M', false) }}
kallen_timer_remaining_seconds:
friendly_name: 'Kallen Timer Remaining Seconds'
unique_id: d81d5726-1229-4c0c-846c-69aeeead7313
value_template: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%S', false) }}
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'
- sensor:
- name: 'Today is'
unique_id: 18e7d262-14f6-4f67-a291-8faf85d4104d
state: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}"
- name: 'Month is'
unique_id: fd7a9fe3-4a29-4235-8959-b26d79c6646c
state: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}"
- name: 'Kallen Timer Remaining Minutes'
unique_id: ca06c860-2bc7-4c16-810b-c338724459ca
state: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%M', false) }}
- name: 'Kallen Timer Remaining Seconds'
unique_id: d81d5726-1229-4c0c-846c-69aeeead7313
state: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%S', false) }}

View File

@ -1,4 +0,0 @@
binary_sensor:
- name: People Present
state: >
{{ is_state('person.tony_stork', 'home') or is_state('person.christina_stork', 'home') }}