Added method for setting sensor value.