This will have to be done with some small computer like a Rasberry Pi, Arduino and an IR BLASTER on same.