VIZIO SmartCast
The VIZIO SmartCast integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to control SmartCast
Find your device
If zeroconf
discovery is enabled, your device will get discovered automatically. To discover your device manually, read the subsections below.
Install pyvizio locally
If the pip3
command is not found, try pip
instead
- To install, run
pip3 install pyvizio
in your terminal. - If
pyvizio
is already installed locally, make sure you are using the latest version by runningpip3 install --upgrade pyvizio
in your terminal.
Discover devices
Find your device using the following command:
pyvizio --ip=0 discover
Write down its IP address and port number. If you have trouble finding a device you were expecting to, you can try increasing the discovery timeout period by adding the --timeout
option (e.g., pyvizio --ip=0 discover --timeout=10
).
Pairing
This integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] requires an access token in order to communicate with TVs (speakers do not need an access token). An access token can be obtained by going through a pairing process, either manually, or through the Home Assistant frontend.
Pair using the Home Assistant frontend
-
Using
configuration.yaml
: If you have avizio
entry inconfiguration.yaml
but don’t provide an access token value in your configuration, after you initialize Home Assistant, you will see a VIZIO SmartCast device ready to be configured. When you open the configuration window, you will be guided through the pairing process. While Home Assistant will store the access token for the life of yourvizio
entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], it is a good idea to note the access token value displayed in the window and add it to yourconfiguration.yaml
. This will ensure that you will not have to go through the pairing process again in the future if you decide to rebuild your Home Assistant instance. - Using discovery or manual setup through the Integrations menu: To initiate the pairing process, submit your initial configuration with an empty Access Token value.
Pair manually using the CLI
The following script, written by JeffLIrion<IP>
with your IP and <PORT>
(which is typically 7345 or 9000).
#!/bin/bash
VIZIO_IP="<IP>"
VIZIO_PORT="<PORT>"
curl -k -H "Content-Type: application/json" -X PUT -d '{"DEVICE_ID":"pyvizio","DEVICE_NAME":"Python Vizio"}' https://${VIZIO_IP}:${VIZIO_PORT}/pairing/start
read -p "PIN: " VIZIO_PIN
read -p "PAIRING_REQ_TOKEN: " VIZIO_PAIRING_REQ_TOKEN
curl -k -H "Content-Type: application/json" -X PUT -d '{"DEVICE_ID": "pyvizio","CHALLENGE_TYPE": 1,"RESPONSE_VALUE": "'"${VIZIO_PIN}"'","PAIRING_REQ_TOKEN": '"${VIZIO_PAIRING_REQ_TOKEN}"'}' https://${VIZIO_IP}:${VIZIO_PORT}/pairing/pair
Pair manually using pyvizio
To obtain an auth token manually, follow these steps:
Make sure that your device is on before continuing.
Parameter | Description |
---|---|
ip |
IP Address:Port (obtained from the previous section) |
device_type |
The type of device you are connecting to. Options are tv or speaker
|
Enter the following command to initiate pairing:
pyvizio --ip={ip:port} --device_type={device_type} pair
Initiation will show you two different values:
Value | Description |
---|---|
Challenge type | Usually, it should be "1" . |
Challenge token | Token required to finalize pairing in the next step |
At this point, a PIN code should be displayed at the top of your TV. With all these values, you can now finish pairing:
pyvizio --ip={ip:port} --device_type={device_type} pair-finish --token={challenge_token} --pin={pin} --ch_type={challenge_type}
You will need the authentication token returned by this command to configure Home Assistant.
Configuration
To add your VIZIO TV to your installation, add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file:
# Example configuration.yaml entry
vizio:
- host: "DEVICE_IP:DEVICE_PORT"
access_token: AUTH_TOKEN
Configuration Variables
Nickname for your device that will be used to generate the device’s entity ID. If multiple VIZIO devices are configured, the value must be unique for each entry.
Authentication token you received in the last step of the pairing process. This token is only needed if your device is a TV, and you can opt not to provide it in your configuration and instead go through the pairing process via the Home Assistant frontend.
The class of your device. Valid options are tv
or speaker
.
The number of steps that the volume will be increased or decreased by at a time.
Use this section to define app specific settings (only applicable for VIZIO Smart TVs).
List of apps to include in the source list. Cannot be used in combination with exclude
.
List of apps to exclude from the source list. Cannot be used in combination with include
.
List of manually configured apps that aren’t available in the default app list provided by the integration.
The name of the app that will be used in the source list and used to launch the app.
The app configuration that will be used to detect and launch the app.
See Obtaining an app configuration section below.
See Obtaining an app configuration section below.
See Obtaining an app configuration section below.
# Complete configuration.yaml entry
vizio:
- host: "DEVICE_IP:DEVICE_PORT"
access_token: AUTH_TOKEN
name: MY_VIZIO_DEVICE
device_class: tv
volume_step: 1
apps:
include:
- APP_1
- APP_2
exclude:
- APP_1
- APP_2
additional_configs:
- name: MY_CUSTOM_APP
config:
APP_ID: 9
NAME_SPACE: 9
MESSAGE: MY_MESSAGE
Obtaining an app configuration
If there is an app you want to be able to launch from Home Assistant that isn’t detected by default, you will need to specify the app configuration in configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]. This configuration can be obtained from the app_id
state attribute when an unknown app is running on your device.
Obtaining a list of valid apps to include or exclude
The list of apps that are provided by default is statically defined herepyvizio
to be installed locally):
pyvizio --ip=0 get-apps-list
Action vizio.update_setting
This action allows you to update a setting on a given VIZIO device. You will need to know the type of setting and the name of the setting to perform this action. You can determine this by using the SmartCast app and going to device settings for your target device. The setting type is the lowercase version of the first menu item you’d select (e.g., display, audio, system), and the setting name is what you see in the app, but spaces are replaced with underscores and it is also all lowercase (e.g., AV delay would be called av_delay
).
Data attribute | Optional | Description | Example |
---|---|---|---|
entity_id |
yes | The devices to update a setting for. | media_player.vizio_smartcast |
setting_type |
no | The type of setting. | audio |
setting_name |
no | The name of the setting. | eq |
new_value |
no | The new value to set the setting to. | Music |
Notes and limitations
Turning device on
If the Power Mode
of your device is set to Eco Mode
, turning the device on won’t work.
Changing tracks
Changing tracks works like switching channels. If the current input is anything other than regular TV, this command might not do anything.