Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vizio SoundBar API #19

Open
trevorharwell opened this issue Nov 28, 2018 · 8 comments
Open

Vizio SoundBar API #19

trevorharwell opened this issue Nov 28, 2018 · 8 comments

Comments

@trevorharwell
Copy link

trevorharwell commented Nov 28, 2018

I have been experimenting with using this for the Vizio SoundBar. It seems that a lot of the same APIs exist but I cannot figure out how to get access to the full list. I don't have a way to decompile the app but if someone could post the URLs that would be incredibly helpful! (@shafeey)

@LuckyStyle
Copy link

I would like to know this as well. Any updates?

@shafeey
Copy link

shafeey commented Jan 3, 2019

Apologies, I somehow skipped the notification.
I've attached a decompiled source of the SmartCast apk in case you want to take a better look. the "com\vizio\vue\devicecontrol\api" path may be a good starting point to look into. In particular, VZRestEndpoint.class contains all the text strings required to construct the query URL. You can look into the content here.

Soundbar control in the app has only a few settings compared to the TV. you can replace "tv_settings" by "audio_settings" in the query to make it work for anything supported in the soundbar. However, I had trouble setting the volume directly by a value. Any value greater than 18 doesn't work. You can set the volume to anything by sending remote keypress events, or set the volume to a value < 18. Couldn't figure out what causes this.

Hope you can figure out what you are looking for.

VizioSmartCast_Decompiled.zip

@LuckyStyle
Copy link

That's exactly what I needed! Thanks!!!

API INPUT URLS:
Get currently selected input:
GET /menu_native/dynamic/audio_settings/input/current_input

Get list of inputs:
GET /menu_native/dynamic/audio_settings/input

Change Input:
PUT /menu_native/dynamic/audio_settings/input/current_input

@LuckyStyle
Copy link

Changing the volume directly is not working at all for me. It returns a success response, but it doesnt actually make the change. Any Ideas?

Using:
/menu_native/dynamic/audio_settings/audio/volume

{"REQUEST": "MODIFY","VALUE": 10,"HASHVAL": hashval}

@raman325
Copy link

raman325 commented Mar 5, 2019

Have you managed to figure out what key press values to use? I'm attempting to build a modified https://github.com/vkorn/pyvizio to support SoundBars. Here's the keymap I've put together so far to replace https://github.com/vkorn/pyvizio/blob/master/pyvizio/protocol.py#L58-L69

    VOL_DOWN = (5, 0)
    VOL_UP = (5, 1)
    MUTE_OFF = (5, 2)
    MUTE_ON = (5, 3)
    MUTE_TOGGLE = (5, 4)
    INPUT_NEXT = (7, 1)
    CH_DOWN = (8, 0)
    CH_UP = (8, 1)
    CH_PREV = (8, 2)
    POW_OFF = (11, 0)
    POW_ON = (11, 1)
    POW_TOGGLE = (11, 2)
    DOWN = (3, 0)
    LEFT = (3, 1)
    RIGHT = (3, 7)
    UP = (3, 3)
    OK = (3, 2)
    BACK = (4, 0)
    MENU = (4, 8)
    PLAY = (2, 3)
    PAUSE = (2, 2)
    SKIP_FWD = (2, 0)
    SKIP_BACK = (2, 1)

I have yet to test it

@raman325
Copy link

raman325 commented Mar 7, 2019

So it seems that some of the keys work for Sound Bars (listed below), but I still cannot figure out how to emulate the button to change inputs or to go to the next track or previous track even though I see those buttons on my remote. I've tried various tuples, including the options in my list above that are not included below, without success.

    VOL_DOWN = (5, 0)
    VOL_UP = (5, 1)
    MUTE_OFF = (5, 2)
    MUTE_ON = (5, 3)
    MUTE_TOGGLE = (5, 4)
    POW_OFF = (11, 0)
    POW_ON = (11, 1)
    POW_TOGGLE = (11, 2)
    PLAY = (2, 3)
    PAUSE = (2, 2)

@Uk0kA
Copy link

Uk0kA commented Dec 29, 2019

Old thread that pointed me in the right direction. Was able to modify the volume value. Still can't figure out how to properly send PUT requests for the keypress function. Any help would be appreciated.

@raman325
Copy link

raman325 commented Feb 1, 2020

@Uk0kA can you link to the thread?

Regarding your question, the curl command is here: https://github.com/exiva/Vizio_SmartCast_API#send-remote-control-button-press

You need to refer to the Appendix for the appropriate Codeset and Code, and the Action is "KEYPRESS"

EDIT: Nevermind about the question, I was being dumb when testing this

NasaGeek added a commit to NasaGeek/ha-core that referenced this issue Jan 26, 2024
Leverages existing pyvizio functionality. My impression is that it also
works for soundbars based on exiva/Vizio_SmartCast_API#19.
emontnemery pushed a commit to home-assistant/core that referenced this issue Apr 25, 2024
#108896)

* Add play/pause functionality to vizio integration

Leverages existing pyvizio functionality. My impression is that it also
works for soundbars based on exiva/Vizio_SmartCast_API#19.

* Set vizio assumed_state to True

The Vizio API is only capable of indicating whether the device is on
or off and not whether it's playing/paused/idle. Setting assumed_state
to True gives us separate Play and Pause buttons versus the (useless)
merged Play/Pause button we would get otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants