You should put the full domain name (not the IP) in trusted_domains and make sure to use the name when connecting.
Since you have OPNsense, you can use your local DNS to set up split-horizon DNS so it resolves to the LAN IP while on your LAN, and then you use the full name to connect regardless of location.
The trusted_domains mechanism was designed for a domain name. You can use an IP address, but it’s far from ideal and will likely cause you other problems. Since you have OPNsense already, it would be relatively easy to set up split DNS.