Retrieving values from HA helper from ESP device

Good day,

I need some help/advise.

I am saving my global values (every 5 min) to home assistant helper. I want to retrieve the last saved value when ever I boot the ESP8266. Currently I have this… but it does not work.

on_boot:
    then:
      - homeassistant.service: 
          service: input_number.set_value
          data: 
            entity_id: input_number.hourly_rain
            value: !lambda "return id(hourly_rain);"
      - homeassistant.service: 
          service: input_number.set_value
          data: 
            entity_id: input_number.daily_rain
            value: !lambda "return id(daily_rain);"
      - homeassistant.service: 
          service: input_number.set_value
          data: 
            entity_id: input_number.monthly_rain
            value: !lambda "return id(monthly_rain);"
      - homeassistant.service: 
          service: input_number.set_value
          data: 
            entity_id: input_number.yearly_rain
            value: !lambda "return id(yearly_rain);"
      - homeassistant.service: 
          service: input_number.set_value
          data: 
            entity_id: input_number.total_rain
            value: !lambda "return id(total_rain);"

To retrieve a HA helper value you need to use the homeassistant platform, see

I’d suggest using on_client_connected rather than on_boot as the connection to HA might not be up straight after boot, see