Vizio TV Integration

Could someone please assist me in trying to get my Vizio TV working with Home Assistant??

It has been discovered and i can turn it on and off but i want to know what i need to do in order to create scripts/automations or whatever i need to do to setup buttons on my home assistant dashboard to directly select apps like netflix and use navigation keys up down left right etc.

I have spent weeks browsing the internet and keep seeing pyvizio mentioned but when i try to run the commands listed i get pip command not found and no one really gives any instructions to follow.

My samsung TV’s were childs play to get working i cant believe that vizio tv’s can be this difficult to intergrate.

Thanks.

It’s the same service call as the samsung. media_player.select_source data "source":"Netflix" Lowercase n will not work, be sure to check dev tools for the correct spelling of the source.

App/Source selection is easy… just assign your button’s Tap Action > Call Service:

service: media_player.select_source
data:
  source: 'Netflix'
target:
  entity_id: media_player.vizio_smartcast

The quotes around Netflix aren’t actually necessary, but they are necessary for sources with symbols or punctuation in their name such as ‘HDMI-1’.

I’ve never bothered with navigation… I’ll play around with it and see if I can come up with anything.

what about emulating simple remote commands like navigation keys up down home menu etc??

Can nobody still point me in the right direction for simple remote command emulation for a Vizio tv??

I’ve tried using the same send key commands that I use for my Samsung tvs but the only thing I’m managed to get working currently is power toggle and volume up and down.

Can’t believe for a minute that I’m the only one having this issue with how complicated it appears to be.

I’m not a massively experienced programmer but have managed to do my entire dashboard using code only so far all I’m looking for is some confirmed steps to get this working.

Of the 1.2% of user using this integration perhaps nobody has tried what you want to accomplish. Perhaps if you showed us what you tried that filed along with any errors others could assist, you need to understand your system anyway and not just copy a solution from others. Like the pinned thread says, This is not a HelpDesk.

If I can control the TV through NodeRed, there has to be a way to create a lovelace remote. I tried a few variations on the lovelace remote I have for my AppleTVs, but I wasn’t successful. I’m sure you just have to find the right combination of data and formatting to get it to work.

Where you able to get anywhere with this? I have my Vizio TV connected to my Home Assistance insistence and can power on/off the TV as well as change the volume. I’d like to know if there’s a way to have the input on TV and be able to change TV inputs. Basically an up/down option on the channel change would even work. Thanks!

Did you try media_player.select_source? If you renamed your inputs you need to use their default designation eg “HDMI-1” “HDMI-2” “HDMI-3” etc

service: media_player.select_source
data:
  source: "HDMI-2"
target:
  entity_id: media_player.nowhere
1 Like

I just brought a Broadlink RM4 in the end and stuck it to the back of the TV with the ir blaster facing down. Apart from the direct APP selection everything else worked prefectly. I just used the above code for selecting apps directly.

I have a full integration using pyvizio and direct access to remote commands. I was about to post it all on github in the next few days … but I have to chop it up as mine is a complete remote including directv.

Note. No broadlink or ir or anything. Just pairing your code to the set as a remote.

To be truthful if I had time, one could actually expose one service to send commands as remote and everything I did would just call that service.

As a rest_command:

vizio_processkey:
  url: 'https://{{ ip }}:{{ port }}/key_command/'
  method: put
  content_type: "application/json"
  headers:
    AUTH: '{{ auth }}'
  payload: '{"KEYLIST": [{"CODESET": {{ codeset | int }},"CODE": {{ code | int }},"ACTION":"KEYPRESS"}]}'
  verify_ssl: false

You only need then:

IP (you should know this)
Port (likely 7245 for newer models)
AUTH (you get from pairing with the TV)
And then Codeset/Codes … like this:

Event Name Codeset Code
Volume Down 5 0
Volume Up 5 1
Mute Off 5 2
Mute On 5 3
Mute Toggle 5 4
Cycle Input 7 1
Power Off 11 0
Power On 11 1
Power Toggle 11 2
Down 3 0
Left 3 1
Select 3 2
Up 3 8
Right 3 7
Back 4 0
Exit 9 0
Menu 4 8
Home 4 3

Given that, I create something like this:

image

I can change inputs, cursor all around, select things, quick access some things like “Netflix” go to home, menu and turn volume up/down/mute.

