If you have Sony android tv like i do then i suggest to take a look in here: Sony Devices Binding
I think it’s not good to switch your tv on and off by controlling power outlets. With newer tvs there’s a possibility to control them through http binding or maybe exec binding using scripts. You can find lots of information on this forum. Search is your friend