This code is deprecated as pyvizio has been updated to add sound bar support. Please use the latest pyvizio packages instead of this one.
Simple cli and API implementation for Vizio SmartCast SoundBars. Mainly created for integration with HASS.
pip3 install pyviziosoundbar
Either through pip
pip3 install git+https://github.com/raman325/pyviziosoundbar.git@master
or checkout repo and run
pip3 install -I .
To avoid repeating IP param, you can add it to environment variables as VIZIO_SOUNDBAR_IP
First, find your device (yeah, I'm too lazy to add another cli group)
pyviziosoundbar --ip=0 discover
and note it's IP address.
pyviziosoundbar --ip={ip} power {on|off|toggle}
To get current power state simply call
pyviziosoundbar --ip={ip} power
You could change volume
pyviziosoundbar --ip={ip} volume {up|down} amount
and get current level (0-100)
pyviziosoundbar --ip={ip} volume-current
In addition mute command is available
pyviziosoundbar --ip={ip} mute {on|off|toggle}
You can get current source
pyviziosoundbar --ip={ip} input-current
List all sources
pyviziosoundbar --ip={ip} input-list
And using Name
column from this list switch input
pyviziosoundbar --ip={ip} input-set {name}
Play media
pyviziosoundbar --ip={ip} play
Pause media
pyviziosoundbar --ip={ip} pause