siebe_r
(Siebe)
March 9, 2022, 4:10pm
1
Hi
I get the error : Message malformed: expected float for dictionary value @ data[‘for’][‘minutes’]
when I use this template in an automation
trigger:
- type: no_motion
platform: device
device_id: e0954ea41d7a6da69baeff2e9558ed13
entity_id: binary_sensor.v4b01_motion
domain: binary_sensor
id: '1'
for:
hours: 0
minutes: {{states('input_number.timeout_offices') |float }}
seconds: 0
when I test this out it works perfectly and returns a float
Not sure this would work without putting ’ ’ around it or > infront of it '{{states('input_number.timeout_offices') |float }'
Does Minutes allow templates?
What does your template return in the template editor?
123
(Taras)
March 9, 2022, 4:31pm
3
You created a Device Trigger and it does not support templating.
Change if to a State Trigger .
trigger:
- platform: state
entity_id: binary_sensor.v4b01_motion
id: '1'
to: 'off'
for:
minutes: "{{ states('input_number.timeout_offices') | int(0) }}"
siebe_r
(Siebe)
March 11, 2022, 8:01am
4
Thanks this worked! Still something weird tho everytime I open the automation in the visual editor it changes the brackets to so I cant open the automation anymore only in a text editor
'{{ states(' 'input_number.timeout_offices' ') | int(0) }}'