Changes to sensor states, added user support, and added better support for threshold actions