MacOS Client when wired/Wireless issue

Sometimes I run my Macbook on WiFi, other times on Ethernet.

Its a pain as Home assistant decides to rename my device to Macbook(2)

This mean that all my sensors I used relating to the device get changed and messes up my scripts.

Can you please fix it so that it keeps my device name when i change (or have both) connections.