How to robustly connect to KDE Connect across different networks

It always bothered me that KDE Connect stops working when I connect to ta different network and I have to connect manually with IP address.

I came across a way to solve the problem once and for all.

Here is the solution https://askubuntu.com/q/1565782/124466