Custom component : Google Tasks (abandoned)

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") }}

Ok. I have some tests to do.
Can you post logs during this time plz ?
I will try to fix it tomorrow.

And thanks for reporting :+1:

Here is the related error.

Not a parseable type for dictionary value @ data['due_date']
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: Not a parseable type for dictionary value @ data['due_date']

Need simple quote :

due_date: '2019-12-26'

In template use :

now().date()

So something like this?

    data_template:
      task_title: Some task
      tasks_list: Dagpass
      due_date: {{ now().date() }}


1 Like

Now I’m getting this

invalid key: "OrderedDict([('now().date()', None)])"
  in "/config/automations.yaml", line 1193, column 0