Skip to content

Commit e0c2794

Browse files
authored
finished describing the setup
1 parent 2b92b74 commit e0c2794

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

source/_components/device_tracker.google_plus.markdown

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,47 @@ sidebar: true
77
comments: false
88
sharing: true
99
footer: true
10-
logo: locative.png
1110
ha_category: Presence Detection
1211
---
13-
If you share your Android's location with Google, this component fetches those locations from Google's servers to your Home Assistant. This component does NOT directly communicate with your phone, thus using this component does not cause any additional battery drain.
12+
If you share your Android's location with Google, this component fetches those locations from Google's servers to your Home Assistant. This component does NOT directly communicate with your phone, thus using this component does not cause any additional battery drain.
13+
Suppose your Android phone is linked to your Google Account, say main@gmail.com.
1414
This component can be used in 2 modes:
15-
-
15+
- Self Mode: It visits "aboutme.google.com" while appearing (to Google) to be logged in as main@gmail.com. Using this mode needs to put your Google cookies into the home assistant config file. If anyone gets access to these cookies, they may be able to do anything with your google accout, e.g. delete the account.
16+
- Safe Mode: In this safer mode, the component visits the Google Plus profile page of main@gmail.com, while appearing (to Google) to be logged in as a dummy Google account, say dummy@gmail.com. In this case, (only) the cookies of dummy@gmail.com are needed. Just for the initial setup, you need to install the Google Plus Android App on Android, and log into the app as main@gmail.com, and in its location settings, share the location with dummy@gmail.com. After that, you can uninstall the Google Plus app on Android.
17+
1618

1719
```yaml
1820
# Example configuration.yaml entry
19-
device_tracker:
20-
- platform: locative
21+
device_tracker 3:
22+
platform: gplus
23+
id: 'phone'
24+
url: '...'
25+
cookie_sid: '...'
26+
cookie_hsid: '...'
27+
cookie_ssid: '...'
28+
data_freq: '...'
29+
data_at: '...'
2130
```
31+
In Self Mode, additionally add `header_host: 'aboutme.google.com'`.
32+
33+
###How to obtain the values shown as '...' (credits to @icovada):
34+
35+
36+
- If using this component in Self Mode, open Firefox and log into Google as main@google.com
37+
and visit aboutme.google.com.
38+
If instead, you wish to use this component in Safe Mode, log into dummy@google.com,
39+
and visit the Google Plus profile page of main@google.com.
40+
- Open the Instruments pane (Ctrl + Shift + C)
41+
- Click the network tab
42+
- If in Self Mode, click the three bar menu on the top left. If in Safe Mode, skip this step.
43+
- If in Self Mode, click Preview. If in Safe Mode, click on the profile name of main@google.com.
44+
In either mode, a popup will appear. This popup will contain many cards,
45+
one of which is the location card.
46+
- In the network tab of the instrumentation pane, look for a JSON request that
47+
looks like data?ds.extension
48+
- Right click on it, select "Copy with cURL".
49+
- Paste the result on http://curl.trillworks.com/#python to get your command formatted
50+
for python requests. If you don't trust that website, note that they provide sources of the tool. So run the tool on your local machine.
51+
- The python code contains dictionaries with keys that have names similar to the above
52+
fields in the config file. Copy the corresponding values to the config file.
53+
- The url field is the first argument of `requests.post` in the last line of the python code.

0 commit comments

Comments
 (0)