No further details provided
Most likely is, that they're wired to the switch either entirely or by a shared neutral or possibly even a ground wire. This means they aren't working at all nor properly, unless and until the switch is turned on. Have the alarm wiring checked-out and corrected accordingly.
If they happen to be battery units, then they'd be photoelectric cell type detectors and may just be resetting for a light-level change. This shouldn't be the case, but I don't know what all manufacturer's have out there.
It's best to remove and clean them of dust and cobwebs, so try that as a normal precautionary measure that fixes most annoyances.