core: Failing to set up Wemo on Home Assistant

The problem

When Wemo integration is discovered, after clicking configure, set up fails:

Logger: homeassistant.config_entries Source: components/wemo/init.py:103 First occurred: 11:44:40 AM (1 occurrences) Last logged: 11:44:40 AM

Error setting up entry Wemo for wemo Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 339, in async_setup result = await component.async_setup_entry(hass, self) File “/usr/src/homeassistant/homeassistant/components/wemo/init.py”, line 103, in async_setup_entry config = hass.data[DOMAIN].pop(“config”) KeyError: ‘config’

image

What version of Home Assistant Core has the issue?

2022.6.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Wemo

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-06-26 11:39:49 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Wemo for wemo
File "/usr/src/homeassistant/homeassistant/components/wemo/__init__.py", line 103, in async_setup_entry
2022-06-26 11:44:40 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Wemo for wemo
File "/usr/src/homeassistant/homeassistant/components/wemo/__init__.py", line 103, in async_setup_entry

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@juzkuz That makes sense! The WeMo discovery logic is intended to only work when the devices are on the same network. For separate networks each device needs to be configured statically in configuration.yaml

There are some more details here: https://github.com/pywemo/pywemo/wiki/Networking

Exactly - I found that it still attempted to work since the subnet could still be discovered the way I had it configured, but it wasn’t 100% reliable - it would only find a few devices only some times. Even using manual ips wasn’t working however - only getting back on the exact subnet worked reliably… and it’s worth noting that it didn’t resolve even then until I updated to the latest… so something was out of wack until I updated. I checked the configuration and it seemed correct at the time, but either way the update resolved it.

One thing to note - I believe I encountered the issue only when my Wemo devices were on a separate subnet from Home Assistant. I had setup the subnets so that they could communicate in one direction and not the other, but the detection seemed to be impacted by this and was only resolved by putting the Wemo devices back on the same subnet.

For me, updating everything to the latest version resolved it