How to divide 24VAC to 24VDC for use with GPIO
Use a circuit like this with an optocoupler (which should isolate the 24VAC to prevent higher voltages from reaching the Rpi)
The circuit also has a RC filter to keep the circuit on in between phases, but in the diagram below its set to something like 1ms, you will probably want to adjust it to something higher like 20ms and a 20uF cap.
The LED in the TCLT1600 shouldn't need more than 10mA so a 2k resistor for R85 should work to limit the current.

Source: AC detection for microcontroller