Cleaned up, added motion sensor support, implemented dummy reader for the switch