- Posts: 32
- Thank you received: 2
Vizio TV drive input change not working
- randyf
- Topic Author
- Offline
- User
-
Less
More
2 years 4 months ago #1773
by randyf
Vizio TV drive input change not working was created by randyf
The current Vizio TV driver doesn't work when changing inputs. From my
previous post
, the Select command doesn't show the proper information. After doing some research, I found a solution that works for me, until the driver can be looked at. It seems that recent versions of the Vizio SmartCast API has changed the input selection behavior. You first have to call a command to get the current input info, which returns an ID, and then this ID needs to be used when changing to a new input. The second thing is that the proper input name should be used. For example, on my TV, the inputs are listed as HDMI 1, HDMI 2, etc. But instead of using those values, the internal, lowercase value is needed. So hdmi1, hdmi2, etc.
I created a macro that I can use to change the inputs based on the above information, using the curl command. Dave created a new command named RunParseResults that will parse the results of the curl command, which I use to get the current input and the ID (hashval) to use when changing to the new input. Here is a copy of the macro:
Macro|
// Delete the existing variables first!
DelVariableContaining|vizio-greatroom-currentinput!
// Get the current input selection!
RunParseResults|curl~-k -H "Content-Type: application/json" -H "AUTH: {{vizio-tv-authtoken-greatroom}}" -X GET https://{{vizio-tv-ipaddress-greatroom}}:7345/menu_native/dynamic/tv_settings/devices/current_input~vizio-greatroom-currentinput!
// Change to the selected input!
Run|curl~-k -H "Content-Type: application/json" -H "AUTH: {{vizio-tv-authtoken-greatroom}}" -X PUT -d "{\"REQUEST\": \"MODIFY\",\"VALUE\": \"<P1>\",\"HASHVAL\": {{vizio-greatroom-currentinput_items_1_hashval}}}" https://{{vizio-tv-ipaddress-greatroom}}:7345/menu_native/dynamic/tv_settings/devices/current_input!
//!
// fini
I've named this macro "vizio-change-input-greatroom" and I can run it like this to change the input: vizio-change-input-greatroom|hdmi2
I created a room-specific macro so that I could use the two variables I created for the TV IP address and auth token, since those values don't seem to be available via a variable already. There may be some other things I could do to avoid having this so specific but this was the easiest thing to do for now and I only have two Vizio TVs to control.
I used the following resources to help figure this out:
github.com/exiva/Vizio_SmartCast_API
github.com/raman325/pyvizio
Hope this helps anyone else that might need it.
I created a macro that I can use to change the inputs based on the above information, using the curl command. Dave created a new command named RunParseResults that will parse the results of the curl command, which I use to get the current input and the ID (hashval) to use when changing to the new input. Here is a copy of the macro:
Macro|
// Delete the existing variables first!
DelVariableContaining|vizio-greatroom-currentinput!
// Get the current input selection!
RunParseResults|curl~-k -H "Content-Type: application/json" -H "AUTH: {{vizio-tv-authtoken-greatroom}}" -X GET https://{{vizio-tv-ipaddress-greatroom}}:7345/menu_native/dynamic/tv_settings/devices/current_input~vizio-greatroom-currentinput!
// Change to the selected input!
Run|curl~-k -H "Content-Type: application/json" -H "AUTH: {{vizio-tv-authtoken-greatroom}}" -X PUT -d "{\"REQUEST\": \"MODIFY\",\"VALUE\": \"<P1>\",\"HASHVAL\": {{vizio-greatroom-currentinput_items_1_hashval}}}" https://{{vizio-tv-ipaddress-greatroom}}:7345/menu_native/dynamic/tv_settings/devices/current_input!
//!
// fini
I've named this macro "vizio-change-input-greatroom" and I can run it like this to change the input: vizio-change-input-greatroom|hdmi2
I created a room-specific macro so that I could use the two variables I created for the TV IP address and auth token, since those values don't seem to be available via a variable already. There may be some other things I could do to avoid having this so specific but this was the easiest thing to do for now and I only have two Vizio TVs to control.
I used the following resources to help figure this out:
github.com/exiva/Vizio_SmartCast_API
github.com/raman325/pyvizio
Hope this helps anyone else that might need it.
Please Log in to join the conversation.
- davep
- Offline
- Admin
-
Less
More
- Posts: 367
- Thank you received: 96
2 years 4 months ago #1803
by davep
Replied by davep on topic Vizio TV drive input change not working
VizioTV driver has been updated. It now knows how to switch inputs. Use the drivers Source command.
Please Log in to join the conversation.
- randyf
- Topic Author
- Offline
- User
-
Less
More
- Posts: 32
- Thank you received: 2
2 years 4 months ago - 2 years 4 months ago #1805
by randyf
Replied by randyf on topic Vizio TV drive input change not working
Confirmed that this is now working, thanks Dave!
Last edit: 2 years 4 months ago by randyf.
Please Log in to join the conversation.
- David Li
- Offline
- Admin
-
Less
More
- Posts: 1019
- Thank you received: 99
2 years 4 months ago #1816
by David Li
Replied by David Li on topic Vizio TV drive input change not working
good to hear!
Please Log in to join the conversation.
Time to create page: 0.172 seconds