like this link to change wifi mac address…
Why do you need to change the MAC address?
FYI this is not required to replace a device.
I have multiple nodemcu wifi MAC addresses all are 0.
How did that happen?
As far as I know there is no way to fix this with ESPHome.