I used a raspberry pi to control my TV using HDMI-CEC and exposed a subset of the controls through a web API allowing me to turn on/off my TV from my phone or voice controlled from a google home.
I did this because a chromecast will turn on my TV and set it to the correct input, but it wouldn't turn off the TV. Turning the TV off was the only reason I needed to touch my remote control at all. But just recently google added the turning off functionality to chromecasts... so I guess my little project fade away.