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

Add support for Google Home device tracking #18190

Merged
merged 5 commits into from Nov 6, 2018

Conversation

Projects
None yet
7 participants
@ludeeus
Member

ludeeus commented Nov 4, 2018

Description:

This adds the option to use the bluetooth capabilities of Google Home devices as a device tracker.

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7357

Example entry for configuration.yaml (if applicable):

device_tracker:
  platform: googlehome
  host: 192.168.1.113

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

ludeeus added some commits Nov 5, 2018

@MartinHjelmare MartinHjelmare changed the title from Add support for Google Home device tracking. to Add support for Google Home device tracking Nov 5, 2018

ludeeus added some commits Nov 5, 2018

Change stylling of name, and attr mac_address to btle_mac_address, re…
…moved unesssesarry attributes copying.
@MartinHjelmare

Looks good!

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 5, 2018

@MartinHjelmare Would you have a look at the comment I left here for another approach for this platform #18190 (comment)? :)

@MartinHjelmare

Conversation was resolved. Merging.

@MartinHjelmare MartinHjelmare merged commit 2c36b9d into home-assistant:dev Nov 6, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 93.091%
Details

@wafflebot wafflebot bot removed the in progress label Nov 6, 2018

@ludeeus ludeeus deleted the ludeeus:googlehome branch Nov 6, 2018

@dynasticorpheus

This comment has been minimized.

dynasticorpheus commented Nov 8, 2018

@ludeeus Excellent stuff but I was wondering how this works considering random MAC addresses being used for BLE? Perhaps simply a matter of (explicit) pairing with the google home device but if so this requirement should be in the documentation.

https://blog.bluetooth.com/bluetooth-technology-protecting-your-privacy

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 8, 2018

@dynasticorpheus This queries the Google home unit for mac addresses it sees and creates an entity for it.

@dynasticorpheus

This comment has been minimized.

dynasticorpheus commented Nov 8, 2018

@ludeeus I understand the concept but modern devices periodically randomize their BLE mac address to avoid being tracked (privacy) hence my question. From what I understand only when you paired once this random address can be converted back into the "hard-coded" version thus considered as the same device despite this randomization. Anyway will do some testing and revert back.

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 8, 2018

In that case, it will be a problem with all BT trackers?

zxdavb added a commit to zxdavb/home-assistant that referenced this pull request Nov 13, 2018

Add support for Google Home device tracking (home-assistant#18190)
* Add support for Google Home device tracking.

* Use dict[key] for options.

* Delete googlehome.py.save

* Change stylling of name, and attr mac_address to btle_mac_address, removed unesssesarry attributes copying.
@Mdleal

This comment has been minimized.

Mdleal commented Nov 14, 2018

I am getting the following error while testing.

ERROR (MainThread) [ghlocalapi.bluetooth] Error connecting to GHLocalApi,

@dshokouhi

This comment has been minimized.

Contributor

dshokouhi commented Nov 14, 2018

Just tested this PR in my dev instance and it works with my new google home hub :)

@MartinHjelmare

This comment has been minimized.

Member

MartinHjelmare commented Nov 15, 2018

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Nov 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.