Set input_number in automation error 'expected float'

Trying to set an input_number in an automation using a template. Testing in /developer-tools/service and getting this error: expected float for dictionary value @ data[‘value’]

image

entity_id: input_number.buoy_4055_heat
value: >-
  {% set high = states('sensor.darksky_weather_daytime_high_temperature_0d')
  |  float %}  {% set cld = states('sensor.darksky_weather_cloud_coverage_0d')
  | int %}  {% if cld > 50 %}
    {% if high < 60 %}{% set val = 2 %}
    {% elif high < 62 %}{% set val = 1 %}
    {% elif high < 64 %}{% set val = 0 %}
    {% elif high < 67 %}{% set val = -1 %}
    {% elif high < 69 %}{% set val = -2 %}
    {% elif high < 72 %}{% set val = -3 %}
    {% else %}{% set val = -4 %}
   {% endif %}  
  {% elif high < 45 %}{% set val = 2 %} {% elif high < 54 %}{% set val = 1 %}
  {% elif high < 59 %}{% set val = 0 %} {% elif high < 63 %}{% set val = -1 %}
  {% elif high < 65 %}{% set val = -2 %} {% elif high < 67 %}{% set val = -3
  %} {% else %}{% set val = -4 %} {% endif %}  
  {{ val | float }}

Basically trying to increase / decrease the thermostat level based on outside temperature and cloud cover, but need the input_number before calling the climate updates. TY!

Ended up having to write a quick script to execute this and just called the script from the automation.

Really annoying / odd that it works 100% via work-around / script but you can’t execute in the automation - seems some added consistency is needed here…