Google Keep Sync is an unofficial custom integration for Home Assistant that allows users to synchronize their Google Keep lists with Home Assistant. This project is in no way affiliated with, created, or endorsed by Google.
Bidirectional synchronization of lists between Google Keep and Home Assistant. You select the lists you wish to sync, and they are created as todo entities in your Home Assistant instance.
The integration requires Home Assistant 2023.11 or later, due to the fact that todo entities were introduced in that version.
-
Ensure that you have HACS installed.
-
Add Integration via HACS:
After you have HACS installed, you can simply click this button:
- Click
Download
. - Restart Home Assistant.
Alternatively, you can follow these instructions to add it via HACS:
-
Add Custom Repository:
- Open HACS in Home Assistant.
- Go to
Integrations
. - Click on the
...
in the top right corner and selectCustom repositories
. - Add the URL
https://github.com/watkins-matt/home-assistant-google-keep-sync
- Set the category to
Integration
and clickAdd
.
-
Install the Integration:
- Search for
Google Keep Sync
in the HACS Integrations. - Click
Download
. - Restart Home Assistant.
- Search for
- Click
-
Configure Integration:
- Go to
Settings
->Devices & Services
. - Click
Add Integration
. - Search for and select
Google Keep Sync
. - Enter your Google account username.
- Generate a token using the instructions below and enter the token.
- Follow the prompts to select the Google Keep lists you want to synchronize with Home Assistant.
- Go to
You can use the Docker container created by @Brephlas.
You need a computer that you can install Docker on. This can be any Linux computer, or you can even use a Windows machine by installing WSL. Note that you do not run these commands on your Home Assistant server itself, it must be a separate machine. Raspberry Pi machines will likely not work due to the ARM architecture.
If you want to use a Windows machine, you can install WSL2 and Docker. Follow the instructions here to install WSL2. Then, open Ubuntu
and run the command sudo apt-get install docker.io
.
If you are using a Linux machine, you can install Docker using the package manager of your choice. For Ubuntu, you can use the following commands:
sudo apt-get update
sudo apt-get install docker.io
-
After you have Docker installed, enter the following commands.
docker pull breph/ha-google-home_get-token:latest docker run -it -d breph/ha-google-home_get-token
-
Copy the returned container ID to use in the following command.
docker exec -it <ID> bash
-
Inside the container, enter the following command and answer the prompts to generate a master token. For the password, you should preferably use an app password,
python3 get_tokens.py
-
The script will generate two tokens, a "master token" and an "access token". Copy the entire master token, including the "aas_et/" at the beginning.
-
Use this token in the integration's configuration process by entering it into the token field (make sure you leave the password field blank).
After setup, your selected Google Keep lists will be available in Home Assistant. You can view and interact with these lists, and any changes you make in Home Assistant will be instantly synced to Google Keep.
As a result of the fact that we are working directly with native todo entities, you can use the built-in services to add, remove and update items from your synchronized lists.
todo.add_item
todo.remove_item
todo.update_item
google_keep_sync.request_sync
This service can be used to trigger a manual sync of all of your lists. This is
helpful because you can use it from an automation or script. While you can use also
use homeassistant.update_entity
to trigger a sync, that service requires you
to specify a certain entity id, while this service targets all of your lists.
There is a built in cooldown to ensure that this service is not called too frequently. Instead, it will log a warning if you call it too quickly.
Note that in some cases, the Google Keep Android app does not immediately send changes you have made to Google's servers. This means that if you call the service right after making the change on the Android app, it may not pick it up. It is recommended to add a delay before calling the service if you are trying to capture changes made on the Android app.
If you are using the Google Keep website or webapp, you can see the sync progress icon in the top right corner of the screen. Once it has finished spinning and you see the cloud icon with a checkmark, you can safely call the service.
Google recently removed third party integrations from Google Assistant. Now you can re-create these integrations.
When a new item is added to a synced list via Google Assistant or from Google Keep, an add_item
service call event will be triggered. This allows Home Assistant to pick up new items from Google Keep and sync them with third party systems such as Trello, Bring, Anylist etc.
This plugin extends Home Assistant's events so that the add_item
service call is fired regardless of where the new item was added. The origin
field in the event will be REMOTE
if the item was added remotely to Google Keep, or LOCAL
if it was added within Home Assistant.
Note: Only new items that are not completed at the time of syncing will trigger the event.
Below are some examples of how to do this, click to expand.
Sync Google Todo List with Trello via email
-
Install and configure this plugin
-
Install and configure the Anylist plugin
-
Create an email notify service in Home assistant
-
Create a new app password in your Gmail.
-
Setup creating cards by email in Trello
-
Add the following to your config.yaml file.
notify: - name: "Email to Trello Todo" platform: smtp server: "smtp.gmail.com" port: 587 timeout: 15 encryption: starttls sender: "[email protected]" username: "[email protected]" password: "app password" sender_name: "your name" recipient: "[email protected]"
-
-
Create an Automation in Home Assistant:
alias: Google Todo List description: Send new items added to Google's Todo List to Trello trigger: - platform: event event_type: call_service event_data: domain: todo service: add_item variables: item_name: "{{ trigger.event.data.service_data.item }}" list_name: "{{state_attr((trigger.event.data.service_data.entity_id)[0], 'friendly_name')}}" list_entity_id: "{{ (trigger.event.data.service_data.entity_id)[0] }}" origin: "{{ trigger.event.origin }}" condition: # Update this to the name of your To-do list in Home Assistant. - condition: template value_template: "{{ list_entity_id == 'todo.google_keep_to_do' }}" action: # Optional: Send a notification of new item in HA. - service: notify.persistent_notification data: message: "'{{item_name}}' was just added to the '{{list_name}}' list." # Call Home Assistant Notify service to send item to Trello Board. - service: notify.email_to_trello_todo data: title: "{{item_name}}" message: # Complete item from google shopping list. Can also call todo.remove_item to delete it from the list. # Update entity_id to the id of your google list in Home Assistant. - service: todo.update_item target: entity_id: todo.google_keep_to_do data: status: completed item: "{{item_name}}" # The maximum number of updates you want to process each update. If you make frequent changes, increase this number. mode: parallel max: 50
Sync Google Shopping List with Anylist
The same process works for Bring Shopping list or any other integrated list to Home Assistant.
-
Install and configure this plugin
-
Install and configure the Anylist plugin
-
Create an Automation in Home Assistant:
alias: Google Shopping List description: Sync Google Shopping List with Anylist trigger: - platform: event event_type: call_service event_data: domain: todo service: add_item variables: item_name: "{{ trigger.event.data.service_data.item }}" list_name: "{{state_attr((trigger.event.data.service_data.entity_id)[0],'friendly_name')}}" list_entity_id: "{{ (trigger.event.data.service_data.entity_id)[0] }}" origin: "{{ trigger.event.origin }}" condition: # Update this to the name of your To-do list in Home Assistant. - condition: template value_template: "{{ list_entity_id == 'todo.google_keep_shopping_list' }}" action: # Optional: Send a notification of new item in Home Assistant. - service: notify.persistent_notification data: message: "'{{item_name}}' was just added to the '{{list_name}}' list." # Add new item to your Anylist list # Update the entity_id list name to your list in Home Assistant. - service: todo.add_item data: item: "{{item_name}}" target: entity_id: todo.anylist_alexa_shopping_list # Complete item from google shopping list. Can also call todo.remove_item to delete it from the list # Update entity_id to the id of your google list in Home Assistant. - service: todo.update_item target: entity_id: todo.google_keep_shopping_list data: status: completed item: "{{item_name}}" # The maximum number of updates you want to process each update. If you make frequent changes, increase this number. mode: parallel max: 50
-
Polling Interval: While changes made in Home Assistant are instantly reflected in Google Keep, changes made in Google Keep are not instantly reflected in Home Assistant. The integration polls Google Keep for updates every 15 minutes. Therefore, any changes made directly in Google Keep will be visible in Home Assistant after the next polling interval.
-
Authentication: Using a token is strongly encouraged. Password login usually doesn't work and is deprecated by the underlying library this integration uses.
-
Checkboxes in Keep: Only Google Keep notes with
Show checkboxes
selected will appear as options to sync with Home Assistant using this integration.
As an additional security precaution, you can sign up for a new Google account to use exclusively with this integration. Afterward, on your primary account, add this new Google account as a collaborator on any lists you wish to synchronize.
Then provide the credentials for this new account (using a token) to the integration. This will allow the integration limited access your Google Keep lists without having access to your entire primary Google account.
Encountering issues? Here are some common problems and their potential solutions:
If you're experiencing Invalid authentication
errors, these are due to incompatible versions of certain underlying libraries used by the integration, such as OpenSSL. To resolve this, make sure you are using a manually-generated token for authentication instead of a password.
- Remember that changes made in Google Keep might not immediately reflect in Home Assistant due to the polling interval of the integration, which is set to every 15 minutes.
- If you're unable to connect, check your network settings and ensure your Home Assistant instance can access the internet.
- After installing via HACS or manually, ensure you have restarted Home Assistant.
- Check the
custom_components
directory to verify that thegoogle_keep_sync
folder is present and correctly named.
- Ensure the lists you want to sync are selected during the integration setup.
- Verify that the Google account used has access to the desired Google Keep lists.
This is an unofficial integration and is not created, endorsed, or supported by Google.