hi
Maybe some one did similar project with esp .I saw on IFA 2018 Fibaro smart implant which basically allows to remote control old devices. More info here (eng subtitles): https://www.youtube.com/watch?v=pt9tZI4s0rM
if you did something similar please share your configuration.