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

"Failed to set up Vizio platform" on startup if TV is off #30817

Closed
Tediore opened this issue Jan 16, 2020 · 26 comments · Fixed by #30867
Closed

"Failed to set up Vizio platform" on startup if TV is off #30817

Tediore opened this issue Jan 16, 2020 · 26 comments · Fixed by #30867

Comments

@Tediore
Copy link

Tediore commented Jan 16, 2020

Home Assistant release with the issue: 0.104.0

Last working Home Assistant release (if known): 0.103.6

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io on Raspbian 10

Integration: https://www.home-assistant.io/integrations/vizio/

Description of problem:
If the TV I have connected to Home Assistant via the Vizio SmartCast integration is turned off when I restart Home Assistant, an error is printed and the device becomes unavailable with the restored attribute:

ERROR (SyncWorker_1) [homeassistant.components.vizio.media_player] Failed to set up Vizio platform, please check if host is valid and available and auth token is correct

The host is valid and available, and the auth token is correct. I've confirmed this by running the power-get command with pyvizio. I set logger to debug, but nothing of interest seems to appear in the log related to the Vizio integration.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

media_player:
- platform: vizio
  host: 10.0.0.50
  access_token: !secret living_room_tv_token

Traceback (if applicable):

None

Additional information:
TV power mode is set to "quick start" if that's relevant. Model E55-E2. Please let me know what I can help test. As stated previously, I have pyvizio installed outside of Home Assistant, so I can run commands with that.

@probot-home-assistant
Copy link

Hey there @raman325, mind taking a look at this issue as its been labeled with a integration (vizio) you are listed as a codeowner for? Thanks!

@raman325
Copy link
Contributor

@Tediore this was fixed in a more recent version of pyvizio so I just need to do a version bump. Will submit a PR shortly

@raman325
Copy link
Contributor

raman325 commented Jan 16, 2020

Actually do me this favor just so we can verify that things will work before I submit the PR. Since you have pyvizio installed outside of HomeAssistant, try the following:

  1. pip install pyvizio==0.0.12
  2. Open python
  3. Run the following:
from pyvizio import Vizio
device = Vizio("name", "10.0.0.50", "id", "<AUTH_TOKEN>", "tv")
device.can_connect()

The above should return False.

Then do the following.

  1. pip install pyvizio==0.1.0
  2. Open python
  3. Run the following:
from pyvizio import Vizio
device = Vizio("name", "10.0.0.50", "id", "<AUTH_TOKEN>", "tv")
device.can_connect()

The above should return True

Can you verify that is the case before I submit a PR?

@Tediore
Copy link
Author

Tediore commented Jan 16, 2020

Absolutely, I can do that tonight.

@Tediore
Copy link
Author

Tediore commented Jan 16, 2020

Yep, I received the same results.

@raman325
Copy link
Contributor

Great, submitted a PR to bump the pyvizio version which should resolve the issue. Assuming this makes 0.104.2, please let me know if this issue hasn't been resolved

@Tediore
Copy link
Author

Tediore commented Jan 17, 2020

Awesome, thanks! Let me know if you ever need testing in the future.

@raman325
Copy link
Contributor

raman325 commented Jan 17, 2020

Will do, thanks! I was actually interested in sending someone with a Vizio TV a script to get a raw dump of the API responses from your device for a collection of API commands so that I could set up some tests in the pyvizio component (I only have a soundbar), so if I get time to make one, I will send you a message

@raman325
Copy link
Contributor

@Tediore this didn't make 0.104.2 because of concerns about how the latest version of pyvizio would interact with 104 given that some of those versions were pushed alongside additional PRs that will be pushed in the next release (0.105). I think this should make 0.104.3, because I aimed for backwards compatibility with every update to pyvizio, but just an FYI

@Tediore
Copy link
Author

Tediore commented Jan 18, 2020

No worries, thanks for letting me know! I implemented a pretty ridiculous workaround in the meantime... I have a bash script running on the host that runs the power-get command every five seconds and prints the output to a file. Then I have a file sensor set up in home assistant that reads that file. I use the integration more for turning the lights on/off when I turn the TV off/on instead of actually turning it off/on with Home Assistant.

If it's stupid and it works, it's not stupid...right? 😛

@raman325
Copy link
Contributor

It's not ridiculous if it works! OK so this bug fix may have to wait until 105.0. It turns out that in order to bump the version number, another larger PR would have to get merged in, and I'm not sure if it makes sense to do that in this release. if you are curious, you can follow the convo in the linked PR above

@raman325
Copy link
Contributor

Also @Tediore you may want to reopen this issue for visibility until either the bug fix version gets released or 105.0 gets released

@Tediore
Copy link
Author

Tediore commented Jan 18, 2020

No prob! Appreciate the heads-up. Thanks for your work with this component by the way, it powers one of my favorite automations (the one I mentioned earlier).

@MartinHjelmare would you mind reopening this issue per @raman325 's recommendation?

@trentjw
Copy link

trentjw commented Jan 18, 2020

I am also having issues 104.X will not see Vizio TV if they are off during a server reboot and are unavailable, they are seen and seem to function as intended if they are on during server reboot

@raman325
Copy link
Contributor

@trentjw sorry about that! This is a known bug that will get resolved in 0.105. There were significant changes done to the integration for 105 that made it difficult to hotfix this for 104.

@trentjw
Copy link

trentjw commented Jan 21, 2020

understood looks like I flat out need to skip 104 as it has issues with zwave and wireless devices as well LOL pretty much broke everything except my Kodi's

@broyuken
Copy link

If I didn’t need 104 to fix ring I probably would have as well. This was not the cleanest release.

@ThePirat91
Copy link

ThePirat91 commented Jan 26, 2020

@trentjw sorry about that! This is a known bug that will get resolved in 0.105. There were significant changes done to the integration for 105 that made it difficult to hotfix this for 104.

Hello, what's the eta for 0.105? We are experiencing so many cons with 0.104 (deconz, wifi and zwave unavailability, etc...). Thanks

@Tediore
Copy link
Author

Tediore commented Jan 26, 2020

Major releases are typically every three weeks. You can always roll back to a previous version if you're experiencing issues with 0.104.

@ThePirat91
Copy link

Major releases are typically every three weeks. You can always roll back to a previous version if you're experiencing issues with 0.104.

Just tried but have so many problems (and had in the past) with restore from hassio snapshot (I'm on hassio via docker on a rpi3)...

@broyuken
Copy link

broyuken commented Feb 2, 2020

Any update on getting this into 0.105? Looking at the notes for 0.105 I don't see vizio mentioned anywhere.

@raman325
Copy link
Contributor

raman325 commented Feb 2, 2020

@broyuken not sure what notes you are looking at but yes, the fix should be included. There are some breaking changes that you will need to make though since this release also brings config flow support.

@ThePirat91
Copy link

Any ETA for 0.105?
Thanks

@raman325
Copy link
Contributor

raman325 commented Feb 2, 2020

Major releases are typically every three weeks. You can always roll back to a previous version if you're experiencing issues with 0.104.

So that puts it at next week.

@raman325
Copy link
Contributor

I believe this issue can now be closed

@Tediore
Copy link
Author

Tediore commented Feb 17, 2020

Ah yep! Sorry, forgot to close it. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants