Hi,
I’m running into trouble with using variables in automations. I’m attempting to use an input_number as a threshold for the below parameter in a condition. This occasionally runs into errors, reporting that the automation “expected float for dictionary value @ data[‘below’]”. The automation as written below is ‘saved’ and usually works. I’ve tried doing all of these:
below: {{ states.input_number.temp_min.state | float }}
below: "{{ states.input_number.temp_min.state | float }}"
The editor won’t let me save those, I get an error:
Message malformed: expected float for dictionary value @ data['action'][0]['choose'][0]['conditions'][0]['conditions'][2]['below']
I feel like I’m missing something obvious. Any pointers? Thanks!
This is (a part of) the automation as it is now, and seems to work most of the time.
condition: []
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: and
conditions:
- type: is_no_motion
condition: device
device_id: fe3c2ae017d311eb95fe9d88dd942fab
entity_id: binary_sensor.living_motion_motion
domain: binary_sensor
for:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
- condition: time
after: '08:00:00'
before: '22:30:00'
- condition: and
conditions:
- type: is_no_motion
condition: device
device_id: fe3c2ae017d311eb95fe9d88dd942fab
entity_id: binary_sensor.living_motion_motion
domain: binary_sensor
for:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- condition: time
after: '22:30:00'
before: '08:00:00'
- condition: numeric_state
entity_id: sensor.living_motion_temperature
below: input_number.temp_min
- condition: state
entity_id: fan.living_room_fan
state: 'on'
sequence:
- service: fan.turn_off
target:
device_id: 66c1f9b30121f607e0e0f0e2ac1167dd