Hi. I have an automation that start an fan if an motion sensor is on and automation that stop the fan if the motion sensor is off for 3 minutes. I’d like to use an input_number helper (easy to set in frontend) for the minutes when the motion sensor is off but it give me an error: Message malformed: expected float for dictionary value @ data[‘for’][‘minutes’]
description: ""
mode: single
trigger:
- type: no_motion
platform: device
device_id: 3dbb672d7536f94657cbfce2cbd3fe55
entity_id: bb58bff95c83454b312f5c3f5802a6b0
domain: binary_sensor
for:
hours: 0
minutes: 3
seconds: 0
id: Motion OFF
condition: []
action:
- type: turn_off
device_id: ac310fa45937f4c610002e9e1c264aff
entity_id: 703c063670dbe388609ae458405b3ed4
domain: switch
Instead of :
for:
hours: 0
minutes: 3
seconds: 0
I would like to use:
for:
hours: 0
minutes: {{ state('input_number.motion4auton') }}
seconds: 0
It is possible ? It seems that the for statement do not accept templates. Where am I wrong ?
I know I’m not so good in yaml … I try “”{{ (( states(‘input_number.motion4autoff’) | float )) | int }}“” and other variants but nothing !
Thank you for your help.