Hi,
I have this template to calculate Average temperature in my house:
- sensor:
- name: "Temperatura Media"
unit_of_measurement: "°C"
unique_id: temperatura_media
state: >
{% set camera = states('sensor.netatmo_camera_da_letto_temperature') | float %}
{% set cucina = states('sensor.xiaomi_temp_cucina_temperature') | float %}
{% set ingresso = states('sensor.netatmo_ingresso_temperature') | float %}
{% set salone = states('sensor.xiaomi_temp_salotto_temperature') | float %}
{% set mansarda = states('sensor.xiaomi_temp_mansarda_temperature') | float %}
{{ ((camera + cucina + ingresso + salone + mansarda) / 5) | round(1, default=0) }}
It works fine.
Because on winter I do not use and heat some room, based on day of the week, I would like to make this calculation configurable without editing any time the configuration file.
My idea is to add 5 switch helpler, one for each sensor, to enable or disable sensor from the dashboard, but I have no idea how to integrate in this template.
Any help would be appreciated
Marco