I have had my Vizio TV configured and working well for over a year, and just recently I think it was after I updated to 0.106. I realized that the vizio media player entity was missing. I am not sure when exactly but it was about the time that there was a change in the config.yaml where you use the vizio component instead of the media_player.
configuration.yamlvizio:
- host: !secret tv_address
access_token: !secret tv_token
secrets.yaml
tv_address: 192.168.x.xxx:7345
tv_token: "Z8qxn6o5de"
2020-03-29 02:21:56 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/vizio/config_flow.py", line 302, in async_step_zeroconf
if _host_is_same(entry.data[CONF_HOST], discovery_info[CONF_HOST]):
KeyError: 'host'
I have noticed that Google Cast was still configured so I deleted it and commented out the vizio section in my config, restart and then uncomment and restart again but only the Google Cast came up for configuration.
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!
@whadat1 I can't see why this would be happening. Can you try this?
See if you run into any errors? BTW the code path that's returning an error is for device discovery, so you should still have a working vizio device in your HA instance even though you are getting that error, but it would be great to know if performing the steps I mentioned fixes it.
I have no vizio entry under integration, the only thing there is Google Cast which I deleted but now its asking me to configure it. The problem is that I just can't get vizio entity to show up, hence it not being in the integration panel.
Steve McDonald.
On Tuesday, March 31, 2020, 10:00:13 AM EDT, Raman Gupta <[email protected]> wrote:
@whadat1 I can't see why this would be happening. Can you try this?
See if you run into any errors? BTW the code path that's returning an error is for device discovery, so you should still have a working vizio device in your HA instance even though you are getting that error, but it would be great to know if performing the steps I mentioned fixes it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Do you have SSH access to the machine? If so, would you mind running the following script and pasting the results here? You'd have to create a file (e.g. test.py), paste this in, and then run python test.py to get the file to run. What it's doing is it's running a discovery script to see what vizio devices are being found on your network. That's where this error is occurring in the error trace so I'm wondering if something unexpected is getting returned.
from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" % (name, info))
zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_viziocast._tcp.local.", listener)
try:
input("Press enter to exit...\n\n")
finally:
zeroconf.close()
You may get a message that says import module zeroconf failed or something to that effect. If that's the case, you would have to run pip install zeroconf first before running this script
Sorry I am at work and get off at 10 pm. I will do it tonight.
Steve McDonald
On Mar 31, 2020, at 12:21 PM, Raman Gupta notifications@github.com wrote:

Do you have SSH access to the machine? If so, would you mind running the following script and pasting the results here? You'd have to create a file (e.g. test.py), paste this in, and then run python test.py to get the file to run. What it's doing is it's running a discovery script to see what vizio devices are being returned on your network. That's where this error is occurring so I'm wondering if something unexpected is getting returned.from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name): print("Service %s removed" % (name,)) def add_service(self, zeroconf, type, name): info = zeroconf.get_service_info(type, name) print("Service %s added, service info: %s" % (name, info))zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_viziocast._tcp.local.", listener)
try:
input("Press enter to exit...\n\n")
finally:
zeroconf.close()
You may get a message that says import module zeroconf failed or something to that effect. If that's the case, you would have to run pip install zeroconf first before running this script—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Hi, I have the SSH & Web terminal which I use to check and restart home-assistant. Is this the one I need to run the script or is it the Terminal &SSH?
I don't use HASS.IO so I'm not familiar with web terminal, but you just need a way to access the command line. I'm assuming web terminal gives you that access through the browser, so I think either will work?
I just found the add-on documentation, that should be sufficient

