ESPHome Import input_number Helper from Homeassistant

I have an input_number Helper in Home Assistant and I want to use that value in a ESPHome ESP32 device. Everything I find online indicates that this is doable, but I can’t get it too work.

Here’s the entry I’m using in the ESPhome configuration. The HA Helper is called input_number.drain_time.

 sensor:
   - platform: homeassistant
      id: delay_time
      entity_id: input_number.drain_time

this is the error I’m seeing in the ESPHome log.

/data/cache/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: 

/data/eh-temp/.pioenvs/eh-temp/src/main.o:(.literal._Z5setupv+0xbc): undefined reference to `vtable for esphome::homeassistant::HomeassistantSensor'

Any help getting this to work would be appreciated. thanks

I found the fix. I had to do a Clean Build Files and then recompile. All good now. That command is under the device menu (…) on the ESPHome screen.

In case your interested here’s a piece of the device’s yaml showing how I’m using an input_number Helper from Home Assistant, assigning it’s value to a global and then using the global in a delay via a Lambda. kind of cool and it works.

globals:
  - id: glob_drain_delay
    type: int
    restore_value: true
    initial_value: '1'


sensor:
  - platform: lm75
    id: lm75_temp
    name: "LM75 Temperature"
    update_interval: 60s
    address: 0x48
  - platform: homeassistant
    id: delay_time
    entity_id: "input_number.drain_time"
    on_value:
      lambda: |- 
        id(glob_drain_delay) = id(delay_time).state;

binary_sensor:
  - platform: gpio
    id: gpio21
    name: Water Sensor
    pin:
      number: 21
      mode:
        input: True
        pullup: False
        pulldown: True
    filters:
      - delayed_on: 10ms
    on_press:
      then:
        - switch.turn_on: gpio2
        - delay: !lambda "return id(glob_drain_delay) * 60000;"
        - switch.turn_off: gpio2