Add a method of replacing devices

Nope. Only this informal advice: Why and how to avoid device_ids in automations and scripts