Using AC relay with DC voltage
In the Nest Installation Guide, page 23, they show an installation example with low voltage. So I think they actually are mechanical relays, or at least relays that can actually work with DC.

So you can make it simpler: connect 1 or 3 to the raspi ground, and 2 to some raspi input with a pull-up, for example.