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 token: !secret lifx_token
input_boolean: !include input_boolean.yaml input_boolean: !include input_boolean.yaml
binary_sensor: !include binary_sensor.yaml binary_sensor: !include binary_sensor.yaml
sensor: !include_dir_merge_list sensors
switch: !include switches.yaml switch: !include switches.yaml
input_select: !include input_select.yaml input_select: !include input_select.yaml
input_text: !include input_text.yaml input_text: !include input_text.yaml
input_datetime: !include input_datetime.yaml input_datetime: !include input_datetime.yaml
template: !include template.yaml template: !include_dir_merge_list sensors
input_number: !include input_number.yaml input_number: !include input_number.yaml
frontend: 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: template:
- binary_sensor: - binary_sensor:
- name: Emma Aircon - Compressor - name: Emma Aircon - Compressor
@ -66,6 +19,45 @@ template:
- name: Kallen Fan - Separate Schedule - name: Kallen Fan - Separate Schedule
unique_id: 3f243861-6a1f-412f-b9e3-933b54793b08 unique_id: 3f243861-6a1f-412f-b9e3-933b54793b08
state: "{{ states('input_datetime.kallen_fan') != states('input_datetime.kallen_bedtime') }}" 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: input_boolean:
master_bedroom_climate_protocol: master_bedroom_climate_protocol:

View File

