Restore sensor state after reboot

I updated ESPHome from 2021.12.2 to 2022.6.2. After that update I have a strange change.

I have an input text helper in HA named input_text.door_pin_errors.
In esphome config I have this:

text_sensor:
  - platform: homeassistant
    entity_id: input_text.door_pin_errors
    name: Door Control errors
    id: pin_errors

This was creating a new sensor in esphome named sensor.door_control_errors which was getting data from the HA input text helper. Also I could change its text in lambdas using its id. For example:
id(pin_errors).publish_state("5");
After a power failure or a reboot of my esphome device, the sensor.door_control_errors was getting data from input_text.door_pin_errors and that way I could restore the previous data using HA.

After updating esphome this is not happening. sensor.door_control_errors is not showed in entities. I can still see in the logs that esphome is pushing data using lambdas but input_text.door_pin_errors is not affected.
Why is that happening after the update? Could I restore somehow the previous behavior?
Could you suggest another way to restore the previous state of a sensor in esphome?

It was my mistake. The helper in HA was changing to match the esphome sensor with an automation.
But the sensor in esphome was not created using the above configuration. I found that it is created if I add internal: false. I never had to add this in the past. I thought adding a name was telling esphome to create it.