Best procedure to replace a failed device

so, i replaced an esp by

  • deleting in HA
  • downloading firmware
  • flashing new hardware
  • readding to HA

which replaced everything as expected on the dashboards - but oddly not in the automations which use entities of this device giving the

Error: Unknown device ‘3dc48263some-kind-of-hash’

but since this kind of hash is nowhere to be found hence not easily replaced - how can i get the new device to use this (or change to the new one in the automations)?

tia.

@drahdiwaberl

this made me think - as i actually never ever am using device_ids in automations, why i even don’t know what they look like.

but surprisingly i found that there was one ‘Device action’ in each of these (rather complex) automations which were shown ‘empty’ in the UI editor - and checking the automations.yaml there indeed were these kind of device_id/entity_ids.

no idea where they came from.

thanks.