So it is battery powered but you want to switch it to using the power line intended to trigger the components. So yes, the way it's wired there is no clean ground as it is not needed.
You can check to see if there is another wire, as other's have suggested, then use it as a ground though you'll probably have to connect it.
Or you can run off batteries like your thermostat has been.
Why the big relays, isn't there a more efficient solid state relay or even a MOSFET solution that won't kill your batteries?