Detect the status of an exhaust fan

I would like to try sir goodhen's suggestion but I just want to clarify this... is the code the same for using the blade as interrupt (like this)and using a reflective material (like this)?