The security part is a solved problem, unless you think a burglar is obsessed with your house in particular; they've made outlet timers for decades.
> unless you think a burglar is obsessed with your house in particular
IMO burglars are obsessed with an easy score - "Lights on looks like someone is home - fuck it I will rob the empty looking house up the street"