Wake PC when changing inputs on Sony TV (Android TV)

by justinbyoung

I have a Sony kd-65x9000f running Android TV. One of the devices I have connected is my gaming PC. When not in use the PC goes to sleep. I would like it to automatically wake up when I change the TV input to the PC.

My first proposed solution is to have the TV send a WOL request to the PC when I switch to that input, using Tasker or some other app. Has anyone had any success doing something like this?

I have experimented with some more complicated solutions. I have Home Assistant running on a server and can change inputs to the TV and send a WOL request to the PC from there, but sometimes I just want to be able to pick up the remote and change inputs.

An alternative could be to possibly use Home Assistant. Is there a way of adding a custom app to the Android TV home screen that can send a Home Assistant command that can do what I want? This would actually be preferable to my first solution.

MrRenegado

I've looked into this as well, I think using Hdmi CEC might be easier. (also my TV doesn't run android TV) But still far from trivial. Your video card must support it, as well as the TV. Then there is the driver aspect. Configuring windows.

Apparently usb CEC adapters exist if your video card doesn't support it. So while I think it's possible, it's a lot of work. I've decided it's not worth it but if you make it happen I'd be very interested in your experience.

justinbyoung

After doing a bit more research into Tasker I feel there may be a way of exporting an apk from tasker that can run on Android TV that can talk to Home Assistant to do what I want. I will experiment a bit more.

Saad3600

Ps4 pro HDMI CEC DTS Dolby 4k HDR 4.2.2 12bit

justinbyoung

Did some experimentation and came up with a solution that does what I need.

I created a Tasker task that calls a Home Assistant script which changes the input on the TV to the correct channel and that sends a WOL request to the PC.

I was then able to export the task as an APK from Tasker using Tasker App Factory. I then copied the APK to my Shield and installed it. Then using http://atvlauncher.trekgonewild.de/ I was able to generate a Android TV launcher app so I could add the app to the home screen.

So I now have an app in my Favorites which switches to my PC as though it was a Android TV app, which is perfect, I can even use voice control to launch it.

I think the same method could be used without Home Assistant if your TV support HTTP commands.