Hey guys,
For those who want to switch between the input sources, there are two solutions for Android models: adb and using the API.
- Using adb. In the example below the last digit in
HdmiService%2FHW9indicates an input source (for meHdmiService%2FHW9is HDMI 2 andHdmiService%2FHW10is HDMI 1; SCART uses a different service, but works the same way. You can find the service name and params by checking the syslog on your device after switching to the needed input source):
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/org.droidtv.hdmiService%2F.HdmiService%2FHW9 -n org.droidtv.zapster/.playtv.activity.PlayTvActivity -f 0x10000000
- I’ve tried using the
activities/launchendpoint in the Philips API to run the command above, but unfortunately the API strips out “data” and “flag” parameters (“-d” and “-f” in the example above), so I could not make it work. I’ve checked the source code for the API and it indeed does not pass these parameters, so there is no way to run this command through the API. But I was able to call Google Assistant and pass a query - apparently, passing input name as a query (“HDMI 1”, “HDMI 2”, “SCART”, etc.) will result in Google Assistant switching the TV to that input. Just post the following toactivities/launch:
{ "intent": {"extras":{"query":"HDMI 1"}, "action": "Intent { act=android.intent.action.ASSIST cmp=com.google.android.katniss/com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline flg=0x10200000 }", "component":{"packageName":"com.google.android.katniss","className":"com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline"} } }
Hope it helps!