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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dhcp discovery to smartthings #50306
Conversation
Hey there @andrewsayre, mind taking a look at this pull request as its been labeled with an integration ( |
SmartThings is a cloud integration and can't be setup solely based on discovery of a hub on the network--further a hub isn't even required for this integration to work. Config entries are tied to a SmartThings location (which is a cloud resource not related to a local hub). I'm concerned that the user experience will be poor because a unique ID can't be tied to discovery and therefore won't this keep prompting the user to setup the integration every restart? |
Hi Andrew, Discovery implements handling this case with _async_handle_discovery_without_unique_id https://github.com/home-assistant/core/blob/dev/homeassistant/config_entries.py#L1214 If the user already has a smartthings config entry, they won't see another one pop up (https://github.com/home-assistant/core/blob/dev/homeassistant/config_entries.py#L1227) If they ignore it, it won't come back again either (https://github.com/home-assistant/core/blob/dev/homeassistant/config_entries.py#L1232) This is a relatively common pattern for cloud devices https://github.com/home-assistant/core/blob/dev/homeassistant/components/blink/manifest.json |
I don't think this captures all possible MAC addresses for SmartThings hubs. I have a hubv2 with a totally different MAC prefix: d0:52:a8:. |
Thanks. These lists tend to grow over time as we discover more combinations. Which hostname does your hub request via dhcp? If you don't know, turn on debug logging for homeassistant.components.dhcp and restart the hub while watching the log. |
DHCP hostname shows up as: hubv2-d052a826652b0001. The first half of the hub's MAC is included in the hostname (d052a8) but the rest of the hostname does not match the rest of the MAC, so I'm not sure what the rest of the hostname is generated from. |
That OUI is registered to Physical Graph Corp which seems to be owned by Smart Things https://blog.smartthings.com/iot101/introducing-the-physical-graph/ |
Thanks @iridris. I went ahead and added that OUI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and follows the recent strategy we are taking on this.
Thanks, @bdraco 馃憤
Proposed change
Add dhcp discovery to smartthings
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: