added state file so we dont have to call the camera if the state hasnt changed