2 networks 1 server

I live on a farm and am a beginner with HA. I have 2 networks, 1 private network and where I use different devices. The other network is for guests, which are a lot, and covers most of the farm, exept my house. Now I want to use smart devices to turn the electric fence off, but that device needs to be in the shed, and thus is out of range of my private network.
I also placed solar panels, with 2 inverters. 1 private, and 1 for other buildings on the farm, again out of range for wifi of my private network.
My idea is to use a p1 (input at smart meter in my country) to wifi to detect the solar inverter with my server (raspberry pi 4) and via wifi for any other devices. Ofc this works for 1 solar inverter and my private network devices, but not for the devices on the other network and the solar inverter for the other buildings.

Is there a way to detect devices from both networks, or got any other suggestions?

Look up posts about creating IoT specific segments for security purposes. Your use case is basically the same thing. How do I detect stuff on more than one network.

One such is here:

Basically it comes down to making sure you can route the correct protocols and have mdns name resolution on the segment.

I presume this means it is in range of guest network.
If private is preferred looked into point to point wifi devices like Ubiquiti Nanostation. These can extend network for miles and are storm resistant but requires line of sight.

You could use a VPN setup between the devices and your private network. It is what VPN is made for.

If you do not really care about the devices being on the guest network and open to it, then maybe just opening tye required port for those specific Mac addresses of the devices.
Device discovery will require routing of the specific type of packets, but often you can just set up devices manually with the IP address instead and since it is only two devices it is probably easiest way.

Ultimately it is a routing problem.