
Claxon |

Yes it works fine. The check is not to detect the person scrying, but to detect the scrying sensor. Which functions normally. They will notice the scrying sensor and know they are being scryed upon.
Scrying: A scrying spell creates an invisible magical sensor that sends you information. Unless noted otherwise, the sensor has the same powers of sensory acuity that you possess. This level of acuity includes any spells or effects that target you, but not spells or effects that emanate from you. The sensor, however, is treated as a separate, independent sensory organ of yours, and thus functions normally even if you have been blinded or deafened, or otherwise suffered sensory impairment.
A creature can notice the sensor by making a Perception check with a DC 20 + the spell level. The sensor can be dispelled as if it were an active spell.
Lead sheeting or magical protection blocks a scrying spell, and you sense that the spell is blocked.