Events Automation


I am new to home assistant automation, i have a ultrasonic esphome sensor, that i need to get an notification if the sensor got disconnected or became unavailable

I have the follwoing event trigger and couldn’t get some details out of it to get an auomation based on the event

2022-04-13 19:09:04 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can’t connect to ESPHome API for ultrasonic-salt-sensor @ mysensor_ip: Error connecting to (‘mysensor_ip’, port): [Errno 113] Connect call failed (‘mysensor_ip’, port).

out of this event what i should use as:

Event Type
Event Data on the automation page.

Note: I tried to use the device state and set to Unavailable, but this didn’t work.

Lower case for unavailable.

  platform: state
  entity_id: sensor.your_sensor_here
  to: 'unavailable'

Dashboards can display a “pretty” version the underlying state of an entity. This can be as simple as changing the state to title case or changing the state altogether (e.g. off → ‘Clear’) depending on the device class. Always check Developer Tools / States for the exact state to use in your automation.

Thanks That worked perfectly.