I have the following blueprint;
blueprint:
name: Set climate target temperature from schedule.
domain: automation
input:
target_sensor:
name: Temperature Sensor
selector:
entity:
filter:
integration: schedule_state
target_area:
name: Area
selector:
area:
entity:
domain: climate
variables:
sensor: !input target_sensor
area: !input target_area
devices: >-
{{
expand(area_entities(area))
| selectattr('domain', 'eq', 'climate')
| map(attribute='entity_id')
| list
}}
trigger:
- platform: template
value_template: "{{ states(sensor) }}"
- platform: homeassistant
event: start
- platform: template
value_template: &noErrorCondition >-
{{ state_attr(sensor, 'errors') | length == 0 }}
- platform: template
value_template: >-
{{ state_attr(sensor, 'errors') }}
condition:
- condition: template
value_template: *noErrorCondition
action:
- if:
- condition: template
value_template: "{{ states(sensor) == 0 }}"
then:
- service: climate.set_temperature
data:
temperature: 5
target:
entity_id: "{{ devices }}"
- delay:
milliseconds: 500
- service: climate.turn_off
target:
entity_id: "{{ devices }}"
else:
- service: climate.set_hvac_mode
data:
hvac_mode: auto
target:
entity_id: "{{ devices }}"
- delay:
milliseconds: 500
- service: climate.set_temperature
data:
temperature: "{{ states(sensor) | int }}"
target:
entity_id: "{{ devices }}"
mode: queued
max: 50
Which I used in the following way;
id: '1697455140665'
alias: Set Temperatur Wohnzimmer
description: ''
use_blueprint:
path: cwrau/climate-set-target-temperature.yaml
input:
target_area: wohnzimmer
target_sensor: sensor.wohnzimmer_temperatur_target
The last 2 triggers are there because after a configuration reload the sensor.wohnzimmer_temperatur_target
, which is a schedule_state
, is in an error state and gives the wrong state.
Iāve observed the template {{ state_attr('sensor.wohnzimmer_temperatur_target', 'errors') | length == 0 }}
in the developer tools and it progresses from āan exception because the attribute is None
ā to false
and finally to true
after the integration reconciles after a minute.
But the automation never gets triggered. Is there anything I did wrong?