Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate Devices In Multiple Homes Present In One Nest Account #60

Open
ErikSGross opened this issue Mar 16, 2022 · 1 comment
Open
Labels
enhancement New feature or request p1

Comments

@ErikSGross
Copy link

Description

In the v0.3.3 and earlier, all detected devices apear to be imported into Home Assistant, independent of which Nest home they're installed in. Importing all Nest devices into a single instance of HA is inconsistent with a single instance of HA being used to interact with a single home.

For example, I'm an authorized/added user to my parents' home so I can manage their Google WiFi and help troubleshoot Nest/Google things when necessary. In my Nest app, I can select between my home and my parents' home before loading the pages where I can monitor or control devices.

When I load the ha-nest-protect integration, I get devices for all the Nest Protect devices in BOTH homes. Since we have several home locations in common, I get multiple entries for things like "Nest Protect (Family Room)", and no obvious way to know which one is in which home.

In the diagnostics info for this integration, I have multiple structure entries like this:

"object_key": "structure.xxxxxx-xxxxxxxx-xxxxxx",

Each home has a unique structure object_key. The swarm data value for each structure contains a list of the devices that are present in that home, and only those devices. From that data, you can quickly get a list of devices in each home. For example:

            "swarm": [
              "topaz.xxxxxx",
              "quartz.aaaaaaaa",
              "topaz.yyyyyyy",
              "topaz.zzzzzzz"
            ],

Each device has a structure_id key, which corresponds to the structure object key mentioned above. This allows determining in which home a given device is installed.

One suggestion would be to have the config flow determine which structures are present in the Nest data and ask the user which structure (Home) they want to import. The user-supplied names for the structures (Homes) are provided in the Nest data to make it easier for the user to differentiate the structures. Then, when the integration is creating devices for HA, it could filter to only those devices present in that Home.

Device (optional)

All Nest Devices

Additional information

No response

@ErikSGross ErikSGross added the enhancement New feature or request label Mar 16, 2022
@iMicknl
Copy link
Owner

iMicknl commented Mar 16, 2022

Thanks for reporting, @ErikSGross! Good suggestion, I have seen the structure information and we should be able to integrate this with a Config Flow and Options Flow.

However, this will require some work since it would be good to see if we can only pull and subscribe to the buckets of the selected structures.

@iMicknl iMicknl added the p1 label Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p1
Projects
None yet
Development

No branches or pull requests

2 participants