changes to manage states for weather and contact sensor
merge