Created
February 6, 2022 06:35
-
-
Save fregmented/393914eba96d031412b1415e1776a325 to your computer and use it in GitHub Desktop.
Hass Template sensor for average T/H
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template: | |
- sensor: | |
- name: "Average temperature" | |
unique_id: avrg_temperature | |
unit_of_measurement: "°C" | |
state: > | |
{% set bedroom = states('sensor.anbang_t_h_temperature') | float %} | |
{% set kitchen = states('sensor.kitchen_temperature') | float %} | |
{% set living = states('sensor.geosil_temperature') | float %} | |
{{ ((bedroom + kitchen + living) / 3) | round(1, default=0) }} | |
- name: "Average humidity" | |
unique_id: avrg_humidity | |
unit_of_measurement: "%" | |
state: > | |
{% set bedroom = states('sensor.anbang_t_h_humidity') | float %} | |
{% set kitchen = states('sensor.kitchen_humidity') | float %} | |
{% set living = states('sensor.geosil_humidity') | float %} | |
{{ ((bedroom + kitchen + living) / 3) | round(1, default=0) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment