mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
247 lines
10 KiB
YAML
247 lines
10 KiB
YAML
template:
|
|
- sensor:
|
|
# - unique_id: templatesensor.hvac_mode
|
|
# default_entity_id: sensor.hvac_mode
|
|
# name: HVAC Mode
|
|
# state: '{{states("climate.thermostat")}}'
|
|
|
|
- unique_id: templatesensor.hvac_equipment_running
|
|
default_entity_id: sensor.hvac_equipment_running
|
|
name: HVAC Equipment Running
|
|
state: '{{state_attr("climate.thermostat", "equipment_running")|default("none", true)}}'
|
|
|
|
- unique_id: templatesensor.hvac_action
|
|
default_entity_id: sensor.hvac_action
|
|
state: '{{state_attr("climate.thermostat", "hvac_action")}}'
|
|
name: HVAC Action
|
|
|
|
- unique_id: templatesensor.clint_status
|
|
default_entity_id: sensor.clint_status
|
|
state: "{{ states.input_select.clint_status_dropdown.state }}"
|
|
name: "Clint"
|
|
|
|
- unique_id: templatesensor.emmett_status
|
|
default_entity_id: sensor.emmett_status
|
|
state: "{{ states.input_select.emmett_status_dropdown.state }}"
|
|
name: "Emmett"
|
|
|
|
- unique_id: templatesensor.bridget_status
|
|
default_entity_id: sensor.bridget_status
|
|
state: "{{ states.input_select.bridget_status_dropdown.state }}"
|
|
name: "Bridget"
|
|
|
|
- unique_id: templatesensor.kristy_status
|
|
default_entity_id: sensor.kristy_status
|
|
state: "{{ states.input_select.kristy_status_dropdown.state }}"
|
|
name: "Kristy"
|
|
|
|
- unique_id: templatesensor.marshall_status
|
|
default_entity_id: sensor.marshall_status
|
|
state: "{{ states.input_select.marshall_status_dropdown.state }}"
|
|
name: "Marshall"
|
|
|
|
- unique_id: templatesensor.tess_status
|
|
default_entity_id: sensor.tess_status
|
|
state: "{{ states.input_select.tess_status_dropdown.state }}"
|
|
name: "Tess"
|
|
|
|
- unique_id: templatesensor.ebin_status
|
|
default_entity_id: sensor.ebin_status
|
|
state: "{{ states.input_select.ebin_status_dropdown.state }}"
|
|
name: "Ebin"
|
|
|
|
- unique_id: templatesensor.people_count
|
|
default_entity_id: sensor.people_count
|
|
name: "People Count"
|
|
state: >
|
|
{{[ states.input_boolean.clint_home,
|
|
states.input_boolean.emmett_home,
|
|
states.input_boolean.bridget_home,
|
|
states.input_boolean.kristy_home,
|
|
states.input_boolean.marshall_home,
|
|
states.input_boolean.tess_home,
|
|
states.input_boolean.ebin_home,
|
|
states.input_boolean.guest_home ]
|
|
| selectattr('state', 'eq', 'on') | list | count}}
|
|
|
|
- unique_id: templatesensor.count_automations
|
|
default_entity_id: sensor.count_automations
|
|
state: "{{ states.automation | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_scripts
|
|
default_entity_id: sensor.count_scripts
|
|
state: "{{ states.script | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_device_trackers
|
|
default_entity_id: sensor.count_device_trackers
|
|
state: "{{ states.device_tracker | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_binary_sensors
|
|
default_entity_id: sensor.count_binary_sensors
|
|
state: "{{ states.binary_sensor | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_sensors
|
|
default_entity_id: sensor.count_sensors
|
|
state: "{{ states.sensor | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_switches
|
|
default_entity_id: sensor.count_switches
|
|
state: "{{ states.switch | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_zones
|
|
default_entity_id: sensor.count_zones
|
|
state: "{{ states.zone | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_input_booleans
|
|
default_entity_id: sensor.count_input_booleans
|
|
state: "{{ states.input_boolean | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_input_numbers
|
|
default_entity_id: sensor.count_input_numbers
|
|
state: "{{ states.input_number | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_input_texts
|
|
default_entity_id: sensor.count_input_texts
|
|
state: "{{ states.input_text | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_input_selects
|
|
default_entity_id: sensor.count_input_selects
|
|
state: "{{ states.input_select | list | length }}"
|
|
|
|
- unique_id: templatesensor.count_input_datetimes
|
|
default_entity_id: sensor.count_input_datetimes
|
|
state: "{{ states.input_datetime | list | length }}"
|
|
|
|
- unique_id: templatesensor.steam1_game
|
|
default_entity_id: sensor.steam1_game
|
|
state: >-
|
|
{% if state_attr('sensor.steam_76561197960668089', 'game') is not none%}
|
|
{{ state_attr('sensor.steam_76561197960668089', 'game') }}
|
|
{% else %}
|
|
{{ states('sensor.steam_76561197960668089') }}
|
|
{% endif %}
|
|
|
|
- unique_id: templatesensor.non_summer_per_kwh
|
|
default_entity_id: sensor.nonsummer_per_kwh
|
|
name: "Non-Summer Rate"
|
|
state: 0.100496
|
|
icon: mdi:currency-usd
|
|
unit_of_measurement: "$/kWh"
|
|
|
|
- unique_id: templatesensor.summer_nonpeak_per_kwh
|
|
default_entity_id: sensor.summernonpeak_per_kwh
|
|
name: "Summer Non-Peak Rate"
|
|
state: 0.100649
|
|
icon: mdi:currency-usd
|
|
unit_of_measurement: "$/kWh"
|
|
|
|
- unique_id: templatesensor.summerpeak_per_kwh
|
|
default_entity_id: sensor.summerpeak_per_kwh
|
|
name: "Summer Peak Rate"
|
|
state: 0.149656
|
|
icon: mdi:currency-usd
|
|
unit_of_measurement: "$/kWh"
|
|
|
|
- unique_id: templatesensor.energy_cost
|
|
default_entity_id: sensor.energy_cost
|
|
name: "Energy Cost"
|
|
state: >-
|
|
{% if now().month > 9 or now().month < 6 -%}
|
|
0.100496
|
|
{%- else -%}
|
|
{%- if now().weekday() < 5 and now().hour >= 14 and now().hour <= 19 -%}
|
|
0.149656
|
|
{%- else -%}
|
|
0.100649
|
|
{%- endif -%}
|
|
{% endif %}
|
|
icon: mdi:currency-usd
|
|
unit_of_measurement: "$/kWh"
|
|
|
|
- unique_id: templatesensor.energy_tariff
|
|
default_entity_id: sensor.energy_tariff
|
|
name: "Energy Tariff"
|
|
state: >-
|
|
{% if now().month > 9 or now().month < 6 -%}
|
|
Non-Summer
|
|
{%- else -%}
|
|
{%- if now().weekday() < 5 and now().hour >= 14 and now().hour <= 19 -%}
|
|
Summer Peak
|
|
{%- else -%}
|
|
Summer Non-Peak
|
|
{%- endif -%}
|
|
{% endif %}
|
|
|
|
- unique_id: templatesensor.general_waste
|
|
default_entity_id: sensor.general_waste
|
|
name: "General Waste"
|
|
icon: mdi:trash-can
|
|
state: >-
|
|
{% if is_state('calendar.trash_schedule','on') %}
|
|
today
|
|
{% elif state_attr('calendar.trash_schedule','offset_reached') %}
|
|
tomorrow
|
|
{% else %}
|
|
future
|
|
{% endif %}
|
|
|
|
#my_room_status
|
|
- unique_id: temlatesensor.occupied_room_count
|
|
default_entity_id: sensor.occupied_room_count
|
|
name: Rooms Occupied
|
|
state: "{{ (expand('group.my_room_status') | selectattr('state', 'eq', 'on')) | list | count |int(default=0) }}"
|
|
icon: "{{ iif(is_state('group.my_room_status', 'on'), 'mdi:floor-plan','mdi:floor-plan') }}"
|
|
|
|
- unique_id: temlatesensor.speakers_on_count
|
|
default_entity_id: sensor.speakers_on_count
|
|
name: Speakers On
|
|
state: "{{ (expand('group.all_my_speakers') | selectattr('state', 'eq', 'playing')) | list | count |int(default=0) }}"
|
|
icon: "{{ iif(is_state('group.all_my_speakers', 'on'), 'mdi:speaker-multiple','mdi:speaker-off') }}"
|
|
|
|
- unique_id: temlatesensor.lights_on_count
|
|
default_entity_id: sensor.lights_on_count
|
|
name: Lights On
|
|
state: "{{ (expand('group.my_lights') | selectattr('state', 'eq', 'on')) | list | count |int(default=0) }}"
|
|
icon: "{{ iif(is_state('group.my_lights', 'on'), 'mdi:lightbulb-group','mdi:lightbulb-group-off') }}"
|
|
|
|
- unique_id: temlatesensor.open_windows_count
|
|
default_entity_id: sensor.open_windows_count
|
|
name: Open Windows
|
|
state: "{{ (expand('group.my_exterior_windows') | selectattr('state', 'eq', 'on')) | list | count |int(default=0) }}"
|
|
icon: "{{ iif(is_state('group.my_exterior_windows', 'on'), 'mdi:window-open-variant','mdi:window-closed-variant') }}"
|
|
|
|
- unique_id: temlatesensor.open_external_doors_count
|
|
default_entity_id: sensor.open_external_doors_count
|
|
name: Open External Doors
|
|
state: "{{ (expand('binary_sensor.exterior_doors') | selectattr('state', 'eq', 'on')) | list | count |int(default=0) }}"
|
|
icon: "{{ iif(is_state('binary_sensor.exterior_doors', 'on'), 'mdi:door-open','mdi:door') }}"
|
|
|
|
- unique_id: temlatesensor.frigate_person_count
|
|
default_entity_id: sensor.frigate_person_count
|
|
name: Frigate Person Count
|
|
state: >-
|
|
{{
|
|
states('sensor.boys_room_person_count')|int(default=0) +
|
|
states('sensor.computer_area_person_count')|int(default=0) +
|
|
states('sensor.dining_room_person_count')|int(default=0) +
|
|
states('sensor.entryway_person_count')|int(default=0) +
|
|
states('sensor.front_porch_person_count')|int(default=0) +
|
|
states('sensor.front_room_person_count')|int(default=0) +
|
|
states('sensor.furnace_room_person_count')|int(default=0) +
|
|
states('sensor.great_room_person_count')|int(default=0) +
|
|
states('sensor.kitchen_person_count')|int(default=0) +
|
|
states('sensor.master_bedroom_person_count')|int(default=0) +
|
|
states('sensor.girls_room_person_count')|int(default=0) +
|
|
states('sensor.utility_room_person_count')|int(default=0) +
|
|
states('sensor.walkway_person_count')|int(default=0) +
|
|
states('sensor.workshop_person_count')|int(default=0)
|
|
}}
|
|
icon: mdi:human-queue
|
|
|
|
# monitored_daily_kwh:
|
|
# unique_id: templatesensor.monitored_daily_kwh
|
|
# name: 'Monitored Daily [kWh]'
|
|
# icon: mdi:flash
|
|
# unit_of_measurement: kWh
|
|
# state: "{{ states('sensor.basement_and_laundry_lights_and_plugs_kwh')|float(default=0) + }}"
|