@ -159,6 +159,81 @@ weather:
{{ states(result) | float }} {{ states(result) | float }}
precipitation_unit: in precipitation_unit: in
binary_sensor:
- platform: bayesian
unique_id: 3e9640d9-57a0-4495-8731-e64b34774065
name: Raining Bayesian
prior: 0.17
probability_threshold: 0.6
observations:
- entity_id: "sensor.myradar_precip"
prob_given_true: 0.99
prob_given_false: 0.45
platform: "state"
to_state: "rain"
- entity_id: "sensor.pirateweather_precip"
prob_given_true: 0.13
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.openweathermap_precipitation_kind"
prob_given_true: 0.75
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.tomorrow_io_stratton_ave_precipitation_type"
prob_given_true: 0.99
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.stratton_ave_precipitation"
prob_given_true: 0.99
prob_given_false: 0.2
platform: "numeric_state"
above: 0
sensor:
- platform: weatheralerts
state: OH
zone: 4
county: 39
# - platform: statistics
# unique_id: b5996cb4-b715-4fc9-b3d8-98fc12c2b7dd
# name: Outside Temp Average
# entity_id: sensor.pirateweather_temperature
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: 6192c95a-8fd1-4ba0-87de-d06fdc071d6b
# name: Apparent Temp Average
# entity_id: sensor.stratton_ave_apparent_temperature
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: 7b9c269c-40b7-4255-a051-2d1b7a6af017
# name: Wind Speed Average
# entity_id: sensor.pirateweather_wind_speed
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: b43d053f-aafb-4237-a742-a2ca841498fa
# name: Visibility Stats Average
# entity_id: sensor.kdfi_visibility
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: b1206da2-fa00-4f7d-9af4-f2cf6794bd24
# name: Humidity Stats Average
# entity_id: sensor.pirateweather_humidity
# state_characteristic: average_linear
# max_age:
# days: 7
template: template:
- binary_sensor: - binary_sensor:
- name: Heat Threshold - name: Heat Threshold
@ -267,92 +342,14 @@ template:
{% else %} {% else %}
true true
{% endif %} {% endif %}
- sensor:
binary_sensor: - name: Current Forecast
- platform: bayesian
unique_id: 3e9640d9-57a0-4495-8731-e64b34774065
name: Raining Bayesian
prior: 0.17
probability_threshold: 0.6
observations:
- entity_id: "sensor.myradar_precip"
prob_given_true: 0.99
prob_given_false: 0.45
platform: "state"
to_state: "rain"
- entity_id: "sensor.pirateweather_precip"
prob_given_true: 0.13
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.openweathermap_precipitation_kind"
prob_given_true: 0.75
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.tomorrow_io_stratton_ave_precipitation_type"
prob_given_true: 0.99
prob_given_false: 0.005
platform: "state"
to_state: "rain"
- entity_id: "sensor.stratton_ave_precipitation"
prob_given_true: 0.99
prob_given_false: 0.2
platform: "numeric_state"
above: 0
sensor:
- platform: weatheralerts
state: OH
zone: 4
county: 39
# - platform: statistics
# unique_id: b5996cb4-b715-4fc9-b3d8-98fc12c2b7dd
# name: Outside Temp Average
# entity_id: sensor.pirateweather_temperature
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: 6192c95a-8fd1-4ba0-87de-d06fdc071d6b
# name: Apparent Temp Average
# entity_id: sensor.stratton_ave_apparent_temperature
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: 7b9c269c-40b7-4255-a051-2d1b7a6af017
# name: Wind Speed Average
# entity_id: sensor.pirateweather_wind_speed
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: b43d053f-aafb-4237-a742-a2ca841498fa
# name: Visibility Stats Average
# entity_id: sensor.kdfi_visibility
# state_characteristic: average_linear
# max_age:
# days: 7
# - platform: statistics
# unique_id: b1206da2-fa00-4f7d-9af4-f2cf6794bd24
# name: Humidity Stats Average
# entity_id: sensor.pirateweather_humidity
# state_characteristic: average_linear
# max_age:
# days: 7
- platform: template
sensors:
current_forecast:
friendly_name: Current Forecast
unique_id: c0faea33-2ac3-40f1-8558-584c3f5d6b16 unique_id: c0faea33-2ac3-40f1-8558-584c3f5d6b16
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{{ forecast.condition }} {{ forecast.condition }}
attribute_templates: attributes:
high_temp: >- high_temp: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{{ forecast.temperature }} {{ forecast.temperature }}
@ -371,11 +368,10 @@ sensor:
friendly: >- friendly: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{{ forecast.condition | replace("partlycloudy","partly cloudy") }} {{ forecast.condition | replace("partlycloudy","partly cloudy") }}
current_forecast_detail: - name: Current Forecast Detail
friendly_name: Current Forecast Detail
unique_id: e5ae9864-70b5-402c-9d2f-c4d6a10085df unique_id: e5ae9864-70b5-402c-9d2f-c4d6a10085df
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{{ [ {{ [
@ -481,14 +477,13 @@ sensor:
{{ states('sensor.overnight_lowest_temperature') }} degrees. {{ states('sensor.overnight_lowest_temperature') }} degrees.
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
tomorrow_forecast: - name: Tomorrows Forecast
friendly_name: Tomorrows Forecast
unique_id: a8ae26b0-ed26-4568-bb2b-f7c72707b009 unique_id: a8ae26b0-ed26-4568-bb2b-f7c72707b009
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{{ forecast.condition }} {{ forecast.condition }}
attribute_templates: attributes:
high_temp: >- high_temp: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{{ forecast.temperature }} {{ forecast.temperature }}
@ -504,11 +499,10 @@ sensor:
precipitation: >- precipitation: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{{ forecast.precipitation }} {{ forecast.precipitation }}
tomorrow_forecast_detail: - name: Tomorrow Forecast Detail
friendly_name: Tomorrow Forecast Detail
unique_id: 21374ed0-80d1-49ba-817d-3e93eb3865e4 unique_id: 21374ed0-80d1-49ba-817d-3e93eb3865e4
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{{ [ {{ [
@ -603,11 +597,10 @@ sensor:
{{ state_attr('sensor.tomorrow_forecast','overnight_low') }} degrees. {{ state_attr('sensor.tomorrow_forecast','overnight_low') }} degrees.
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
current_conditions: - name: Current Conditions
friendly_name: Current Conditions
unique_id: 70db7e57-08db-48b2-919b-03b5face37b9 unique_id: 70db7e57-08db-48b2-919b-03b5face37b9
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
The Weather in Defiance The Weather in Defiance
@ -649,11 +642,10 @@ sensor:
{% endif %} {% endif %}
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
current_conditions_detail: - name: Current Conditions Detail
friendly_name: Current Conditions Detail
unique_id: 2b3687d1-bdd5-4551-8c0a-05b1ff617543 unique_id: 2b3687d1-bdd5-4551-8c0a-05b1ff617543
icon_template: mdi:weather-sunny icon: mdi:weather-sunny
value_template: >- state: >-
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
The Weather in Defiance The Weather in Defiance
@ -801,31 +793,27 @@ sensor:
{% endif %} {% endif %}
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
outside_pressure: - name: 'Outside Pressure'
friendly_name: 'Outside Pressure'
unique_id: ac2944bb-e9d7-40a3-9707-ef477fd5f309 unique_id: ac2944bb-e9d7-40a3-9707-ef477fd5f309
value_template: '{{ state_attr(''weather.iron_nerd_weather_station'',''pressure'') }}' state: '{{ state_attr(''weather.iron_nerd_weather_station'',''pressure'') }}'
unit_of_measurement: '' unit_of_measurement: ''
todays_high_temp: - name: "Today's High Temp"
friendly_name: "Today's High Temp"
unique_id: 532904af-940b-45cd-af8e-c69d1a9c4531 unique_id: 532904af-940b-45cd-af8e-c69d1a9c4531
unit_of_measurement: '°F' unit_of_measurement: '°F'
device_class: temperature device_class: temperature
value_template: >- state: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{{ forecast.temperature }} {{ forecast.temperature }}
tonights_low_temp: - name: "Tonight's Low Temp"
friendly_name: "Tonight's Low Temp"
unique_id: 8ddc55b6-4728-4897-a32f-90be970f744b unique_id: 8ddc55b6-4728-4897-a32f-90be970f744b
unit_of_measurement: '°F' unit_of_measurement: '°F'
device_class: temperature device_class: temperature
value_template: >- state: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %} {% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{{ forecast.templow }} {{ forecast.templow }}
clothing_forecast: - name: "Clothing Forecast"
friendly_name: "Clothing Forecast"
unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a
value_template: >- state: >-
{% if is_state('binary_sensor.overnight', 'off') %} {% if is_state('binary_sensor.overnight', 'off') %}
{% set temp = states('sensor.today_corrected_high_temp')|int %} {% set temp = states('sensor.today_corrected_high_temp')|int %}
{% else %} {% else %}
@ -850,10 +838,9 @@ sensor:
{% else %} {% else %}
Unknown Unknown
{%- endif %} {%- endif %}
clothing_forecast_detail: - name: "Clothing Forecast Detail"
friendly_name: "Clothing Forecast Detail"
unique_id: 13065f50-5eef-4afd-830e-2a2c87f47496 unique_id: 13065f50-5eef-4afd-830e-2a2c87f47496
value_template: >- state: >-
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% if is_state('binary_sensor.morning','on') %} {% if is_state('binary_sensor.morning','on') %}
@ -1007,22 +994,21 @@ sensor:
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
# current_inside_humidity: # current_inside_humidity:
# friendly_name: "Current Inside Humidity" # - name: "Current Inside Humidity"
# unit_of_measurement: '%' # unit_of_measurement: '%'
# value_template: "{{ state_attr('climate.home','current_humidity') }}" # state: "{{ state_attr('climate.home','current_humidity') }}"
# lighting_stike_count: # lighting_stike_count:
# friendly_name: "Lightning Strike Count" # - name: "Lightning Strike Count"
# value_template: "{{ states('sensor.acurite_6045m_3078_strcnt') }}" # state: "{{ states('sensor.acurite_6045m_3078_strcnt') }}"
# yesterday_rainfall_in: # yesterday_rainfall_in:
# friendly_name: "Yesterday Rainfall" # - name: "Yesterday Rainfall"
# value_template: "{{ state_attr('sensor.daily_rainfall_in', 'last_period') }}" # state: "{{ state_attr('sensor.daily_rainfall_in', 'last_period') }}"
# previous_rainfall: # previous_rainfall:
# friendly_name: "Past 48h Rainfall" # - name: "Past 48h Rainfall"
# value_template: "{{ states('sensor.daily_rainfall_in') | float + state_attr('sensor.daily_rainfall_in', 'last_period') | float }}" # state: "{{ states('sensor.daily_rainfall_in') | float + state_attr('sensor.daily_rainfall_in', 'last_period') | float }}"
weather_alert_string: - name: Weather Alert String
friendly_name: Weather Alert String
unique_id: 66b5f020-0b5e-48ed-92a2-740d2d708b30 unique_id: 66b5f020-0b5e-48ed-92a2-740d2d708b30
value_template: > state: >
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% set alerts = [ {% set alerts = [
@ -1045,18 +1031,17 @@ sensor:
{% endif %} {% endif %}
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
attribute_templates: attributes:
active_alerts: "{{ states('sensor.weatheralerts_active_alerts') }}" active_alerts: "{{ states('sensor.weatheralerts_active_alerts') }}"
icon_template: > icon: >
{% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %} {% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %}
mdi:alert mdi:alert
{% else %} {% else %}
mdi:alert-remove mdi:alert-remove
{% endif %} {% endif %}
weather_alerts_active_corrected: - name: 'Weather Alerts Active - Corrected'
friendly_name: 'Weather Alerts Active - Corrected'
unique_id: e2f51da4-2271-4719-8edf-a28f76ac1e3f unique_id: e2f51da4-2271-4719-8edf-a28f76ac1e3f
value_template: > state: >
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% set alerts = [ {% set alerts = [
@ -1072,7 +1057,7 @@ sensor:
{{ (main + flood1) | int }} {{ (main + flood1) | int }}
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(getReport()) -}} {{- cleanup(getReport()) -}}
icon_template: > icon: >
{% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %} {% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %}
mdi:alert mdi:alert
{% else %} {% else %}
@ -1080,11 +1065,10 @@ sensor:
{% endif %} {% endif %}
# Sensors to more accurately forecast the overnight temperatures # Sensors to more accurately forecast the overnight temperatures
overnight_lowest_temperature: - name: 'Overnight Lowest Temperature'
friendly_name: 'Overnight Lowest Temperature'
unique_id: 70bdffbe-dc55-4913-af70-a37a6db2bcaa unique_id: 70bdffbe-dc55-4913-af70-a37a6db2bcaa
unit_of_measurement: '°F' unit_of_measurement: '°F'
value_template: > state: >
{% set ns = namespace(temps=[]) %} {% set ns = namespace(temps=[]) %}
{% set x = state_attr('weather.iron_nerd_weather_station_hourly','forecast') | count %} {% set x = state_attr('weather.iron_nerd_weather_station_hourly','forecast') | count %}
{% set pd = state_attr('weather.iron_nerd_weather_station_hourly','forecast') %} {% set pd = state_attr('weather.iron_nerd_weather_station_hourly','forecast') %}
@ -1098,19 +1082,17 @@ sensor:
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ ns.temps | min | int }} {{ ns.temps | min | int }}
icon_template: mdi:thermometer icon: mdi:thermometer
rain_24hr: - name: 'Rain - 24 Hours'
friendly_name: 'Rain - 24 Hours'
unique_id: 26d2b945-f676-4c3c-8a4f-4b3b909d62dd unique_id: 26d2b945-f676-4c3c-8a4f-4b3b909d62dd
unit_of_measurement: 'in' unit_of_measurement: 'in'
value_template: "{{ state_attr('sensor.rain_factor','day_0_rain') | float }}" state: "{{ state_attr('sensor.rain_factor','day_0_rain') | float }}"
icon_template: mdi:weather-rainy icon: mdi:weather-rainy
today_corrected_high_temp: - name: 'Today Corrected High Temp'
friendly_name: 'Today Corrected High Temp'
unique_id: c0c40ec1-605e-4739-a935-ac0a2937fab2 unique_id: c0c40ec1-605e-4739-a935-ac0a2937fab2
unit_of_measurement: °F unit_of_measurement: °F
value_template: "{{ states('input_number.today_corrected_high_temp') | int }}" state: "{{ states('input_number.today_corrected_high_temp') | int }}"
icon_template: mdi:thermometer-high icon: mdi:thermometer-high
input_number: input_number:
today_corrected_high_temp: today_corrected_high_temp:

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 has_time: true
icon: mdi:alarm 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: automation:
- id: 67fbdb66-b94b-4351-86de-a388d601e93c - id: 67fbdb66-b94b-4351-86de-a388d601e93c
alias: Kallen Meds Handler alias: Kallen Meds Handler

View File

@ -303,135 +303,6 @@ input_text:
tina_desk_selected_scene: tina_desk_selected_scene:
name: 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: template:
- binary_sensor: - binary_sensor:
- name: Basement Lights Sync Issue - name: Basement Lights Sync Issue
@ -532,6 +403,118 @@ template:
{% endif %} {% endif %}
device_class: problem device_class: problem
delay_on: "00:00:10" 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: switch:
- platform: animated_scenes - platform: animated_scenes

View File

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

View File

@ -85,29 +85,26 @@ template:
off off
{% endif %} {% endif %}
icon: mdi:school icon: mdi:school
- sensor:
sensor: - name: School Start Days2go
- platform: template
sensors:
school_start_days2go:
unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9 unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_first_day') }} {{ count_the_days('input_datetime.school_first_day') }}
attribute_templates: attributes:
date: "{{ state_attr('input_datetime.school_first_day','timestamp') | timestamp_custom('%B %d, %Y') }}" date: "{{ state_attr('input_datetime.school_first_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
school_end_days2go: - name: School End Days2go
unique_id: 589c44ec-7e16-4c72-a264-cdf54de409a9 unique_id: 589c44ec-7e16-4c72-a264-cdf54de409a9
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.school_last_day') | int }} {{ count_the_days('input_datetime.school_last_day') | int }}
attribute_templates: attributes:
date: "{{ state_attr('input_datetime.school_last_day','timestamp') | timestamp_custom('%B %d, %Y') }}" date: "{{ state_attr('input_datetime.school_last_day','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
vacation_days2go: - name: Vacation Days2go
unique_id: f1628d87-e58a-4d1a-8a49-a71f0a9ed3e5 unique_id: f1628d87-e58a-4d1a-8a49-a71f0a9ed3e5
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{% if state_attr('calendar.vacation', 'start_time') %} {% if state_attr('calendar.vacation', 'start_time') %}
{{ count_the_days('calendar.vacation','start_time') }} {{ count_the_days('calendar.vacation','start_time') }}
@ -115,40 +112,39 @@ sensor:
999 999
{% endif %} {% endif %}
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
thanksgiving_break_days2go: - name: Thanksgiving Break Days2go
unique_id: 2381e9de-407b-4304-b09a-448c169bbaf2 unique_id: 2381e9de-407b-4304-b09a-448c169bbaf2
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.thanksgiving_break_start') }} {{ count_the_days('input_datetime.thanksgiving_break_start') }}
attribute_templates: attributes:
date: "{{ state_attr('input_datetime.thanksgiving_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}" date: "{{ state_attr('input_datetime.thanksgiving_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
christmas_break_days2go: - name: Christmas Break Days2go
unique_id: 851700f7-c593-4db8-ba4f-001cbffcfc4a unique_id: 851700f7-c593-4db8-ba4f-001cbffcfc4a
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.christmas_break_start') }} {{ count_the_days('input_datetime.christmas_break_start') }}
attribute_templates: attributes:
date: "{{ state_attr('input_datetime.christmas_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}" date: "{{ state_attr('input_datetime.christmas_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
spring_break_days2go: - name: Spring Break Days2go
unique_id: cec6e687-8999-4548-991c-02ba546335f5 unique_id: cec6e687-8999-4548-991c-02ba546335f5
value_template: > state: >
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{{ count_the_days('input_datetime.spring_break_start') }} {{ count_the_days('input_datetime.spring_break_start') }}
attribute_templates: attributes:
date: "{{ state_attr('input_datetime.spring_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}" date: "{{ state_attr('input_datetime.spring_break_start','timestamp') | timestamp_custom('%B %d, %Y') }}"
unit_of_measurement: 'Days' unit_of_measurement: 'Days'
kallen_lunch_menu_week: - name: Lunch Menu Week
friendly_name: Lunch Menu Week
unique_id: 62ba9dcb-3cd3-4875-8e6f-86bebf542c37 unique_id: 62ba9dcb-3cd3-4875-8e6f-86bebf542c37
value_template: > state: >
{% if is_state('calendar.elementary_school_lunch','on') %} {% if is_state('calendar.elementary_school_lunch','on') %}
{{ state_attr('calendar.elementary_school_lunch','message') }} {{ state_attr('calendar.elementary_school_lunch','message') }}
{% else %} {% else %}
No Menu No Menu
{% endif %} {% endif %}
icon_template: > icon: >
{% if is_state_attr('calendar.elementary_school_lunch','message','First Menu') %} {% if is_state_attr('calendar.elementary_school_lunch','message','First Menu') %}
mdi:numeric-1-circle mdi:numeric-1-circle
{% elif is_state_attr('calendar.elementary_school_lunch','message','Second Menu') %} {% elif is_state_attr('calendar.elementary_school_lunch','message','Second Menu') %}
@ -160,10 +156,9 @@ sensor:
{% else %} {% else %}
mdi:calendar-end mdi:calendar-end
{% endif %} {% endif %}
kallen_lunch_menu_items: - name: Lunch Menu Items
friendly_name: Lunch Menu Items
unique_id: a2cb62d7-ae9f-4bab-81c1-81f2006391b2 unique_id: a2cb62d7-ae9f-4bab-81c1-81f2006391b2
icon_template: > icon: >
{% set week = states('sensor.kallen_lunch_menu_week') %} {% set week = states('sensor.kallen_lunch_menu_week') %}
{% if week == 'First Menu' %} {% if week == 'First Menu' %}
mdi:numeric-1-circle mdi:numeric-1-circle
@ -176,7 +171,7 @@ sensor:
{% else %} {% else %}
mdi:calendar-end mdi:calendar-end
{% endif %} {% endif %}
value_template: > state: >
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% set week = states('sensor.kallen_lunch_menu_week') %} {% set week = states('sensor.kallen_lunch_menu_week') %}

View File

@ -126,14 +126,12 @@ alarm_control_panel:
who: living_room who: living_room
call_security_not_armed: 1 call_security_not_armed: 1
sensor: template:
- platform: template - sensor:
sensors: - name: "Windows"
windows_open:
friendly_name: "Windows"
unique_id: 780770d2-8b5a-4c96-aee4-459281cc3471 unique_id: 780770d2-8b5a-4c96-aee4-459281cc3471
unit_of_measurement: 'open' unit_of_measurement: 'open'
value_template: >- state: >-
{% set windows = [ {% set windows = [
states.binary_sensor.front_window_near, states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window, states.binary_sensor.kitchen_big_window,
@ -142,7 +140,7 @@ sensor:
] %} ] %}
{% set windows_open = windows | selectattr('state','eq','on') | list | count %} {% set windows_open = windows | selectattr('state','eq','on') | list | count %}
{{ windows_open }} {{ windows_open }}
icon_template: >- icon: >-
{% set windows = [ {% set windows = [
states.binary_sensor.front_window_near, states.binary_sensor.front_window_near,
states.binary_sensor.kitchen_big_window, states.binary_sensor.kitchen_big_window,
@ -155,18 +153,17 @@ sensor:
{% else %} {% else %}
mdi:window-open mdi:window-open
{% endif %} {% endif %}
doors_open: #! This sensor is only for exterior doors, and interior doors that are NOT excluded from security protocols - name: "Doors" #! 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 unique_id: 61b1a98a-51a4-4faa-947d-7883de2430c0
unit_of_measurement: 'open' unit_of_measurement: 'open'
value_template: >- state: >-
{% set doors = [ {% set doors = [
states.binary_sensor.front_door, states.binary_sensor.front_door,
states.binary_sensor.back_door, states.binary_sensor.back_door,
] %} ] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %} {% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }} {{ doors_open }}
icon_template: >- icon: >-
{% set doors = [ {% set doors = [
states.binary_sensor.front_door, states.binary_sensor.front_door,
states.binary_sensor.back_door, states.binary_sensor.back_door,
@ -177,18 +174,17 @@ sensor:
{% else %} {% else %}
mdi:door-open mdi:door-open
{% endif %} {% endif %}
interior_doors_open: # This sensor is not used for security purposes, only for information - name: "Interior Doors" # This sensor is not used for security purposes, only for information
friendly_name: "Interior Doors"
unique_id: 772aa056-881a-4778-ba5b-19e46afc107a unique_id: 772aa056-881a-4778-ba5b-19e46afc107a
unit_of_measurement: 'open' unit_of_measurement: 'open'
value_template: >- state: >-
{% set doors = [ {% set doors = [
states.binary_sensor.basement_studio_door, states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door, states.binary_sensor.downstairs_bathroom_door,
] %} ] %}
{% set doors_open = doors | selectattr('state','eq','on') | list | count %} {% set doors_open = doors | selectattr('state','eq','on') | list | count %}
{{ doors_open }} {{ doors_open }}
icon_template: >- icon: >-
{% set doors = [ {% set doors = [
states.binary_sensor.basement_studio_door, states.binary_sensor.basement_studio_door,
states.binary_sensor.downstairs_bathroom_door, states.binary_sensor.downstairs_bathroom_door,
@ -199,15 +195,14 @@ sensor:
{% else %} {% else %}
mdi:door-open mdi:door-open
{% endif %} {% endif %}
total_faults: - name: Faults
friendly_name: Faults
unique_id: 1629a83a-a46c-4041-9e49-8e54c5195388 unique_id: 1629a83a-a46c-4041-9e49-8e54c5195388
unit_of_measurement: 'open' unit_of_measurement: 'open'
value_template: >- state: >-
{% set windows_open = states('sensor.windows_open') | int %} {% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %} {% set doors_open = states('sensor.doors_open') | int %}
{{ doors_open + windows_open }} {{ doors_open + windows_open }}
icon_template: >- icon: >-
{% set windows_open = states('sensor.windows_open') | int %} {% set windows_open = states('sensor.windows_open') | int %}
{% set doors_open = states('sensor.doors_open') | int %} {% set doors_open = states('sensor.doors_open') | int %}
{% set faults = ( doors_open + windows_open ) %} {% set faults = ( doors_open + windows_open ) %}

View File

@ -50,28 +50,6 @@ command_line:
scan_interval: 20000 scan_interval: 20000
unit_of_measurement: '' 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: mqtt:
sensor: sensor:
- name: "Uptime Kuma Status" - name: "Uptime Kuma Status"
@ -127,6 +105,22 @@ template:
state: "{{ states('sensor.asus_laptop_system_idle_time') | int > 1800 }}" state: "{{ states('sensor.asus_laptop_system_idle_time') | int > 1800 }}"
attributes: attributes:
idle_time: "{{ states('sensor.asus_laptop_system_idle_time') }}s" 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 # - platform: influxdb
# host: 192.168.1.26 # 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: intent_script:
SetTimer: SetTimer:
action: action:

View File

@ -38,6 +38,21 @@ input_datetime:
has_time: true has_time: true
icon: mdi:medical-bag 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: automation:
- id: c583aebf-4500-412c-9436-e1b534ba1a44 - id: c583aebf-4500-412c-9436-e1b534ba1a44
alias: Tony Meds Handler 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

View File

@ -47,17 +47,15 @@
################################################################################ ################################################################################
## sensor ## ## sensor ##
sensor: template:
- platform: template - sensor:
sensors: ## You can add your county or city name to sensorname for personalization
weatheralerts_active_alerts:
## You can add your county or city name to friendly_name for personalization
## For example: Weather Alerts for YourCountyName ## For example: Weather Alerts for YourCountyName
friendly_name: Weather Alerts - name: Weather Alerts
unique_id: 32371252-89ff-47b2-86e3-32ef92a05205 unique_id: 32371252-89ff-47b2-86e3-32ef92a05205
unit_of_measurement: Alerts unit_of_measurement: Alerts
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% set alerts_total = namespace(count=0) %} {% set alerts_total = namespace(count=0) %}
{% if (state_attr('sensor.weatheralerts', 'alerts')) %} {% if (state_attr('sensor.weatheralerts', 'alerts')) %}
{% for alert in state_attr('sensor.weatheralerts', 'alerts') %} {% for alert in state_attr('sensor.weatheralerts', 'alerts') %}
@ -67,7 +65,7 @@ sensor:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{{ alerts_total.count }} {{ alerts_total.count }}
attribute_templates: attributes:
warning_count: >- warning_count: >-
{% set warnings = namespace(count=0) %} {% set warnings = namespace(count=0) %}
{% if (state_attr('sensor.weatheralerts', 'alerts')) %} {% if (state_attr('sensor.weatheralerts', 'alerts')) %}
@ -228,17 +226,16 @@ sensor:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{{ test.count }} {{ test.count }}
weatheralerts_alert_1: - name: Weather Alert 1
friendly_name: Weather Alert 1
unique_id: 752fb9ae-a61f-41f8-8882-f8d025b892e3 unique_id: 752fb9ae-a61f-41f8-8882-f8d025b892e3
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[0] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} {% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[0] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %}
on on
{% else %} {% else %}
off off
{% endif %} {% endif %}
attribute_templates: attributes:
alert_id: >- alert_id: >-
{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %} {% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].id }} {{ states.sensor.weatheralerts.attributes.alerts[0].id }}
@ -392,17 +389,16 @@ sensor:
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_2: - name: Weather Alert 2
friendly_name: Weather Alert 2
unique_id: 4ecaa8ce-65ec-429f-956c-ac478f1c3d6f unique_id: 4ecaa8ce-65ec-429f-956c-ac478f1c3d6f
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[1] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} {% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[1] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %}
on on
{% else %} {% else %}
off off
{% endif %} {% endif %}
attribute_templates: attributes:
alert_id: >- alert_id: >-
{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %} {% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].id }} {{ states.sensor.weatheralerts.attributes.alerts[1].id }}
@ -556,17 +552,16 @@ sensor:
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_3: - name: Weather Alert 3
friendly_name: Weather Alert 3
unique_id: 0dcc3731-c90e-427a-abd9-dee29a5ed1e1 unique_id: 0dcc3731-c90e-427a-abd9-dee29a5ed1e1
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[2] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} {% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[2] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %}
on on
{% else %} {% else %}
off off
{% endif %} {% endif %}
attribute_templates: attributes:
alert_id: >- alert_id: >-
{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %} {% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].id }} {{ states.sensor.weatheralerts.attributes.alerts[2].id }}
@ -720,17 +715,16 @@ sensor:
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_4: - name: Weather Alert 4
friendly_name: Weather Alert 4
unique_id: 18f756d2-f3aa-476f-a1c0-12c70f173ead unique_id: 18f756d2-f3aa-476f-a1c0-12c70f173ead
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[3] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} {% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[3] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %}
on on
{% else %} {% else %}
off off
{% endif %} {% endif %}
attribute_templates: attributes:
alert_id: >- alert_id: >-
{% if states('sensor.weatheralerts')|int > 3 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_4') == "on") %} {% if states('sensor.weatheralerts')|int > 3 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_4') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[3].id }} {{ states.sensor.weatheralerts.attributes.alerts[3].id }}
@ -884,17 +878,16 @@ sensor:
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_5: - name: Weather Alert 5
friendly_name: Weather Alert 5
unique_id: c9690a26-84e8-439d-9718-469b227c4d66 unique_id: c9690a26-84e8-439d-9718-469b227c4d66
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: >- state: >-
{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[4] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[4].endsExpires) - as_timestamp(now()) > 0)) %} {% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[4] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[4].endsExpires) - as_timestamp(now()) > 0)) %}
on on
{% else %} {% else %}
off off
{% endif %} {% endif %}
attribute_templates: attributes:
alert_id: >- alert_id: >-
{% if states('sensor.weatheralerts')|int > 4 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_5') == "on") %} {% if states('sensor.weatheralerts')|int > 4 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_5') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[4].id }} {{ states.sensor.weatheralerts.attributes.alerts[4].id }}
@ -1048,49 +1041,49 @@ sensor:
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_1_last_changed: - name: Weatheralerts Alert 1 Last Changed
unique_id: 3db32f1f-a6d3-4321-9078-2577d403f314 unique_id: 3db32f1f-a6d3-4321-9078-2577d403f314
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_1') == "on" %} {% if states('sensor.weatheralerts_alert_1') == "on" %}
{{ states.sensor.weatheralerts_alert_1.last_updated }} {{ states.sensor.weatheralerts_alert_1.last_updated }}
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_2_last_changed: - name: Weatheralerts Alert 2 Last Changed
unique_id: 75e746a0-b776-4dbb-b018-1e808a204f65 unique_id: 75e746a0-b776-4dbb-b018-1e808a204f65
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_2') == "on" %} {% if states('sensor.weatheralerts_alert_2') == "on" %}
{{ states.sensor.weatheralerts_alert_2.last_updated }} {{ states.sensor.weatheralerts_alert_2.last_updated }}
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_3_last_changed: - name: Weatheralerts Alert 3 Last Changed
unique_id: 4382f9a3-32bf-42f9-809f-ae33f33140b7 unique_id: 4382f9a3-32bf-42f9-809f-ae33f33140b7
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_3') == "on" %} {% if states('sensor.weatheralerts_alert_3') == "on" %}
{{ states.sensor.weatheralerts_alert_3.last_updated }} {{ states.sensor.weatheralerts_alert_3.last_updated }}
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_4_last_changed: - name: Weatheralerts Alert 4 Last Changed
unique_id: 4fbf5547-eac4-4ebf-b5fc-b043fafc0026 unique_id: 4fbf5547-eac4-4ebf-b5fc-b043fafc0026
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_4') == "on" %} {% if states('sensor.weatheralerts_alert_4') == "on" %}
{{ states.sensor.weatheralerts_alert_4.last_updated }} {{ states.sensor.weatheralerts_alert_4.last_updated }}
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_5_last_changed: - name: Weatheralerts Alert 5 Last Changed
unique_id: d7b66a73-8431-433c-8cd1-d413d726cb0a unique_id: d7b66a73-8431-433c-8cd1-d413d726cb0a
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_5') == "on" %} {% if states('sensor.weatheralerts_alert_5') == "on" %}
{{ states.sensor.weatheralerts_alert_5.last_updated }} {{ states.sensor.weatheralerts_alert_5.last_updated }}
{% else %} {% else %}
None None
{% endif %} {% endif %}
weatheralerts_alert_1_most_recent_active_alert: - name: Weatheralerts Alert 1 Most Recent Active Alert
unique_id: 569944e9-b4cf-4ed2-9bed-40b2a0a9b898 unique_id: 569944e9-b4cf-4ed2-9bed-40b2a0a9b898
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_1_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_1') != 'on' %} {% if states('sensor.weatheralerts_alert_1_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_1') != 'on' %}
unavailable unavailable
{% elif states('sensor.weatheralerts_alert_1_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_1') != 'on' %} {% elif states('sensor.weatheralerts_alert_1_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_1') != 'on' %}
@ -1102,7 +1095,7 @@ sensor:
{% else %} {% else %}
{{ states('sensor.weatheralerts_alert_1_most_recent_active_alert') }} {{ states('sensor.weatheralerts_alert_1_most_recent_active_alert') }}
{% endif %} {% endif %}
attribute_templates: attributes:
alert_effective: >- alert_effective: >-
{% if states('sensor.weatheralerts_alert_1_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_1') != 'on' %} {% if states('sensor.weatheralerts_alert_1_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_1') != 'on' %}
unavailable unavailable
@ -1127,9 +1120,9 @@ sensor:
{% else %} {% else %}
{{ state_attr('sensor.weatheralerts_alert_1_most_recent_active_alert', 'alert_id') }} {{ state_attr('sensor.weatheralerts_alert_1_most_recent_active_alert', 'alert_id') }}
{% endif %} {% endif %}
weatheralerts_alert_2_most_recent_active_alert: - name: Weatheralerts Alert 2 Most Recent Active Alert
unique_id: 8112afda-58b9-4161-809c-9186212f86d7 unique_id: 8112afda-58b9-4161-809c-9186212f86d7
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_2_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_2') != 'on' %} {% if states('sensor.weatheralerts_alert_2_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_2') != 'on' %}
unavailable unavailable
{% elif states('sensor.weatheralerts_alert_2_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_2') != 'on' %} {% elif states('sensor.weatheralerts_alert_2_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_2') != 'on' %}
@ -1141,7 +1134,7 @@ sensor:
{% else %} {% else %}
{{ states('sensor.weatheralerts_alert_2_most_recent_active_alert') }} {{ states('sensor.weatheralerts_alert_2_most_recent_active_alert') }}
{% endif %} {% endif %}
attribute_templates: attributes:
alert_effective: >- alert_effective: >-
{% if states('sensor.weatheralerts_alert_2_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_2') != 'on' %} {% if states('sensor.weatheralerts_alert_2_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_2') != 'on' %}
unavailable unavailable
@ -1166,9 +1159,9 @@ sensor:
{% else %} {% else %}
{{ state_attr('sensor.weatheralerts_alert_2_most_recent_active_alert', 'alert_id') }} {{ state_attr('sensor.weatheralerts_alert_2_most_recent_active_alert', 'alert_id') }}
{% endif %} {% endif %}
weatheralerts_alert_3_most_recent_active_alert: - name: Weatheralerts Alert 3 Most Recent Active Alert
unique_id: f71f4ab7-0959-43e9-877a-22084b9642c3 unique_id: f71f4ab7-0959-43e9-877a-22084b9642c3
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_3_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_3') != 'on' %} {% if states('sensor.weatheralerts_alert_3_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_3') != 'on' %}
unavailable unavailable
{% elif states('sensor.weatheralerts_alert_3_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_3') != 'on' %} {% elif states('sensor.weatheralerts_alert_3_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_3') != 'on' %}
@ -1180,7 +1173,7 @@ sensor:
{% else %} {% else %}
{{ states('sensor.weatheralerts_alert_3_most_recent_active_alert') }} {{ states('sensor.weatheralerts_alert_3_most_recent_active_alert') }}
{% endif %} {% endif %}
attribute_templates: attributes:
alert_effective: >- alert_effective: >-
{% if states('sensor.weatheralerts_alert_3_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_3') != 'on' %} {% if states('sensor.weatheralerts_alert_3_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_3') != 'on' %}
unavailable unavailable
@ -1205,9 +1198,9 @@ sensor:
{% else %} {% else %}
{{ state_attr('sensor.weatheralerts_alert_3_most_recent_active_alert', 'alert_id') }} {{ state_attr('sensor.weatheralerts_alert_3_most_recent_active_alert', 'alert_id') }}
{% endif %} {% endif %}
weatheralerts_alert_4_most_recent_active_alert: - name: Weatheralerts Alert 4 Most Recent Active Alert
unique_id: e663e42b-a6b2-4a55-a3d9-1932b10fb0ca unique_id: e663e42b-a6b2-4a55-a3d9-1932b10fb0ca
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_4_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_4') != 'on' %} {% if states('sensor.weatheralerts_alert_4_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_4') != 'on' %}
unavailable unavailable
{% elif states('sensor.weatheralerts_alert_4_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_4') != 'on' %} {% elif states('sensor.weatheralerts_alert_4_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_4') != 'on' %}
@ -1219,7 +1212,7 @@ sensor:
{% else %} {% else %}
{{ states('sensor.weatheralerts_alert_4_most_recent_active_alert') }} {{ states('sensor.weatheralerts_alert_4_most_recent_active_alert') }}
{% endif %} {% endif %}
attribute_templates: attributes:
alert_effective: >- alert_effective: >-
{% if states('sensor.weatheralerts_alert_4_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_4') != 'on' %} {% if states('sensor.weatheralerts_alert_4_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_4') != 'on' %}
unavailable unavailable
@ -1244,9 +1237,9 @@ sensor:
{% else %} {% else %}
{{ state_attr('sensor.weatheralerts_alert_4_most_recent_active_alert', 'alert_id') }} {{ state_attr('sensor.weatheralerts_alert_4_most_recent_active_alert', 'alert_id') }}
{% endif %} {% endif %}
weatheralerts_alert_5_most_recent_active_alert: - name: Weatheralerts Alert 5 Most Recent Active Alert
unique_id: 523d7026-1fdd-4621-91c0-87e0bd98f14d unique_id: 523d7026-1fdd-4621-91c0-87e0bd98f14d
value_template: >- state: >-
{% if states('sensor.weatheralerts_alert_5_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_5') != 'on' %} {% if states('sensor.weatheralerts_alert_5_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_5') != 'on' %}
unavailable unavailable
{% elif states('sensor.weatheralerts_alert_5_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_5') != 'on' %} {% elif states('sensor.weatheralerts_alert_5_most_recent_active_alert') == 'unavailable' and states('sensor.weatheralerts_alert_5') != 'on' %}
@ -1258,7 +1251,7 @@ sensor:
{% else %} {% else %}
{{ states('sensor.weatheralerts_alert_5_most_recent_active_alert') }} {{ states('sensor.weatheralerts_alert_5_most_recent_active_alert') }}
{% endif %} {% endif %}
attribute_templates: attributes:
alert_effective: >- alert_effective: >-
{% if states('sensor.weatheralerts_alert_5_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_5') != 'on' %} {% if states('sensor.weatheralerts_alert_5_most_recent_active_alert') == '' and states('sensor.weatheralerts_alert_5') != 'on' %}
unavailable unavailable
@ -1283,11 +1276,10 @@ sensor:
{% else %} {% else %}
{{ state_attr('sensor.weatheralerts_alert_5_most_recent_active_alert', 'alert_id') }} {{ state_attr('sensor.weatheralerts_alert_5_most_recent_active_alert', 'alert_id') }}
{% endif %} {% endif %}
weatheralerts_alerts_are_active: - name: Weather Alerts Are Active
friendly_name: Weather Alerts Are Active
unique_id: 3f6ecba1-c102-4324-b56e-6d80ead0c829 unique_id: 3f6ecba1-c102-4324-b56e-6d80ead0c829
icon_template: mdi:alert-rhombus icon: mdi:alert-rhombus
value_template: > state: >
{% if (states('sensor.weatheralerts') | int > 0) or ((states('sensor.weatheralerts') == 'unavailable') and (states('sensor.weatheralerts_alert_1') == 'on')) %} {% if (states('sensor.weatheralerts') | int > 0) or ((states('sensor.weatheralerts') == 'unavailable') and (states('sensor.weatheralerts_alert_1') == 'on')) %}
Yes Yes
{% else %} {% else %}

View File

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

View File

@ -1,36 +1,23 @@
- platform: twitch_helix - sensor:
client_id: !secret twitch_client_id - name: 'Basement TV Current App'
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 unique_id: 838c2320-24b6-4555-959e-0546580ae8b2
value_template: >- state: >-
{% if is_state('media_player.basement_tv','off') %} {% if is_state('media_player.basement_tv','off') %}
Off Off
{% else %} {% else %}
{{ state_attr('media_player.basement_tv','app_name') }} {{ state_attr('media_player.basement_tv','app_name') }}
{% endif %} {% endif %}
living_room_tv_current_app: - name: 'Living Room TV Current App'
friendly_name: 'Living Room TV Current App'
unique_id: b03de99d-b7fa-4f4c-8cdf-758c906dffe4 unique_id: b03de99d-b7fa-4f4c-8cdf-758c906dffe4
value_template: >- state: >-
{% if is_state('media_player.living_room_tv','off') %} {% if is_state('media_player.living_room_tv','off') %}
Off Off
{% else %} {% else %}
{{ state_attr('media_player.living_room_tv','app_name') }} {{ state_attr('media_player.living_room_tv','app_name') }}
{% endif %} {% endif %}
master_bedroom_tv_current_app: - name: 'Master Bedroom TV Current App'
friendly_name: 'Master Bedroom TV Current App'
unique_id: 4bf4bef3-fc81-4259-a75c-6693ceba0926 unique_id: 4bf4bef3-fc81-4259-a75c-6693ceba0926
value_template: >- state: >-
{% if is_state('media_player.master_bedroom_firetv','off') %} {% if is_state('media_player.master_bedroom_firetv','off') %}
Off Off
{% else %} {% else %}

View File

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

View File

@ -1,63 +1,31 @@
- platform: rest - sensor:
name: Kallen Tasks - name: 'Bug Reports'
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 unique_id: d9c3d6c5-f28f-4b60-a19f-355c8e58f9cb
value_template: "{{ states('sensor.home_tech') }}" state: "{{ states('sensor.home_tech') }}"
attribute_templates: attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}" 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 }}" items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '94865633')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_improvements: - name: 'Improvements'
friendly_name: 'Improvements'
unique_id: f1af501a-de94-4951-a841-9ef82a08bb95 unique_id: f1af501a-de94-4951-a841-9ef82a08bb95
value_template: "{{ states('sensor.home_tech') }}" state: "{{ states('sensor.home_tech') }}"
attribute_templates: attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}" 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 }}" items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '114199257')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_in_progress: - name: 'In Progress'
friendly_name: 'In Progress'
unique_id: ea820db3-3b17-49a5-8ab9-b5d1e89c5da1 unique_id: ea820db3-3b17-49a5-8ab9-b5d1e89c5da1
value_template: "{{ states('sensor.home_tech') }}" state: "{{ states('sensor.home_tech') }}"
attribute_templates: attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}" 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 }}" items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '81234677')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_long_term: - name: 'Long Term or Maintaining'
friendly_name: 'Long Term or Maintaining'
unique_id: 4c807471-6d9a-4f64-bad9-893a330a9499 unique_id: 4c807471-6d9a-4f64-bad9-893a330a9499
value_template: "{{ states('sensor.home_tech') }}" state: "{{ states('sensor.home_tech') }}"
attribute_templates: attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}" 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 }}" items: "{{ state_attr('sensor.home_tech', 'items')|selectattr('section_id', 'eq', '88456343')|list|selectattr('parent_id','eq',none)|list }}"
home_tech_postponed_indefinitely: - name: 'Postponed Indefinitely'
friendly_name: 'Postponed Indefinitely'
unique_id: eadb779a-eb65-4cc8-a184-fb5d6f29c48d unique_id: eadb779a-eb65-4cc8-a184-fb5d6f29c48d
value_template: "{{ states('sensor.home_tech') }}" state: "{{ states('sensor.home_tech') }}"
attribute_templates: attributes:
project: "{{ state_attr('sensor.home_tech', 'project') }}" 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 }}" 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 - sensor:
sensors: - name: 'Today is'
today_is:
friendly_name: 'Today is'
unique_id: 18e7d262-14f6-4f67-a291-8faf85d4104d unique_id: 18e7d262-14f6-4f67-a291-8faf85d4104d
value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}" state: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}"
month_is: - name: 'Month is'
friendly_name: 'Month is'
unique_id: fd7a9fe3-4a29-4235-8959-b26d79c6646c unique_id: fd7a9fe3-4a29-4235-8959-b26d79c6646c
value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}" state: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}"
kallen_timer_remaining_minutes: - name: 'Kallen Timer Remaining Minutes'
friendly_name: 'Kallen Timer Remaining Minutes'
unique_id: ca06c860-2bc7-4c16-810b-c338724459ca unique_id: ca06c860-2bc7-4c16-810b-c338724459ca
value_template: >- state: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %} {% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else {{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%M', false) }} (as_datetime(f) - now()).total_seconds() | timestamp_custom('%M', false) }}
kallen_timer_remaining_seconds: - name: 'Kallen Timer Remaining Seconds'
friendly_name: 'Kallen Timer Remaining Seconds'
unique_id: d81d5726-1229-4c0c-846c-69aeeead7313 unique_id: d81d5726-1229-4c0c-846c-69aeeead7313
value_template: >- state: >-
{% set f = state_attr('timer.kallen_timer','finishes_at') %} {% set f = state_attr('timer.kallen_timer','finishes_at') %}
{{ '00' if f == none else {{ '00' if f == none else
(as_datetime(f) - now()).total_seconds() | timestamp_custom('%S', false) }} (as_datetime(f) - now()).total_seconds() | timestamp_custom('%S', false) }}
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'

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') }}