Don't really need to read climate info when there's nothing to read

This commit is contained in:
2022-11-14 16:43:08 -05:00
parent ef355df2c6
commit cd1475916d
2 changed files with 29 additions and 18 deletions

View File

@@ -137,6 +137,15 @@
states.light.front_porch_light states.light.front_porch_light
] %} ] %}
{{ lights | selectattr('state','eq','on') | list | count }} {{ lights | selectattr('state','eq','on') | list | count }}
climate_devices_installed:
friendly_name: Climate Devices Installed
unit_of_measurement: 'installed'
value_template: >-
{% set devices = [
states.input_boolean.master_bedroom_aircon_installed,
states.input_boolean.nursery_aircon_installed
] %}
{{ devices | selectattr('state','eq','on') | list | count }}
front_porch_color_temp: front_porch_color_temp:
friendly_name: Front Porch Color Temp friendly_name: Front Porch Color Temp
unit_of_measurement: 'mireds' unit_of_measurement: 'mireds'

View File

@@ -83,6 +83,7 @@
</p> </p>
<p> <p>
{% if (states('sensor.climate_devices_installed') | int) > 0 %}
"The current climate control situation is as follows. " "The current climate control situation is as follows. "
{% if is_state('input_boolean.master_bedroom_aircon_installed','on') %} {% if is_state('input_boolean.master_bedroom_aircon_installed','on') %}
"the master bedroom temperature is currently {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. " "the master bedroom temperature is currently {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. "
@@ -102,6 +103,7 @@
{% else %} {% else %}
"There is no air conditioner or temperature sensor currently installed in the master bedroom. " "There is no air conditioner or temperature sensor currently installed in the master bedroom. "
{% endif %} {% endif %}
{% endif %}
</p> </p>
<p> <p>