pyvizio: 2020 Vizio TVs Return URI Not Found on version check

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:

2020-11-11 22:28:58 DEBUG (MainThread) [pyvizio.api._protocol] Using Command: GetVersionCommand({'_url': '/menu_native/dynamic/tv_settings/system/system_information/tv_information/version', 'item_name': 'VERSION', 'default_return': None})
2020-11-11 22:28:58 DEBUG (MainThread) [pyvizio.api._protocol] Using Request: {'method': 'get', 'url': 'https://192.168.1.102:7345/menu_native/dynamic/tv_settings/system/system_information/tv_information/version', 'headers': {}}
2020-11-11 22:28:58 DEBUG (MainThread) [pyvizio.api._protocol] Response: {'STATUS': {'RESULT': 'URI_NOT_FOUND', 'DETAIL': 'URI not found'}, 'URI': '/menu_native/dynamic/tv_settings/system/system_information/tv_information/version'}
2020-11-11 22:28:58 ERROR (MainThread) [pyvizio] Failed to execute command: unexpected status URI_NOT_FOUND: URI not found

And curl results against each endpoint:

$ curl -k https://192.168.1.102:7345/menu_native/dynamic/tv_settings/system/system_information/tv_information/version
{"STATUS": {"RESULT": "URI_NOT_FOUND", "DETAIL": "URI not found"}, "URI": "/menu_native/dynamic/tv_settings/system/system_information/tv_information/version"}
$ curl -k 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": [731341160, 2266556823, 1317704272, 116765155], "URI": "/menu_native/dynamic/tv_settings/admin_and_privacy/system_information/tv_information/version", "PARAMETERS": {"FLAT": "TRUE", "HELPTEXT": "FALSE", "HASHONLY": "FALSE"}}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (14 by maintainers)

Most upvoted comments

Just pulled and re-tested, still working correctly with the original commands. Glad I could help, thank you for your help as well. Look forward to seeing this fixed in HA.

__invoke_api should return None if the endpoint is not found, so or basically says run the second command if the first one doesn’t work.

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.