Figuring out control syntax to open specific app (Netflix, Hulu, etc.)
Closed this issue · 9 comments
I recently noticed that the Vizio smartphone app (android) added support to open all the smart apps from within the app. I poked around the decompiled app and found the following endpoints in Vizio/vue/devicecontrol/api/enums/VZRestEndpoint.java:
APP(null, "app"),
APP_CURRENT(APP, "current"),
APP_LAUNCH(APP, "launch"),
APP_CONFIG(APP, "config"),
APP_CONFIG_GET(APP_CONFIG, "get_property"),
APP_STORE(APP, "store"),
APP_STORE_GET(APP_STORE, "get"),
APP_STORE_SET(APP_STORE, "set"),
I can get the current app with the following curl command:
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXX" -X GET https://XXX.XXX.XX.XXX:7345/app/current
Here is the output:
{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}, "ITEM": {"TYPE": "T_APP_V1", "VALUE": {"MESSAGE": "https://www.youtube.com/tv", "NAME_SPACE": 5, "APP_ID": "1"}}, "URI": "/app/current"}
I'm not sure what the syntax to launch an app is though. Any help is appreciated.
Alright, made some more progress.
The following opens youtube.
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXXXX" -X PUT -d '{"VALUE": {"MESSAGE": "https://www.youtube.com/tv", "NAME_SPACE": 5, "APP_ID": "1"}}' https://XXX.XXX.XX.XXX:7345/app/launch
Running the following while another app is on screen
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXX" -X GET https://XXX.XXX.XX.XXX:7345/app/current
Gives the MESSAGE, NAME_SPACE, and APP_ID necessary to launch any other app directly.
Actually, it looks like you can open apps while leaving the "message" field set to null
.
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXXXX" -X PUT -d '{"VALUE": {"MESSAGE": null, "NAME_SPACE": 5, "APP_ID": "1"}}' https://XXX.XXX.XX.XXX:7345/app/launch
for example works.
I was able to get a list of app APP_ID, NAME_SPACE, and MESSAGE parameters from the apk source: raman325/pyvizio#22 (comment)
Can you verify the docs are correct now? in commit 6a27e7b
Also if someone can give the response from a successful /app/launch
??
Running
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXXXX" -X PUT -d '{"VALUE": {"MESSAGE": "https://www.youtube.com/tv", "NAME_SPACE": 5, "APP_ID": "1"}}' https://XXX.XXX.XX.XXX:7345/app/launch
results in
{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}}
thanks 👍
Docs added, thanks again for the information!
Sorry I just noticed that you have "name_space" and "app_id" as integer here:
`{
"VALUE": {
"MESSAGE": String,
"NAME_SPACE": Integer,
"APP_ID": Integer
}
}`
I believe it should be
`{
"VALUE": {
"MESSAGE": String,
"NAME_SPACE": Integer,
"APP_ID": String
}
}`
Running
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXXXX" -X PUT -d '{"VALUE": {"MESSAGE": "https://www.youtube.com/tv", "NAME_SPACE": 5, "APP_ID": "1"}}' https://XXX.XXX.XX.XXX:7345/app/launch
is successful (note "APP_ID": "1"), while running
curl -k -H "Content-Type: application/json" -H "AUTH: XXXXXXXXXX" -X PUT -d '{"VALUE": {"MESSAGE": "https://www.youtube.com/tv", "NAME_SPACE": 5, "APP_ID": 1}}' https://XXX.XXX.XX.XXX:7345/app/launch
(note "APP_ID": 1) results in
{"STATUS": {"RESULT": "INVALID_PARAMETER", "DETAIL": "Invalid parameter"}, "URI": "/app/launch"}