Esphome native API equivalent of MQTT LWT

Hi there-

Does the native API offer anything equivalent to setting a LWT with MQTT, i.e., a state to monitor, a message or something to trigger an action when a device disappears from the network ungracefully?

I assume that I could set a trigger based on an entity changing to state “unavailable” in HA, but I’m wondering if there is a option using the esphome API.

Thanks,
Ron

See status binary sensor

Thanks for the reply. Great work on esphome, BTW. Terrific.

Do you mean binary sensor status on the HA side (watching for status unavailable?) or on the esphome side?

This one: https://esphome.io/components/binary_sensor/status

It is a bit of a magic/special component, it’s never unavailable, just ON/OFF based on connectivity status.

Looks perfect. I’ll give it a try. Thanks.

I am trying to use this internally with an id, should it return false if ha is not connected to the ESP? i need to perform relay toggle in case ha is not available.

Looks for me like is always on, internally i mean even if ha is down.

Yes current behavior is always on For ESPHome api. Next version will work as expected and also a new property in api component will allow for easy api online checks