24VAC to 5VDC or 12VDC Trigger - Maybe optocoupler?
Relays may jitter with a half-wave triggered coil current so a full-wave low current diode bridge gives 120 Hz pulses which need a filter cap.
However, I assume 24Vac is intended to activate the Opto input which is inverted active low so an NPN transistor is needed.



simulate this circuit &ndash; Schematic created using CircuitLab
Variations of R2C choices but this is easy to drive and pulls up R prevents noise false triggers.