My secret weapon in fighting Grym was Mage Hand Legerdomain, which was invisible and could turn on the lava valve when necessary without getting detected. I had 3 people perched on a ledge above to do range attacks, and only one person on the platform to keep luring Grym to the center, made easier with Haste on herself and Slow on Grym. After getting hammered 3 times, Grym was down to about 50 HP. Then the person on the platform used Misty Step to jump to the ledge above to join the other people there, and all 4 people started range attacks to finish it off. The flying mephits that came out at one time were easily dealt with by the ranged attacks on the ledge. And when all 4 people were on the ledge, Grym WAS STUCK in the lava, because it had no one to attack (no range attack, apparently) and didn't know where to go. So its AI pathfinding (or lack thereof) just made it stand still in the lava the whole time. And we just finished it off right there, which took a while even though it was only 50 HP due to Grym's resistance.