Android TV remote setup

I had android TV remote integration set up and working but I had to factory reset my TV. After this I can not get it set up again.

When I try to configure it and enter the ip address of the TV I always get the error unable to connect.

I have tried rebooting TV, force stop and clear storage for android TV remote service but still not working. Also deleted the integration and try to set up from scratch. Would appreciate any help.