It’s built in to RPi. I’ve got LibreELEC on it. My Kodi goes to sleep after 1 minute idle and sends the signal to turn off the TV. I also added a button to my home page to turn off the TV. When I push a button to wake up Kodi, it turns the TV on. There is a bug where when it sleeps during playback it shows a black screen instead of turning off, so i have to stop playback to make it turn the TV off. I opened a bug about it and they mentioned it might be fixed in the nightly release 22 builds but I never got around to trying it.
If you’re using Kodi on a PC and want your TV remote to control Kodi or your Kodi remote to control your TV, there’s this little doodad that might help https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter
It’s built in to RPi. I’ve got LibreELEC on it. My Kodi goes to sleep after 1 minute idle and sends the signal to turn off the TV. I also added a button to my home page to turn off the TV. When I push a button to wake up Kodi, it turns the TV on. There is a bug where when it sleeps during playback it shows a black screen instead of turning off, so i have to stop playback to make it turn the TV off. I opened a bug about it and they mentioned it might be fixed in the nightly release 22 builds but I never got around to trying it.