Custom component : Google Tasks (abandoned)

Ok, thx for informations.
You need only 1 file : credentials.json. (in /config from homeassisant)
Once your configuration.yaml is set up. Restart.
Go to integration, look for gtasks and add.

Now : the link you see, you can copy paste in the browser you want, like on your Mac. The result should be a code. Copy paste this code in the same box as the link in HA and submit.
Check your /config and now you should see the token.pickle

You need a browser but not in HA. I do authentication on my smartphone. You just need the return code.

Keep in touch

Deleted credentials & token. Re-created on mac. Now getting the following error:

2020-01-21 18:00:56 WARNING (MainThread) [googleapiclient.discovery_cache] file_cache is unavailable when using oauth2client >= 4.0.0 Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/__init__.py", line 36, in autodetect from google.appengine.api import memcache ModuleNotFoundError: No module named 'google.appengine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py”, line 33, in
from oauth2client.contrib.locked_file import LockedFile
ModuleNotFoundError: No module named ‘oauth2client.contrib.locked_file’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py”, line 37, in
from oauth2client.locked_file import LockedFile
ModuleNotFoundError: No module named ‘oauth2client.locked_file’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/init.py”, line 41, in autodetect
from . import file_cache
File “/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py”, line 41, in
‘file_cache is unavailable when using oauth2client >= 4.0.0’)
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0

As you see, it’s just a warning. I have the same.
Did you receive a notification/mail on your Google account saying you are connected ?
Are sensors appear ?

Boom! Got my default list :smile: Thank you!!
Is it possible to get my other lists too?

Great ! I will update documentation regarding your case. Thanks.

For now it’s only 1 couple sensors (sensor and binary sensor) for 1 list.

It’s on my to-do list to have more than 1 list.

I thank you to take time because I thought it’s working only for me :joy_cat:

Update : https://github.com/BlueBlueBlob/gtasks/releases/tag/v0.4.0

No configuration.yaml needed. Multi lists. Force sensors update after service call.

Now yes :slight_smile:

Hey man, great work. Integration became much easier but I am having trouble to complete a task when I click track from your lovelace card. Maybe the card also needs an update?

Sun Jan 26 2020 10:53:40 GMT+0100 (Central European Standard Time)
required key not provided @ data['tasks_list']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1204, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['tasks_list']

Exactly.
Update for today.

And thx for feedback :slight_smile:

Update : component and Lovelace card.

Hi,
I am having this error when marking a task title: To Do List with the card. This started to happen after I used my own card title with this . title: To Do List
it’s not something I can’t live but maybe you can have a look.

Tue Feb 04 2020 10:00:44 GMT+0100 (Central European Standard Time)
'To Do List'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1249, in _execute_service
    handler.func(service_call)
  File "/config/custom_components/gtasks/__init__.py", line 174, in complete_task
    list_id = client.tasks_lists_id[list]
KeyError: 'To Do List'

My bad, I have to remove title setting.
Now the title card is the title list

Is there a guide on how to create a credentials.json?

https://developers.google.com/tasks/quickstart/python

I can’t find the lovelace card in HACS, what do I need to do?

You need to add the card repo https://github.com/BlueBlueBlob/lovelace-gtasks-card into your HACS custom repo, like the component.

I have installed it successfully but when I click “Track” it takes a minute before the task is removed from the list. Is it possible to make it disappear faster?

I’m having a problem with creating a task, I want to use today as due date. I have tried to use following with no luck.

    data:
      task_title: Some task
      tasks_list: Dagpass
      due_date: {{ now().strftime("%Y-%m-%d") }}

Date only, like in service exemple (developer tools).
For your next question :
Google tasks API doesn’t handle tracking on time, only date.

The time is not the problem. I have tried with.

    data:
      task_title: Some task
      tasks_list: Dagpass
      due_date: {{ now().strftime("%Y-%m-%d") }}