I am developing a blueprint that will turn on a heating zone control valve if any one of the smart TRVs in the zone demand heat, and turn it off only if no TRV demands heat.
The heat demand is a template binary sensor that tests whether the set temperature for a TRV (‘temperature’ attribute) is higher than the ambient temperature (‘current_temperature’ attribute).
Example heat demand sensor (seems to work)
### Guest bedroom trv heat demand
- binary_sensor:
- name: Guest bedroom trv heat demand
unique_id: c51617e9-da4b-9902-08ae-e623ab2d7bcc
icon: mdi:heat-wave
state: "{{ float(state_attr('climate.guest_bedroom_trv', 'temperature'),0) > float(state_attr('climate.guest_bedroom_trv', 'current_temperature'),99) }}" # false if either sensor is unavailable
And here is the faulty blueprint
blueprint:
name: "Zone X"
description: Controls a zone valve based on heat demand for all TRVs in the zone
domain: automation
### ----------------------------------------------------------------------------
### INPUTS
### ----------------------------------------------------------------------------
input:
zone_switch:
name: Zone switch
description: The switch that this automation is to control
selector:
entity:
filter:
domain: switch
multiple: false
heat_demand:
name: Heat demand
description: List all the heat demand sensors in this zone
selector:
entity:
filter:
domain: binary_sensor
multiple: true
mode: restart # only the latest is important
## ----------------------------------------------------------------------------
## TRIGGERS
## ----------------------------------------------------------------------------
trigger:
- platform: state
entity_id: !input heat_demand
condition: []
## ----------------------------------------------------------------------------
## ACTION
## ----------------------------------------------------------------------------
action:
- if: # True only if ALL heat demands are off
- condition: state
entity_id: !input heat_demand
state: "off"
then:
- service: switch.turn_off
data: {}
target:
entity_id: !input zone_switch
else:
- service: switch.turn_on
data: {}
target:
entity_id: !input zone_switch
The editor (Studio Code Server) accepts the syntax but when I try to invoke the blueprint I get the cryptic error message:
Message malformed: expected a dictionary for dictionary value @ data['action'][0]['then'][0]['target']
Could soneone translate this into English please?