If this is a pre-existing automation, you will need to delete the trigger and re-create it so the new replacement device is selected, or else edit the trigger in YAML and update the device_id. Your scenario is effectively a device replacement, which is not supported. If that’s the case the device currently selected corresponds to the disabled integration. This is one of the problems with using device triggers/conditions/automations.
IMO, better to use state triggers so you can just update entity names in case of device replacement.