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.