Notify if any ESPHome sensors go offline

I have dozens of ESPHome sensors, and they can go offline for various reasons (power, WiFi connectivity, just flaking out). I would like one automation that loops through all ESPHome sensors in my setup and checks all for online status. I don’t want to have to list them all in the config, I’d rather the script found them all itself so when I add new ones, they’re just handled. Any way to do this?

I know that you don’t want to list all of your nodes but this is what I do.

I use and entity-filter card and I filter the network status.

entities:
  - binary_sensor.blind_1_network_status
  - binary_sensor.blind_2_network_status
  - binary_sensor.blind_3_network_status
  - binary_sensor.fan_1_network_status
  - binary_sensor.fan_2_network_status
  - binary_sensor.fan_3_network_status
  - binary_sensor.fan_4_network_status
  - binary_sensor.garage_1_network_status
  - binary_sensor.garage_2_network_status
  - binary_sensor.plug_1_network_status
  - binary_sensor.plug_2_network_status
  - binary_sensor.plug_3_network_status
  - binary_sensor.plug_4_network_status
  - binary_sensor.plug_5_network_status
  - binary_sensor.plug_6_network_status
  - binary_sensor.light_switch_1_network_status
  - binary_sensor.light_switch_2_network_status
  - binary_sensor.light_switch_3_network_status
  - binary_sensor.light_switch_4_network_status
  - binary_sensor.kitchen_counter_network_status
  - binary_sensor.kitchen_sink_network_status
  - binary_sensor.porch_network_status
state_filter:
  - value: 'off'
title: Disconnected Devices
type: entity-filter
1 Like