How activate one smart relay in my network without know his address

I have a relay in my network that is activated by http: //192.168.0.#/gpio/1
and I want when I press a button to activate that relay without knowing its ip address. How can I do that?

and this is what i did