Control Vizio TV? Integration?


#1

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…


(Beginner) Sending commands to an API via Device Handler, help?
#2

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/

(greg) #3

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


#4

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.


#5

Has anyone had any luck getting this working??


(Bill Ho) #6

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


#7

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.


#8

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.