I’ve been slowly converting my system to use helper entities to replace hardcoded values in scripts and automations allowing easier modification.
However when trying to use a template to return the state of an input_number
in a condition the following error is encountered. Using the same template for the trigger:
section works fine.
Error
Invalid config for [automation]: expected float for dictionary value @ data['action'][0]['default'][0]['for']['minutes']. Got None. (See ?, line ?).
Related Configuration
action:
- choose:
- alias: Auto Light Entry
conditions:
- condition: state
entity_id: input_boolean.auto_light_entry
state: "on"
sequence:
- service: light.turn_on
target:
entity_id: light.entry
default:
- condition: state
entity_id: binary_sensor.entry
state: "off"
for:
minutes: "{{states('input_number.auto_light_timeout')}}"
- service: light.turn_off
target:
entity_id: light.entry
If there are any workarounds or something I’ve overlooked, please let me know. Otherwise this would be a welcome addition to Home Assistant.