As I said, in my remotes … if you select “HDMI-1” which is always DirecTV in my home on all four sets, the whole remote changes to DirecTV like this:

Or with Favorites like this:

It is pretty damn good, needs a tweak here and there, But all the posts abour setting the input to “Netflix” are great … except then you hit the “Who is watching” or when you get into the app you cannot move around. So you need the remote. So those posts are worthless really, you need the remote.

I have NO remotes and no need for them. HA and a phone.

3 Likes

I looked into pyvizio briefly back when i was looking to do this and couldnt find alot of info on getting it set up. Im pretty new to home assistant as a package and couldnt find any real guide on how pyzivio gets set up. if you could provide alittle info that would be amazing.

I still plan on using the broadlinks as i have 1 on every tv as it gives temp and humidity for the room too which is a nice touch on the dashboard but to have a better integration for the tv would be ideal.

If you installed the Vizio integraton, you have pyvizio (although you do not really need it). To me, the developer built the first part – pairing with the TV and only one feature exposed as a service vizio.update_setting. WHat you really need to control the TV is to implement the API for key_command.

This is what the above code does. All modern Vizio TVs implement a REST API which you can post a JSON payload to it. If you read through the Vizio API docs on Github (https://github.com/exiva/Vizio_SmartCast_API), everything is described there.

You only need to pair with your TV to get an AUTH code that allows for submitting to the REST service. The Vizio integration does this but I see no way of getting it’s AUTH code. So I just followed the instructions on that page using curl and got a new AUTH code.

Then using that AUTH code, I can send commands to the TV just like a remote control but via REST and your home network. As you can see above, it allows you to control Volume, Mute, Cycle input (like pushing the INPUT button), using the D-PAD up/down/left/right and OK buttons, display the Settings or go Back. Everything you need.

I just call my new service like this (in a custom button template):

    tap_action:
      action: call-service
      service: rest_command.vizio_processkey
      service_data:
        ip: '[[[ return variables.ip ]]]'
        port: '[[[ return variables.port ]]]'
        auth: '[[[ return variables.auth ]]]'
        codeset: '[[[ return variables.codeset ]]]'
        code: '[[[ return variables.code ]]]'

I send to it the IP, Port, AUTH code, codeset and code shown in the table above and you have a remote on your screen. I will note that the pyvizio documentation lags behind the Javascript version referenced on that page. I had to read through both to get all of the key commands (codeset and code), especially those for the D-PAD. But you have them above.

1 Like

so where do i enter these commands detailed in the link you provided?? ive tried entering PUT commands into the terminal and it responds with no command found

Do you have curl installed? It is not clear you do if you say it responds with “No command found” … I assume that means curl is not found. What are you using to execute the commands? A Windows PC? A Linux box?

Keep in mind you can do this from anything. You are just trying to get an AUTH key that allows you to send commands.

Like I can enter on my WIndows PC cmd prompt:

curl -k -H "Content-Type: application/json" -X PUT -d "{\"DEVICE_ID\":\"12345\",\"DEVICE_NAME\":\"Patio_Vizio\"}" https://192.168.2.90:7345/pairing/start

And if I did, the TV located at 192.168.2.90 would display a PIN number on it.

yes it appears curl is installed as when i use it it prompts me to use --help

what parts of the below command do i need to populate?? i know the ip address, its reserved and its already added as a viziocast device

curl -k -H “Content-Type: application/json” -X PUT -d ‘{“DEVICE_ID”:“12345”,“DEVICE_NAME”:“cURL Example”}’ https://myVizioTV:9000/pairing/start

https://myVizioTV:9000/pairing/start would be your TV … like mine is https://192.168.2.90:7345/pairing/start

So use your IP address for your TV

And personally I would name it better (not “cURUL Example” but that is your choice).

so i only need to change the ip and port?? what about the rest of the curl command?

You need at least your IP and your port (which should be 7345 for a modern Vizio TV). When you are successful, a pin code will display on the TV and you would get something like this back:

{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}, "ITEM": {"CHALLENGE_TYPE": 1, "PAIRING_REQ_TOKEN": #######}}

yes entering the command using my laptop results in the tv displaying a pin code. whats the next step?
i think its only the auth code im missing at the moment