Control Vizio TV? Integration?

Has anyone here been able to control their Vizio TV via SmartThings, not using Harmony?

My main TV is a Vizio E60u-D3.

I know that this TV has some sort of web interface, I’m just not good enough to figure out how to use it. They offer an app that goes on your phone and is able to control your TV…it is a full blown remote for your TV and you can also configure all picture/audio/etc settings on it. All I want to do is have the ability to turn it off via this web interface via SmartThings. It gets left on all the time or we’ll accidentally connect to the chromecast on it, which turns it on, when we meant to connect to a different TV.

I’ve tried using wireshark to sniff the network while I hit the power button in the app, but I’m just not seeing anything of use.

UPDATE: Apparently, a couple months ago, this was created:

So I’ll work from there…

Okay, so I got it figured out using cURL, so far I’ve been able to turn the TV on and off, but as far as implementing it into a DeviceType, that seems like it might be tough…any tips?

In order for this to work, you have to pair it…to pair, you send it via JSON a DeviceID and a DeviceName.

Then it responds with a token and displays a PIN on the TV Screen.

So your response has to contain the pin and the token and if it’s correct, it responds with the auth string.

The thing I don’t know, is if that auth string can be used wherever or if it is linked to a device MAC address or IP or something. I haven’t tested that yet.

Here’s a sample cURL command that I can successfully run to turn the TV off (running the command on windows)

curl -k
-H "Content-Type: application/json"
-H "AUTH: blahblahblah"
-X PUT
-d "{\"KEYLIST\": [{\"CODESET\": 11,\"CODE\": 0,\"ACTION\":\"KEYPRESS\"}]}" 
https://192.168.0.107:9000/key_command/

I would definitely like to do this with my Vizio M65-d0. Let me know if you figure it out.

The TV I’m testing is an E series, I’m not sure what options there are for the M series. The documentation I found is for the SmartCast API. Best way to check and see if it is supported is to figure out the TV’s IP address, then on a computer go to this site:
https://[TV IP ADDRESS]:9000/state/device/power_mode

It should bring up a page that gives you some info on the TV’s current power status.

If nothing comes up then either there’s no API or it uses a different one than the one I found.

Has anyone had any luck getting this working??

The new Vizio app and firmware has Alexa and Google Home support.

Technically yes, I did get it working. However, I wrote all the code in Powershell hahahaha. Mainly because I haven’t had the time to learn how to write a device handler.

I’m able to turn the TV on/off, switch inputs, and just about anything else you can do via the API on the TV.

I found this thread and started to test these commands recently from the API referenced here (https://github.com/exiva/Vizio_SmartCast_API). I can confirm once you pair a device and receive an auth token, it is good across all IP’s and MACs (tested with separate devices not associated with the pairing process). I have found that trying to change the input source to a specific name has a problem.

I used the “GET /menu_native/dynamic/tv_settings/devices/name_input”:

curl -k -H "Content-Type: application/json" -H "AUTH: xxxx" -X GET https://192.168.1.xxx:7345/menu_native/dynamic/tv_settings/devices/name_input

Generated this source list and HDMI1 is of interest to me:

{“STATUS”: {“RESULT”: “SUCCESS”, “DETAIL”: “Success”}, “HASHLIST”: [3913157447, 3258122002, 2001023066], “GROUP”: “G_DEVICES”, “NAME”: “Name Input”, “PARAMETERS”: {“FLAT”: “TRUE”, “HELPTEXT”: “FALSE”, “HASHONLY”: “FALSE”}, “ITEMS”: [{“HASHVAL”: 4003165621, “CNAME”: “cast”, “NAME”: “CAST”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “READONLY”: “TRUE”, “VALUE”: {“NAME”: “SMARTCAST”, “METADATA”: “”}}, {“HASHVAL”: 193593639, “CNAME”: “hdmi1”, “NAME”: “HDMI-1”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “VALUE”: {“NAME”: “HDMI-1 Switch”, “METADATA”: “”}}, {“HASHVAL”: 292178829, “CNAME”: “hdmi2”, “NAME”: “HDMI-2”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “VALUE”: {“NAME”: “HDMI-2”, “METADATA”: “”}}, {“HASHVAL”: 3938325493, “CNAME”: “hdmi3”, “NAME”: “HDMI-3”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “VALUE”: {“NAME”: “HDMI-3”, “METADATA”: “”}}, {“HASHVAL”: 1344491825, “CNAME”: “hdmi4”, “NAME”: “HDMI-4”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “VALUE”: {“NAME”: “HDMI-4”, “METADATA”: “”}}, {“HASHVAL”: 2214376780, “CNAME”: “comp”, “NAME”: “COMP”, “TYPE”: “T_DEVICE_V1”, “ENABLED”: “FALSE”, “VALUE”: {“NAME”: “COMP”, “METADATA”: “”}}], “URI”: “/menu_native/dynamic/tv_settings/devices/name_input”, “CNAME”: “name_input”, “TYPE”: “T_MENU_V1”}

Trying to change the source input: “PUT /menu_native/dynamic/tv_settings/devices/name_input”

curl -k -H "Content-Type: application/json" -H "AUTH: xxxxx" -X PUT -d '{"REQUEST": "MODIFY","VALUE": "HDMI-1","HASHVAL": 193593639}' https://192.168.1.xxx:7345/menu_native/dynamic/tv_settings/devices/current_input

I receive a hashcode invalid error when using the provided code when pulled from “GET /menu_native/dynamic/tv_settings/devices/name_input” and haven’t found a way to directly change the source. Help on this would be great!

{"STATUS": {"RESULT": "HASHVAL_ERROR", "DETAIL": "Hashval error"}, "URI": "/menu_native/dynamic/tv_settings/devices/current_input", "PARAMETERS": {"HASHVAL": 193593639, "REQUEST": "MODIFY", "VALUE": "HDMI-1"}}

Anyhow, I am going to start writing a device handler to make web requests with this API; we’ll see how this goes with a basic interface without the fancy discovery and pairing process; perhaps I’ll add that in later once it is up and going.

2 Likes

Just saw your comment on this thread. Thought I’d help.

So to switch inputs, it’s a little more complicated than turning the TV on/off…It looks like you’ve got everything right, except for one thing. For some reason, the API requires that you provide the HASHVAL for the input the TV is currently on, not the one you want to change it to. It makes no sense to me, but that’s what it wants.

So you’ll need to add an extra step that grabs the HASHVAL for the current input, and then passes that into the JSON you’re generating for changing the input.

Let me know if you want me to send you the PowerShell code I wrote up for this. It makes scripting against the TV quite nice. I built a class for the TV, so once you’ve got it all scripted up, all you have to type is TV.Power.On(), TV.Power.Off(), TV.Input.List(), TV.Input.Set(Name) etc.

Greetings there,

Yes, I’d appreciate your powershell script. I’ll be able to transcribe the code to javascript. Thank you so much.

Nate

I just finished writing a node program and a device handler to connect to my Vizio tv (M65-D0) using https://www.npmjs.com/package/vizio-smart-cast. I think it might for you too. Let me know if you are interested, I will share what I have

2 Likes

I’m interested to understand how you have it set up… Can you please share your DH and set up instructions?

I’m interested too

I’m interested as well. Thanks!

Hi - I’m trying to add my vizio smart cast to SmartThings just to be able to turn on and off. Any luck on sharing this Device Handler? Thanks!

2 Likes

Bumping again, what did you end up doing? Just posted a thread asking for advice here…

1 Like