Device that controls mains switches remotely