Help with "Invalid config" Error Notification

This morning I started getting a notification about an automation config error.

Just before the error occurred, I removed a couple old zigbee devices that were no longer in use. There were a couple automations that had references to those devices, so I deleted those with no resolution. Otherwise, my config file passes the config check, and things are working normally.

Below is a copy of the log. Would anyone be willing to point me in the right direction on this?

Logger: homeassistant.config
Source: config.py:454
First occurred: 12:52:00 (1 occurrences)
Last logged: 12:52:00

Invalid config for [automation]: Invalid trigger configuration. Got OrderedDict([('default_config', {}), ('automation', [OrderedDict([('id', '1648675356840'), ('alias', 'Notify When Backups Stale'), ('description', ''), ('trigger', [OrderedDict([('platform', 'state'), ('entity_id', 'binary_sensor.backups_stale'), ('from', 'off'), ('to', 'on')])]), ('condition', []), ('action', [OrderedDict([('service', 'notify.persistent_notification'), ('data', OrderedDict([('message', 'Home Assistant backup failed. Fix it!')]))]), OrderedDict([('service', 'notify.home_assi.... (See /config/configuration.yaml, line 7).

There is a reference, at the end of the error, to line number 7 of the config.yaml. That part of the code is as follows:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
- platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

There is also a reference to a specific automation in the error log above. That automation is below:

- id: '1648675356840'
  alias: Notify When Backups Stale
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.backups_stale
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: notify.persistent_notification
    data:
      message: Home Assistant backup failed.  Fix it!
  - service: notify.home_assistant
    data:
      message: Home Assistant backup failed.  Fix it!
  mode: single

Follow up:

I was able to find the entity id of the offending device (in the automation.yaml) that had been removed - searched for the name of the device that was recently removed, then deleted the associated yaml lines.

Even in retrospect, I don’t see how the error code was at all helpful at localizing the problem.

Note to self… removing devices can create problems and it’s always a good idea to take note what you’re removing ahead of time.