I’ve been wanting to be able to turn my TV on and off through HASS for a while now, but up until just recently, I haven’t been able to find any documented API for SmartCast. Now there is one here:
With that information, I was able to put together a command line switch
Hey kilosgreen, the github page has examples of how you would run these commands directly on a linux or osx terminal session using the curl command. So if you’re running HASS on a linux or osx box you should have no problems running these commands in a terminal window. Windows machine will most likely need to install curl, or use a vm like gitbash or cygwin. If you’re on windows try this stackoverflow to install curl.
Donno your technical level but did a quick google of curl tutorials and found this one that might help you.
To start using the vizio API u start with finding the IP of your TV. I found that using my router was an easy way of looking that up. Once you have ur TV’s IP you can start sending messages to it.
The flow to this API is:
Send ‘Start paring’ request - set the DEVICE_ID to something you will remember and will be unique
– Note the “DEVICE_ID” you sent and the response field “PAIRING_REQ_TOKEN”, we will need these later
A 4 digit code will be displayed on the top of ur screen for the next step
Send the ‘Submit Challenge’ request - use the same DEVICE_ID and PAIRING_REQ_TOKEN from the previous message. Set the field “RESPONSE_VALUE” with the 4 digit value shown on the screen
If the pairing worked ur TV should make a sound and the response of the ‘Submit Challege’ request should include an “AUTH_TOKEN” field. Use value on any request that is denoted needing an auth token.
Start sending messages to ur tv!
@cbulock Awesome find, I was thinking about trying to reverse engineer this myself, saves me a lot of work. Thanks!
I’m having issues with the commands when my TV is off, did you run into that at all? The commands work great while its on, but I can’t seem to turn it on, or get power state when its off.
I haven’t run into that problem, but I would suspect maybe it’s related to the power save mode. I have mine set to “quick start” instead of the Eco mode.
This is great, working on figuring out a way to integrate volume control as well. I have the command working, but I need to find a way to implement the curl command into HASS for volume up / volume down.
Greetings, nise finding, was struggling with CEC, was able to port to direct component now. I didn’t submit pull request yet, maybe will have some time later this week. Meanwhile you can use this custom component
configuration is simple
- platform: vizio
host: IP
access_token: token
name: Vizio TV Main
Hi Everyone,
Great finding. Can some one please mention what are the exact Vizio TV models it worked on ?
Did it work on the Vizio D-Series/ E-Series / M-Series / P-Series ?
How much farther will this have to go so new people like myself who are using Hass.io can add Vizio as a component? We aren’t able to do any command line stuff except reboot just about.