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.

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

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


/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.

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

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

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