This is a mixed metaphor, but it is intended to mean that the speaker had a sudden realization or recognition. The proper metaphors are an alarm / a warning went off and a light went on .
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.