Vizio SmartCast TV configuration via pyvizio

I have been attempting to setup my Vizio Tv on my Hass.io running on my RaspberryPi3b+.

When I enter

pyvizio --ip=0 discover

I receive the following output

INFO:pyvizio.cli:Available devices:
IP      Model      Friendly name

I thought maybe I’ll just skip the discover step since I already know the IP and that it is a TV so I tried

pyvizio --ip=192.168.1.40 --device_type=tv pair
(tried using :9000 and :7345 to the same ends)

but the connection keeps timing out and I get the following

INFO:pyvizio.cli:Initiating pairing process, please check your device for pin upon success

ERROR:pyvizio.vizio:Failed to execute command: HTTPSConnectionPool(host='192.169.1.40', port=7345): Max retries exceeded with url: /pairing/start (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10db93910>: Failed to establish a new connection: [Errno 60] Operation timed out'))

I’m not sure where to go from here to get myself an authentication token. Any help would be appreciated. Thanks.

UPDATE: I am attempting to pair from my mac terminal running python 3.7.4 and pip 19.0.3

I don’t know if this will help with your issue, but you don’t need to use pyvizio to pair with your TV. You can do it from the command line. I wrote this script a while back and I don’t want to re-pair my TV, but from memory I think that both of the variables that it prompts for will appear on either the TV or in your terminal. Modify the IP address and port as needed.

#!/bin/bash

VIZIO_IP="192.168.0.15"
VIZIO_PORT="7345"

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