I am not sure if this works but I ssh through my imac terminal and paste the screen shot here.
Thanks, I can see the image. Was that the only one that appeared?
Assuming it was, I suspect your config entry data was somehow corrupted during one of the upgrades. If you are open to "resetting" you could try deleting the .storage folder in your homeassistant config folder and restarting HA to see if it works. I did put up a bug fix that would address this issue but I am not sure if it will be accepted given that it shouldn't be possible to have a config entry without a host key (which is what is causing this error), so either there is another part of the code that is the root source of this issue (which I can't find), or some sort of data corruption occurred.
One question: in deleting the .storage folder, will I be loosing anything or do I have to do any major work after to get the system back up?
If all of your integrations are setup via configuration.yaml then I believe everything will get set up again. If you've configured anything through the front end, you would lose those, which is why this is not always the best option.
Ok I will try later when I get home. If there are any issues I can revert to my backup files.
Thanks.
sure and I hope this fixes it, otherwise sorry for the trouble!
I deleted the .storage folder and restarted and it never startup. It's stuck on 'reconnecting' but doesn't connect. The only way now that I can connect is through the remote ui and also I am not able to scroll up or down on the home page. Only the top half of the screen is visible and I am not able to scroll to the bottom. I tried to go back to my latest backup but it is still the same.
...crap. This has always worked for me, but I don't use HASS.io so perhaps this strategy doesn't work for that method of installation. Can you try upgrading to 0.107 and see if that helps? I'm surprised you are having this problem given that safe mode was introduced in 0.105.
Also when you restored your backup, did you verify that it restored your .storage folder?
Yes it did restore the .storage folder.
If your backup was from before the upgrade then you may need to downgrade back to the version you were on when the backup was taken. You may want to re-restore your backup after you do the downgrade, then re-upgrade
Help me a bit... how do I do it.
a quick google search gave me this: https://community.home-assistant.io/t/how-to-install-hassio-specific-version-includes-downgrade/54954/15?u=raman325
Oh man I think it has crashed...no matter what I do, it's just not connecting...all I am getting is 'connection lost.reconnecting..' and the green light on my rasp pi keeps flashing.
I sure wish I had just forgot about the vizio tv and keep what I had. I might have to now start all over from scratch.
Sorry @whadat1 I really didn't think this action would have created these problems for you 😞 I hope once you get a chance to resolve the issue with HA generally that you are able to resolve the vizio TV issue. It doesn't look like my bug fix is going to be accepted since, as I said, this error shouldn't be possible.
I have got back most of my entities, nearly as it was before but I am left now with homeassistant not restarting when using the terminal. 'ha core restart'. It is stuck on 'Connection lost..Reconnecting...'
I can only load it by the Remote UI Portal. Do you know how I can get this fixed?
can you try adding the following to your configuration.yaml and then paste what the logs say? Note that because I don't use HASS.IO you may get faster help by posting a separate issue about this particular issue, but I am willing to try to help since it was my suggestion that got you here.
logger:
default: debug
Oh my god, the debug result is never ending. I can scroll forever before I get to the end. It's too much to send.
I guess that makes sense since it's setting everything to debug. Try this instead which limits what's logging at debug level:
logger:
default: info
logs:
http: debug
frontend: debug
homeassistant: debug
If that still spits out too many logs you can try without homeassistant and that should be cleaner. Note that it's still going to be a long log because debug captures a lot
Still have too much..what is it that I should be looking for, I didn't see anything out of the ordinary that stated there are errors.
I am not sure, I just figured that it would point to some issue that's preventing the UI from loading. Assuming you can load the logs into a file, you could upload it using a tool like https://wetransfer.com/ and then provide a link here
This is what I got without the logger:
2020-04-03 21:57:54 WARNING (SyncWorker_16) [sleekxmppfs.basexmpp] fulljid property deprecated. Use boundjid.resource
2020-04-03 21:57:57 WARNING (MainThread) [homeassistant.components.homekit_controller] Legacy homekit_controller state found in /config/.homekit. Support for reading the folder is deprecated and will be removed in 0.109.0.
2020-04-03 21:58:01 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2020-04-03 21:58:01 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2020-04-03 21:58:01 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds.
2020-04-03 21:58:01 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: calendar.contacts
2020-04-03 21:58:01 WARNING (MainThread) [homeassistant.setup] Setup of input_number is taking over 10 seconds.
2020-04-03 21:58:03 WARNING (MainThread) [homeassistant.components.remote] Setup of remote platform harmony is taking over 10 seconds.
2020-04-03 21:58:06 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform seventeentrack is taking over 10 seconds.
2020-04-03 21:58:10 ERROR (MainThread) [homeassistant.components.template.sensor] Could not render template deebot: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
2020-04-03 21:58:11 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number:
2020-04-03 21:58:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of cover.10481015a4cf12ac4d25 is taking over 10 seconds
2020-04-03 21:58:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.onkyo_receiver_zone_3 is taking over 10 seconds
2020-04-03 21:58:48 WARNING (MainThread) [homeassistant.components.cover] Updating tuya cover took longer than the scheduled update interval 0:00:15
2020-04-03 21:58:48 WARNING (MainThread) [homeassistant.components.media_player] Updating onkyo media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:58:48 WARNING (MainThread) [homeassistant.components.media_player] Updating vizio media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:58:49 WARNING (MainThread) [homeassistant.components.media_player] Updating vizio media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:58:49 ERROR (MainThread) [homeassistant.components.hue.light] Timeout fetching light data
2020-04-03 21:58:50 ERROR (MainThread) [homeassistant.components.hue.light] Timeout fetching group data
2020-04-03 21:58:54 ERROR (MainThread) [homeassistant.components.hue.sensor_base] Timeout fetching sensor data
2020-04-03 21:58:58 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.vizio_tv is taking over 10 seconds
2020-04-03 21:58:58 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.bedroom_tv is taking over 10 seconds
2020-04-03 21:58:59 WARNING (MainThread) [homeassistant.components.vizio.media_player] Lost connection to 192.168.1.224:7345
2020-04-03 21:58:59 WARNING (MainThread) [homeassistant.components.vizio.media_player] Lost connection to 192.168.1.229:7345
2020-04-03 21:59:02 WARNING (MainThread) [homeassistant.components.light] Updating lifx light took longer than the scheduled update interval 0:00:10
2020-04-03 21:59:02 WARNING (SyncWorker_16) [homeassistant.components.homekit.type_media_players] media_player.vizio_tv: Sources out of sync. Restart Home Assistant
2020-04-03 21:59:03 WARNING (MainThread) [homeassistant.components.media_player] Updating onkyo media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:59:03 WARNING (MainThread) [homeassistant.components.media_player] Updating vizio media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:59:03 WARNING (MainThread) [homeassistant.components.media_player] Updating vizio media_player took longer than the scheduled update interval 0:00:10
2020-04-03 21:59:23 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for binary_sensor.remote_ui (
2020-04-03 21:59:24 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.vizio_tv is taking over 10 seconds
2020-04-03 21:59:25 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.1851321904] Disconnected: Did not receive auth message within 10 seconds
2020-04-03 21:59:25 WARNING (MainThread) [homeassistant.components.media_player] Updating vizio media_player took longer than the scheduled update interval 0:00:10
I am really unsure how to resolve this. It may be easiest to rebuild from scratch unfortunately. If all of your entities are configured via configuration.yaml this shouldn’t be too painful. You’d basically have to wipe the entire config folder, restart HA so it can rebuild the default state of the folder, shut it down and readd your configuration.yaml, custom components, etc. and then start it up again. Once again I’m sorry my suggested action got you in this state. I’ve done what I suggested to you many times on my installation and never had an issue, but maybe my docker install works differently than how HASS.IO does
I just went through the trouble of setting back up yesterday it was very hard because most of my entities are configured through the frontend. I opened a ticket on Discord and also on the Homeassistant Forum, so I will wait and hear what they have to say.
Ah ok. Hope someone is able to help!
Hey !! just want to let you know I got it solved.. The problem was I was not using my local_ip:8123 to connect. I was using the nabu casa remote UI address. I am good to go now and thanks for your effort with me.
Oh great! Glad you were able to get it resolved! Did the Vizio device issue happen to get resolved as well or are you still having the same problem?
Yes that was solved when I had removed the .storage and re-install all my entities.
Hi @raman325 - my apologies for commenting on a closed case. I am doing so since the error message I am getting is identical to the error in the OP. However, I am NOT trying to set up a Vizio integration, although I do have a Vizio SmartCast TV on the network. This error is apparently coming from the zeroconf discovery process and finding a glitch in Vizio config_flow.py. All I am hoping you can tell me is if this is a known issue in the Vizio code that will be fixed and/or what I can do to eliminate it. This first started in 107.x I believe, and is still present in 108.3. Let me know if I need to open a new case. Thanks.
2020-04-13 10:07:59 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/vizio/config_flow.py", line 337, in async_step_zeroconf
if _host_is_same(entry.data[CONF_HOST], discovery_info[CONF_HOST]):
KeyError: 'host'
@GaryOkie no worries. I really don't know how this issue could occur, especially if you haven't set up the Vizio integration to begin with. The only fix I can think of is to either start from scratch or to manually edit files in .storage while your instance is shutdown. You would have to manually remove entries in core.config_entries that have the domain of vizio, entries in core.entity_registry that have the platform of vizio, and entries in core.device_registry that have a manufacturer of VIZIO. If you choose to take this latter approach I would be very careful and backup that folder because if you don't remove the entries correctly HA will likely not start up properly.
Thanks very much for the advice. I will backup, and give editing .storage vizio entries a try, and get back to you.
I'm having the same symptom for a few weeks now, i'm going to back up my .storage and restart containers to see if this gets me anywhere.
I pumped the brakes a bit, and just removed the old, stray vizio entries in core.entity_registry - for some reason after restarting home assistant, it also removed my smartthings integration - but otherwise this resolved the problem.
In my case, I don't have any Vizio SmartCast entries in core.entity_registry or core.device_registry. This is because when I was first notified HA had discovered Vizio SmartCast and asked if I wanted to configure it or ignore it. I chose the latter, and this was stored in the following:
.storage/core.config_entries
{
"connection_class": "local_poll",
"data": {},
"domain": "vizio",
"entry_id": "5556715bfd1ee2c4302b441cb772",
"options": {},
"source": "ignore",
"system_options": {
"disable_new_entities": false
},
"title": "Ignored",
"unique_id": "192.168.9.99",
"version": 1
},
So I removed this section, restarted HA, and as expected, there were no longer any error messages, and HA found Vizio SmartCast on the LAN and asked the same question. I chose IGNORE again, and restarted HA.
Yep, it's repeatable - the _"KeyError: 'host'"_ in _components/vizio/config_flow.py", line 337_ error returned. So what this implies to me is that this code is unable to handle the situation when the Vizio SmartCast was listed as "ignored". (This error does not occur for several other integrations that I have ignored). So there really isn't anything I can do to fix this as long as I continue to choose to ignore configuring it.
I found that there was no need to manually edit core.config_entries to remove the Vizio/ignore section. The HA UI has the option to list each ignored Integration and "Stop ignoring" them via deletion from the list. So after choosing to stop ignoring, restarted HA, and this time, chose to configure Vizio Smartcast. Had to pair it with a PIN (a Homekit requirement?). This naturally solved the issue above.
I should also point out that I now have two integrations for this Vizio... the original is from Google Cast, and now the new Vizio Smartcast integration. I had missed that earlier since it lists "unknown manufacturer" instead of "Vizio", but I don't know if this separate integration for the same TV had anything to do with this issue. I would think not.
Ah it looks like when you ignore a setup it creates a different key. I will talk to the core team about the best way to address this and push a fix
@GaryOkie the fix for this will get released with 0.108.6. Once it’s released and you have a chance, can you update and make sure the error is gone?
EDIT: BIG SLAP to my Head! My update was to 108.5, not 108.6 which doesn't appear for me yet! As soon as 108.6 appears, I will update and retest. Ignore all the prattle below!
@raman325 A little bit awkward for me to test this as I had recently gone ahead and configured the Vizio Smartcast integration and all was well, naturally. But since I raised the issue, I am willing to help. I needed to remove the integration, restart, and ignore it again. Then installed 108.5, restarted, and oh heck - it's not fixed. The error in the log is exactly the same as before, including the same line numbers.
Double-checked, confirmed running 108.5. vizio is listed in core.config_entries as an ignored integration.
Sorry that you had to go through all that effort for nothing 😞I'm 99.9% sure this fix will work and I added a test for it that passed so if you want to integrate your device and not worry about retesting, that is ok! But if you do decide to test, let me know how it turns out!
And I missed your questions from a previous comment, so to answer:
cast and vizio integrations are different which is why you have two separate entries. They provide some overlapping capabilities using different communication protocols but they also have unique features. The cast integration lets you send a video to your device for streaming, like a Youtube video, or a stream if you have one integrated with HA from something like a camera. The vizio integration let's you change inputs, change volume, etc. I also have two entities for my single vizio device, one for the cast integration and one for the vizio oneThe Vizio is still listed as ignored, so when 108.6 shows up, I will update and confirm for you that the error is cleared. No problem at all. After all this is tested, I found your explanation very informative, so I will un-ignore and configure the vizio to get the additional capabilities. Thanks very much for clarity! I originally thought, well, I already have the Vizio configured, why do I need two different integrations for it?
Finally see 108.6 available... just updated, and see no more errors from Vizio config_flow resulting from this integration being previously ignored.
Nice work getting a fix out so fast! It wasn't really causing any problem other than the error messages, but it's sure nice to have that cleaned up. Thank you!
Woohoo! Glad to hear. It was a low priority bug in the grand scheme of things, but I do not like bugs 😉. Thanks for retesting!