I’m having trouble using a calculated value from blueprint input into an automation action.
(The automation below aims to toggle the underfloor heating on/off, simulating a partial power. E.g. 80% cycle_time would mean on for 48s, off for 12s)
I get the following error when saving the automation:
blueprint:
name: Partial underfloor heating
description: >-
Run the underfloor heating at partial power (by cycling on/off)
domain: automation
author: Home Assistant
input:
heating_device:
name: Heating device
description: What heating device to run
selector:
entity:
filter:
domain: switch
heat_trigger:
name: Heat trigger
description: What heat trigger switch to use
selector:
entity:
filter:
domain: input_boolean
percent_on:
name: Percent run time
default: 50
selector:
number:
min: 1
max: 100
unit_of_measurement: pct
cycle_time:
name: Time (sec) between the start of 2 on cycles
default: 60
selector:
number:
min: 1
max: 3600
unit_of_measurement: sec
mode: restart
trigger:
- platform: state
entity_id: !input heat_trigger
to: "on"
action:
- repeat:
while:
- condition: state
entity_id: !input heat_trigger
state: "on"
sequence:
- service: switch.turn_on
target:
entity_id: !input heating_device
- delay:
seconds: !input cycle_time #this should be cycle_time * percent_run_time
- service: switch.turn_off
target:
entity_id: !input heating_device
- delay:
seconds: "{{ (1 - (!input percent_on|float)/100) * (!input cycle_time)}}"
How would I go about using that input value into the calculation?