Wow. How can anyone be confused about this? This is clear cut. The stackexchange answers are correct and this HN thread is filled with really unethical, almost childish advice. What the guy is doing is basically fraud. The employer expects him to do efficient work. If he can automate it, that automation is owned by his employer.
Why automation will be owned by his employer ? Just why ?