Arduino with relay board and ethernet shield works out to something like 275$ for around 40 ports. 160$ of which is relay boards, 8 of them.
Tho requires a bit of work to get running, but ought to be rather easy after that.
Not a perfect solution, but half way there.
If you use small fet's instead of relays you can cut that cost down. If you build your own boarduino you could probably get the cost down to less than $20.