danVnest-home-assistant/configuration/climate/apparent_temperature.yaml

99 lines
3.9 KiB
YAML

template:
- sensor:
- name: Weighted average inside apparent temperature
state: >
{%- set value_weight_array = [
{'value': states('sensor.bathroom_apparent_temperature'), 'weight':1},
{'value': states('sensor.bedroom_apparent_temperature'), 'weight':3},
{'value': states('sensor.dining_room_apparent_temperature'), 'weight':1},
{'value': states('sensor.entryway_apparent_temperature'), 'weight':1},
{'value': states('sensor.kitchen_apparent_temperature'), 'weight':1},
{'value': states('sensor.living_room_apparent_temperature'), 'weight':4},
{'value': states('sensor.nursery_apparent_temperature'), 'weight':2},
{'value': states('sensor.office_apparent_temperature'), 'weight':1},
{'value': states('sensor.bathroom_apparent_temperature'), 'weight':1}]
-%}
{%- from 'custom_templates.jinja' import weighted_average -%}
{{- weighted_average(value_weight_array) -}}
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
icon: mdi:home-thermometer
availability: >
{{
has_value('sensor.bathroom_apparent_temperature') or
has_value('sensor.bedroom_apparent_temperature') or
has_value('sensor.dining_room_apparent_temperature') or
has_value('sensor.entryway_apparent_temperature') or
has_value('sensor.kitchen_apparent_temperature') or
has_value('sensor.living_room_apparent_temperature') or
has_value('sensor.nursery_apparent_temperature') or
has_value('sensor.office_apparent_temperature') or
has_value('sensor.bathroom_apparent_temperature')
}}
sensor:
- platform: apparent_temperature
name: Bathroom apparent temperature
unique_id: bathroom_apparent_temperature
source:
- sensor.bathroom_multisensor_temperature
- sensor.bathroom_multisensor_humidity
- sensor.bathroom_airspeed
- platform: apparent_temperature
name: Bedroom apparent temperature
unique_id: bedroom_apparent_temperature
source:
- sensor.bedroom_temperature
- sensor.bedroom_humidity
- sensor.bedroom_airspeed
- platform: apparent_temperature
name: Dining room apparent temperature
unique_id: dining_room_apparent_temperature
source:
- sensor.dining_room_temperature
- sensor.dining_room_humidity
- sensor.dining_room_airspeed
- platform: apparent_temperature
name: Dog bed area apparent temperature
unique_id: dog_bed_area_apparent_temperature
source:
- sensor.dog_bed_area_sensor_temperature
- sensor.dog_bed_area_sensor_humidity
- sensor.dog_bed_area_airspeed
- platform: apparent_temperature
name: Entryway apparent temperature
unique_id: entryway_apparent_temperature
source:
- sensor.entryway_multisensor_temperature
- sensor.entryway_multisensor_humidity
- sensor.entryway_airspeed
- platform: apparent_temperature
name: Kitchen apparent temperature
unique_id: kitchen_apparent_temperature
source:
- sensor.kitchen_temperature
- sensor.kitchen_humidity
- sensor.kitchen_airspeed
- platform: apparent_temperature
name: Living room apparent temperature
unique_id: living_room_apparent_temperature
source:
- sensor.living_room_temperature
- sensor.living_room_humidity
- sensor.living_room_airspeed
- platform: apparent_temperature
name: Nursery apparent temperature
unique_id: nursery_apparent_temperature
source:
- sensor.nursery_temperature
- sensor.nursery_humidity
- sensor.nursery_airspeed
- platform: apparent_temperature
name: Office apparent temperature
unique_id: office_apparent_temperature
source:
- sensor.office_sensor_temperature
- sensor.office_sensor_humidity
- sensor.office_airspeed