Float value expected

I’m trying to use a input value from Home Assistant as the values in on_value_range.

  - platform: homeassistant
    name: "volym_grans"
    entity_id: input_number.volym_grans
    id: volym_grans
  - platform: adc
    pin: A0
    name: "Sound"
    update_interval: 0.1s
    internal: true
      - above: id(volym_grans).state
          - switch.turn_on: snd
      - below: id(volym_grans).state- 0.01
          - switch.turn_off: snd

In Home Assistant input_number.volym_grans is:

    name: volym_grans
    min: 0.56
    max: 1
    step: 0.01

But in ESPHome I get an error on - above: id(volym_grans).state that it expects float value.
I don’t understand, why would it not be float? The value is float in Home Assistant and sensors in ESPHome are (or can be) float, so why is it converted to something else?
What can I do to fix this?


Nobody knows why I get this message?

Any state in ha is stored as a string (cause it’s python code). It’s probably transferred to esp as a string. You need to convert it to float after transfer.

How can I do that?