Add the dal and sliced onions to the inner pot of instant pot.
Add just 2 cups of water (we will add the remaining water later), stir well and close the instant pot with lid in sealing position.
Cook in high pressure for 7 minutes. Once the cooking is done, the pot beeps and you can press the 'keep warm/cancel' buttom. Let the pressure release naturally.
Once the pressure is all released, you can carefully open the lid. Stir and gently mash the contents inside.
Add the remaining 2 cups of water, tamarind, salt and all the spices and sambar masala, stir well and simmer for a couple of minutes (using saute function). Once done, cancel the saute function, unplug the instant pot and you can transfer the inner pot to a safe place away from heat.