Run HASS automation when ESPHome node connects?

I’m asking this on the ESPHome section but it may well be a more general HASS question - apologies if I should ask it there.

Is it possible to trigger a HASS automation when a particular ESPHome node connects to the HASS? If so, what is the condition and entity to monitor, please?

Maybe add a trigger of state, checking the WiFi signal( or whatever entity you added) from unavailable to anything. And then call a script?

Thanks, @left4taco, that is an interesting option that I’d not considered. I’ll experiment!

One thing led to another and I got this sorted - replying to help others.

On the ESPHome I added a binary sensor:

binary_sensor:
  - platform: status
    name: "CH Thermostat - Status"

Then in HASS I created an automation, the trigger for which is:

  trigger:
    - platform: state
      entity_id:
        - binary_sensor.ch_thermostat_status
      to: "on"

Works perfectly!