Creating a sensor / binary_sensor based on a state

Hi guys,

I have my years with HA and yaml and have a pretty good control and still do everything manually with yaml. Though, ESPHome is a different chapter - reading a lot to learn.

Now, what I want to achieve is creating a sensor or binary_sensor based on a state within the ESPHome device. As far as I can see regarding binary_sensor I need to use platform and only find examples when using gpio but I do not have any gpio pins to read the states from.

For me it is about the Voice Assistant (playing with both Atom Echo and the ESP32-BOX-S3). I want to create sensor(s) to know when it is idle, listening, replying or on error.

Any help, especially with code examples would be highly appreciated.

As a note - accoring to the screenshot below, there is already a binary_sensor available but I can’t see it being created within the code.

image

For anybody wanting to achieve the same, resolved it myself by creating a input_text.xyz and added following on each state:

- homeassistant.service:
    service: input_text.set_value
    data:
      entity_id: input_text.voice_assistant_state
      value: <my text value>