Not all pygmies are nocturnal, but the common ones that we study (O. bocki, O. wolfi, O. mercatorus, O. joubini) are. Of these, the only one that really never shows itself is O. bocki. Most of our research animals are kept in 10 gal tanks, although I have had good luck with even 2 gal systems using a Fluval 203 with carbon and crushed coral. To prevent escape, I generally make my own tanks. The top is the same height all the way around so that I can lay a piece of glass on top (with a weight)to effectively seal it. I use a diamond drill to cut two 5/8" holes about an inch below the top in one side of the tank. I then insert a two inch piece of tubing into each hole and push in a connector from each side. This expands the tubing and makes a tight seal. These are the water intake and outtake ports. ALso, the water intake is fitted with a piece of sponge to prevent the octopus from entering the pump. We often feed small live food such as brine shrimp, small crabs and amphipods and this keeps them in the tank as well.) I have never had an escape by a pygmy using this system (unless someone did not properly put the lid on the tank).
One cautionary note, however. We use artifical seawater and always have at least a couple of hundred gallons on hand. If we suspect any problems or see some bad chemistry, we can immediately conduct a partial or even complete water change. These are the same systems that we use to keep our Hapalochlaena lunulata, although I am certainly NOT recommending that anyone try to keep them.
Our minimalist approach actually works well for maintaining small species. We typically provide about an inch of sand and only two shells or pvc elbows for the animals to live in. This allows them to change dens frequently, but we can always find them. A few large snails are added to keep down any algae that developes. Nothing but standard room lighting is used and in fact we usually keep the lighting fairly dim. Food is removed immediately if it is not taken and any surplus is removed within a couple of hours.
Roy