Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Unable to add hostname through Add Integration UI #221

Closed
klDen opened this issue Dec 23, 2021 · 15 comments
Closed

Unable to add hostname through Add Integration UI #221

klDen opened this issue Dec 23, 2021 · 15 comments
Assignees

Comments

@klDen
Copy link
Contributor

klDen commented Dec 23, 2021

Hi!

First thanks a lot for this project!

After upgrading to wiz_light 0.4.5 and trying to add a light using the hostname wiz_3eb6ff, I get the following error message:
image

I can confirm Home Assistant OS is able to reach the device:
image

@rforbessr
Copy link

This may or may not be the same - After installing the latest version I am unable to setup a light using the IP address or host name. I get the same error KLDEN gets - I have included what I see in the logs - It is the same when trying either method:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/wiz_light/config_flow.py", line 47, in async_step_user
await self.async_set_unique_id(mac)
UnboundLocalError: local variable 'mac' referenced before assignment

@sbidy
Copy link
Owner

sbidy commented Dec 24, 2021

Should be fixed with the 0.4.5b release. This was an issue with the exception handling.

@sbidy sbidy self-assigned this Dec 24, 2021
@klDen
Copy link
Contributor Author

klDen commented Dec 24, 2021

Should be fixed with the 0.4.5b release. This was an issue with the exception handling.

Great! Thanks for the update!

@rforbessr
Copy link

Thank you - !!

@rforbessr
Copy link

Just downloaded the latest - I still have issues - unfortunately I cannot find anything in the logs this time - When using the hostname I get - "The bulb cannot be connected via the WIZ Light integration"

image

and when using an IP I get "Cannot connect to bulb. Maybe the bulb is offline or a wrong ip/host was entered. Please turn on the light and try again."

image

The host and ip are correct - Both are listed in Unifi and in the WIZ app - I can ping both hostname and ip from HA console.

I have model ID 7002 and Firmware 1.24.0

Thanks

@FroodyHoop
Copy link

FroodyHoop commented Dec 27, 2021

I'm also having the exact same issue with 0.4.5b. Updating from 0.4.0. I'm getting identical errors as rforbessr reports when using the hostname or IP. I can both ping from the HA console and control the light from the WIZ app.

Correction: after trying a few more times the bulb did get added OK. Everything seems to be working well!

@FCCMac
Copy link

FCCMac commented Jan 10, 2022

I'm still seeing the same issue on 0.4.5b. Ping from HA to the hostname is working just fine but I'm seeing the same message: "The bulb can not be connected via WiZ Light integration. Does anyone have any thoughts?

@andrei-lazarov
Copy link

Same issue on my end. Adding with IP works, but not with hostname.
Pinging works: ping wiz_123456 or ping wiz_123456.local on some devices.
Would love to help but not sure how.

@m4ttr
Copy link

m4ttr commented Jan 19, 2022

I had the same issue described here. I tried to dump the traffic from my HA server using tcpdump. I was able to see the traffic leave if I used the IP of the wiz light. I see no UDP traffic 53 or 38899 if I use the hostname

I am able to ping the hostname from the HA console ping wiz_12344works. `host wiz_12344' also works.

When I check the DNS logs:
Screen Shot 2022-01-18 at 8 11 04 PM

appears that we are getting the search domain added and that might be causing dns to not work.

Instead if I a "." To the end of the name, it works!

wiz_12345. Works!

@Code-Jelle
Copy link

Update. Issue still present.
wiz12345. doesn't work for me.

@pedrohessy
Copy link

also having this issue on 0.4.5b

@lotablet
Copy link

lotablet commented Jan 22, 2022

same issue here. cannot add anything.

EDIT. i fixed with "Enable local comunication" in wiz app (i don't know why it was disabled 🤣)
i added all my bulbs with ip address and all is working fine now

@petebowden
Copy link

The fix suggested by @m4ttr worked for me.

@sbidy
Copy link
Owner

sbidy commented Jan 29, 2022

It can be possible that the DNS lookup fails from the HASS into your network.
In general, this is not directly an issue from the integration itself. It is also possible that a IPv6/4 issue occurs at the DNS lookup.

If you can't add the bulb via DNS names, please make a fallback to the IP of the bulb.

@petebowden
Copy link

Just to clarify, I was able to resolve the hostnames via the shell on my HASS. It would not resolve in the ui without the additional . (dot) added to the hostname.

e.g. wiz_aabbcc did not work, but wiz_aabbcc. did properly resolve.

@sbidy sbidy closed this as completed Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests