Text_sensor and input helper - how to send data back to HA?

I want to exchange text data between HomeAssistant and ESPHome. For that I created an input helper in HA like this:

input_text:
  led_matrix_text:
    name: Message
    initial: ""
    icon: "mdi:chat"

In my ESPHome config I can access the state of that helper with a text_sensor:

text_sensor:
  - platform: homeassistant
    name: "Matrix Text"
    entity_id: input_text.led_matrix_text
    id: led_matrix_text

This works fine. I have access to the value set in HA and output it on a display.

Now I want to reset the value of that text back to empty after a while. Either after a certain amount of time has passed or with a button press. To do so I publish a new state to my text_sensor like this:

lambda: id(led_matrix_text).publish_state("");

This works fine in ESPHome internally. But the state is never propagated back to my input helper in HomeAssistant, even though ESPHome logs that it did:

[20:20:11][D][text_sensor:067]: 'Matrix Text': Sending state ''

So my question is: how do I reset the input helper from ESPHome? Is there a lambda method I can call?

That’s expected because you are actually not “writing” (or sending) to the input_text in ha but to the “read only” text_sensor in esphome which gets it state from the input_text sensor from ha :bulb:

Probably directly with a homeassistant.service action :point_down:

Perfect. Thank you.