home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.6k stars 30.76k forks source link

Govee light local doesn't use all available network interfaces in discovery #124339

Open mill1000 opened 2 months ago

mill1000 commented 2 months ago

The problem

Govee light local only uses a single interface for discovery. In installations with multiple network interfaces, the integration will not attempt to discover any devices on the additional interfaces.

The code here gets the first adapter IP that is capable reaching a public IP. https://github.com/home-assistant/core/blob/1d1a6ee52fb1937c6e38f197171f975b7a78b783/homeassistant/components/govee_light_local/config_flow.py#L29-L41

Instead the integration should use the methods in the Network integration like async_get_adapters or async_get_ipv4_broadcast_addresses to get source IPs for all available and enabled network interfaces.

This may explain some of the problems in #115611 and help mitigate the need for #109993

What version of Home Assistant Core has the issue?

core-2024.8.2

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

govee_light_local

Link to integration documentation on our website

https://www.home-assistant.io/integrations/govee_light_local

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @galorhallen, mind taking a look at this issue as it has been labeled with an integration (govee_light_local) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `govee_light_local` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign govee_light_local` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


govee_light_local documentation govee_light_local source (message by IssueLinks)

mill1000 commented 2 months ago

Poking around with a fix here: https://github.com/mill1000/core/tree/issue/govee_discovery

Discovering on multiple adapters is working, but the data coordinator isn't picking up the device when initializing. It might have to be explicitly bound to each interface instead of listening on 0.0.0.0.

godbouy commented 2 months ago

I just installed a Govee H6008 light bulb and the integration cannot find it on the network. It works fine with the app, but not HA. Can I add this type of bulb manually?

mill1000 commented 2 months ago

I think you're looking for https://github.com/home-assistant/core/issues/109993

groygirard commented 1 month ago

I believe I am facing the same issue. Multiple LAN interfaces (wired + wifi) bound to the hass container. Govee device on the wifi but is not discovered.

itewk commented 1 month ago

i just ran into this same thing.... @mill1000 did you ever get your code working?

godbouy commented 1 month ago

I never got it to work yet- quite disappointing.

Yves Godbout 341, rue Gérard-Binette Gatineau, QC, J9J 3W2 Tel: 819-778-2931 Cell: 873-688-2931 @.***

Le jeu. 10 oct. 2024 12 h 38, Ian Tewksbury @.***> a écrit :

i just ran into this same thing.... @mill1000 https://github.com/mill1000 did you ever get your code working?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124339#issuecomment-2405580083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6UDVWY445FLPJWCDW7WEDZ22UPXAVCNFSM6AAAAABM266E5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBVGU4DAMBYGM . You are receiving this because you commented.Message ID: @.***>

mill1000 commented 1 month ago

i just ran into this same thing.... @mill1000 did you ever get your code working?

No I haven't put any additional work into it, other projects are taking priority for now.

itewk commented 1 month ago

@mill1000 i built on your pull request and its working for me now discovering devices on my secondary nic (though technically now it will detect them on any connected nic)

mill1000 commented 1 month ago

Cool! Nice work.