The service call does not go in your configuration, it goes in your automation or script.
With some help I finally figured that out LOL I had a TON to clean up… I was putting stuff all over… took all that out.
I don’t know if this is universal, but on mine you can also set a default input on power up in the tv’s setting menu.
Well that may just make things VERY easy I’ll have to have a look at that!!!
If you follow the directions in other posts to pair and get an AUTH code for your TV, you can do something like this in 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 would pass in ip, port, auth code, codeset and code. The list of codeset and codes is:
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
I use this with custom button and conditional cards for complete Remotes that configure on way for DirecTV and differently when casting. They look like this:
Patio TV in SmartCast Mode:
Office TV in DirecTV mode with keyboard:
Changed to Favorities:
Power off in Bedroom:
I keep my TVs and DirectTV information in a JSON file and read that with a command_line sensor. The JSON file looks like this:
{
“tvs”: [
{
“name”: “patio_vizio”,
“ip”: “192.168.2.90”,
“port”: 7345,
“auth”: “UISAIUYDIUjhsjhk”,
“clientAddr”: “CD03FBF73E59”,
“favorites”: [
{
“callsign”: “ESPNHD”,
“channel”: 206
},
{
“callsign”: “ESPN2HD”,
“channel”: 209
},
{
“callsign”: “NFLHD”,
“channel”: 202
},
{
“callsign”: “NFLHD”,
“channel”: 212
},
{
“callsign”: “NHLHD”,
“channel”: 215
},
{
“callsign”: “MLBHD”,
“channel”: 213
},
{
“callsign”: “NBAHD”,
“channel”: 216
},
{
“callsign”: “GolfHD”,
“channel”: 218
},
{
“callsign”: “FS1HD”,
“channel”: 219
},
{
“callsign”: “NBCSHD”,
“channel”: 220
},
{
“callsign”: “CBSSHND”,
“channel”: 221
},
{
“callsign”: “RedZone”,
“channel”: 702
},
{
“callsign”: “BTNHD”,
“channel”: 610
}
]
},
Of course, that is my info for my devices. The clientAddr is for DirecTV Genie boxes and I also have a rest_command to operate that one. I would note that the Vizio REST integration is very fast, as fast as using the remote. All my remotes now sit in a drawer with no batteries, no need at all for them.
I do have a few Broadlink devices but I only use those for volume on attached devices (wired only Soundbar and a Denon AV reveiver on two of the TVs).