In some embodiments, an intelligent wall switch may contain one or more environmental sensor and an integrated power source such that the intelligent wall switch may detect an environmental condition and control a lighting device even in the absence of external power at the device. In one embodiment, a motion sensing intelligent wall switch may contain a motion sensor and an integrated rechargeable battery such that a switch sensing circuit inside a lighting device may detect from the motion sensing intelligent wall switch whether motion has been detected to determine whether to illuminate the light source. In such an embodiment, the motion sensor switch contains a battery such that it may continue to operate during the power outage. In such an embodiment, the motion sensing intelligent wall switch may open and close a switch to the external power source when motion is detected however when the switch is closed and external power is not present, the switch sensing circuit inside the lighting device will detect this as a power outage condition and illuminate the light source powered by its local power source. In another embodiment, an intelligent wall switch with an integrated power source and a dimming capability may continue to operate a switch sensing lighting device during a power outage. In such a case, the switch sensing circuit may detect an electrical characteristic that it may associated with an intensity level of the light source such that the control facility in the switch sensing lighting device may PWM control, amplitude control, constant current control etc the light source to achieve the desired light intensity level. In embodiments, a light sensor may be present in the intelligent wall switch and provide a daylight harvesting function during a power outage where the light intensity is set based on the ambient light level detected such that the ambient light plus the light generated by the light source maintain a constant light level. This would be done in conjunction with a switch sensing lighting device such that the switch sensing circuit may detect electrical characteristics of the circuit that represent the light intensity level required of the switch sensing lighting device to maintain the proper light intensity level.