-
Notifications
You must be signed in to change notification settings - Fork 29
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
2020 Vizio TVs Return URI Not Found on version check #114
Comments
thanks! I am curious if other data points have also moved to this new endpoint. Can you run curl on /menu_native/dynamic/tv_settings/system/system_information/tv_information and paste the output here? |
Here is the results of the endpoint you requested: But also grabbed the below, in case it's more what you were looking for: Let me know if you need anything else, happy to grab it. |
Thank you, the second was indeed what I was looking for! |
Can you try pulling down the latest from master here: https://github.com/raman325/pyvizio and checking those commands? The commands would be |
I think I did it right. I did a Ran I ran the same commands against my 2018 TV and they were successful in returning results on this same build. |
Yes that's right because I bumped the version. It might be easier to run pip install -I Can you try the latest? I don't see how it would resolve the issue, but it's worth trying. Did you also happen to look at the additional endpoints I listed in I don't see what could be wrong aside from possibly the changes I just made |
Ah okay. I uninstalled, re-pulled the repo, and installed as suggested. Still seeing same issues. The new alt endpoints all look correct. To be sure, I copy/paste them and tested a curl against each. Version and serial returned success and ESN returned "requires pairing, since I didn't include any auth headers. I'm not sure I follow how the conditioning works in pyvizio/__init__.py, thought I'm still very much a python novice. item = await self.__invoke_api(
GetSerialNumberCommand(self.device_type),
log_api_exception=log_api_exception,
) or await self.__invoke_api(
GetAltSerialNumberCommand(self.device_type),
log_api_exception=log_api_exception,
) |
With that said, the latest changed this logic to be more explicit about calling the first and then calling the second. I will spend some more time looking at this later. |
just to confirm @yurdle when you looked at the latest code, do you still see the |
I don't when I check now. But I also see the last commit was 14 hours ago, so I must have been looking at an older commit when I was poking around and trying to understood earlier. |
Sorry to keep bugging you about this but can you pull the latest again and try again? I wish I had a device that had this behavior so that I could test locally 😞 |
No apologies needed. Happy to test as much as is necessary. Trying to reply as quickly as I notice a reply too. |
Much appreciated. I just pushed a new version with a new set of CLI commands (get-alt-serial-number/esn/version) that ONLY calls the alternate URLS (the |
Here's each of the commands and responses. $ pyvizio --ip 192.168.1.102 --auth <Token> get-alt-version
ERROR:pyvizio.cli:Couldn't get version
$ pyvizio --ip 192.168.1.102 --auth <Token> get-alt-esn
ERROR:pyvizio.cli:Couldn't get ESN
$ pyvizio --ip 192.168.1.102 --auth <Token> get-alt-serial-number
ERROR:pyvizio.cli:Couldn't get serial number Need me to provide the exact http responses? Perhaps they differ as well? |
Yes, that would be great. |
Is this what you need? $ curl -k -H "Content-Type: application/json" -H "AUTH: TOKEN" -X GET https://192.168.1.102:7345/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/uli_information/esn
{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}, "ITEMS": [{"HASHVAL": 1909715021, "NAME": "ESN", "VALUE": "LINIZALW2112343", "READONLY": "TRUE", "CNAME": "esn", "TYPE": "T_STRING_V1"}], "HASHLIST": [4288381043, 1549970040, 1489396298, 904742941], "URI": "/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/uli_information/esn", "PARAMETERS": {"FLAT": "TRUE", "HELPTEXT": "FALSE", "HASHONLY": "FALSE"}}
$ curl -k -H "Content-Type: application/json" -H "AUTH: TOKEN" -X GET https://192.168.1.102:7345/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/version
{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}, "ITEMS": [{"HASHVAL": 341066122, "NAME": "Version:", "VALUE": "1.10.15.1-2", "READONLY": "TRUE", "CNAME": "version", "TYPE": "T_STRING_V1"}], "HASHLIST": [2911612711, 1549970040, 1489396298, 904742941], "URI": "/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/version", "PARAMETERS": {"FLAT": "TRUE", "HELPTEXT": "FALSE", "HASHONLY": "FALSE"}}
$ curl -k -H "Content-Type: application/json" -H "AUTH: TOKEN" -X GET https://192.168.1.102:7345/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/serial_number
{"STATUS": {"RESULT": "SUCCESS", "DETAIL": "Success"}, "ITEMS": [{"HASHVAL": 734634561, "NAME": "Serial Number:", "VALUE": "21LINIZALW01234", "READONLY": "TRUE", "CNAME": "serial_number", "TYPE": "T_STRING_V1"}], "HASHLIST": [2911612711, 1549970040, 1489396298, 904742941], "URI": "/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/serial_number", "PARAMETERS": {"FLAT": "TRUE", "HELPTEXT": "FALSE", "HASHONLY": "FALSE"}} |
this is perfect! at first glance I don't see why the code wouldn't work but I will review anyway |
OK @yurdle I think I figured out why it wasn't working. Both the |
Success! With all 6 commands! |
The command classes were subclasses of this one: https://github.com/raman325/pyvizio/blob/master/pyvizio/api/item.py#L106-L138 This treats the name of the key in the dictionary of endpoints as the item name to look for. With these alternate versions of the API endpoints, I created new keys that don't match the name of the item. I created a new subclass that fixes it: https://github.com/raman325/pyvizio/blob/master/pyvizio/api/item.py#L189-L202 I don't love the way the code is structured but this has been mostly adapted from the original code so I haven't bothered changing it. At some point I was hoping to do a refactor to make things simpler to understand so others can contribute but at this point I am not sure if the extra effort is justified. In either case, thank you for your help in troubleshooting this, I will get this pushed out soon and submit a version bump to HA |
Can you check the latest one more time? I reverted some of the test changes I made and re-simplified the logic, just want to make sure I didn't break anything before I push it |
I removed |
Just pulled and re-tested, still working correctly with the original commands. |
The version endpoint on 2020 Vizio TVs appears to have moved to
/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/version
, while older devices remain at/menu_native/dynamic/tv_settings/system/system_information/tv_information/version
as pyvizio is currently written to use.I had enough know-how to find the issue, but not enough to know how to fix it.
Likely needing a condition, or something like try one, if fail, try the other?
I've only had the ability to test this against a V405-H9M myself and found it while trying to pair it with Home Assistant, but also saw this reported by other Home Assistant users: https://community.home-assistant.io/t/vizio-smartcast-tv-cannot-connect/240378/2
Log snippet from Home Assistant below:
And curl results against each endpoint:
The text was updated successfully, but these errors were encountered: