Remove coconut from husk and finely grate. Add water and squeeze through a strainer. Set aside the coconut and coconut milk.
In a stock pot, add oil and heat. Add beans, garlic and onion. When beans are cooked, add the coconut milk, scallion, thyme, salt, pepper and bring to a boil.
Add the rice and stir with a fork so beans are evenly distributed throughout rice. Add butter. Cover and