This is an enclosure to make a wifi-switched extension cord with a sonoff basic module. The standard case leaves a lot to be desired when it comes to securing the wires, so I made this one. It has tapered clamps that go around the wire sheathing and clamp down hard once they are locked in place. I also put a bit of hot glue on the inside of the clamps to help seal out moisture, though I would recommend keeping this in a mostly dry place, like a covered porch. The clamps are sized for 16 AWG 3-wire extension cord that's 8mm in outside diameter. If you want to use a different size wire, you'll need to adjust the files accordingly. It should be pretty easy to do for any normal sized cord. The files are on onshape, link below. Everything's a pretty tight fit, so be careful. I broke the button on my sonoff while installing everything. Speaking of the button, it's inaccessible in the case. I wanted it to be as weather-proof as possible, so I didn't include a cutout to access it. The clamps require a good bit of force to get in. I had to use some pliers to squeeze them into place. But once they're there, the hold very well.
Something with a little flex, like PETG, is probably best for the clamps. They need to be able to squeeze in to work.
Print the clamps at .1 or finer to get the best internal ridges and smoothest taper. Same goes for the holes that the clamps go into on the case. I printed the area immediately around the top and bottom of the holes at .1, and the rest of the case at .3. The lid shouldn't matter.