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
] %}
{{ 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:
friendly_name: Front Porch Color Temp
unit_of_measurement: 'mireds'

View File

@ -83,24 +83,26 @@
</p>
<p>
"The current climate control situation is as follows. "
{% 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. "
{% if is_state('climate.master_bedroom_aircon','cool') %}
"and the master bedroom air conditioner is currently set for cooling to {{ state_attr('climate.master_bedroom_aircon','temperature') }} degrees. "
{% elif is_state('climate.master_bedroom_aircon','fan_only') %}
"and the master bedroom air conditioner is currently in fan only mode. "
{% elif is_state('climate.master_bedroom_aircon','dry') %}
"and the master bedroom air conditioner is currently moonlighting as a dehumidifier. "
{% elif is_state('climate.master_bedroom_aircon','off') %}
"and the master bedroom air conditioner is currently not running. "
{% elif is_state('climate.master_bedroom_aircon','auto') %}
"and the master bedroom air conditioner is making its own decisions. Be afraid, be very afraid. "
{% else %}
"and the master bedroom air conditioner is currently not speaking to me. Was it something I said? "
{% endif %}
{% else %}
"There is no air conditioner or temperature sensor currently installed in the master bedroom. "
{% if (states('sensor.climate_devices_installed') | int) > 0 %}
"The current climate control situation is as follows. "
{% 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. "
{% if is_state('climate.master_bedroom_aircon','cool') %}
"and the master bedroom air conditioner is currently set for cooling to {{ state_attr('climate.master_bedroom_aircon','temperature') }} degrees. "
{% elif is_state('climate.master_bedroom_aircon','fan_only') %}
"and the master bedroom air conditioner is currently in fan only mode. "
{% elif is_state('climate.master_bedroom_aircon','dry') %}
"and the master bedroom air conditioner is currently moonlighting as a dehumidifier. "
{% elif is_state('climate.master_bedroom_aircon','off') %}
"and the master bedroom air conditioner is currently not running. "
{% elif is_state('climate.master_bedroom_aircon','auto') %}
"and the master bedroom air conditioner is making its own decisions. Be afraid, be very afraid. "
{% else %}
"and the master bedroom air conditioner is currently not speaking to me. Was it something I said? "
{% endif %}
{% else %}
"There is no air conditioner or temperature sensor currently installed in the master bedroom. "
{% endif %}
{% endif %}
</p>