Custom Component: Google Tasks (revived)

I’ve created this thread for the fork I’ve created of @BlueBlueBlob now abandoned original integration.

The original thread with a lot of useful information is Custom component : Google Tasks (abandoned) I will now try to move all discussion to this thread

The Component:

Lovelace Card to Display Data:



Thanks a lot for the creation of the fork and driving this integration further!

Just installed 0.6.0: The data model for device / entieties looks now much leaner. The GT-Icon is visible at Integrations view as well as in the list of devices.

Regarding subtasks: Very nice, with lovelace card beta version v1.5-alpha those subtasks show up.
Probably a future feature of an option at configuration level for the card could switch on/off subtasks.

With v1.5-alpha the “Failed to call service homeassistant/update_entity” error is gone. Great! Thanks a lot.


Thanks, good to hear. I’ve moved the card v1.5-alpha to a full release.

Switching on/off subtasks is a good idea for something I can work on in future.

Very nice! works perfect :slight_smile:

I am using a conditional card to show a custom:gtasks-card to my dashboard when there is a task due. For this i make use of binary_sensor.gtasks_xyz switching from off to on.
Unfortunately this status changes from off to on when a task becomes overdue only, but if a task becomes due it still remains off. Is this the correct behavior of that sensor?

Fantastic work! Tasks sync immediately for me, and while I’m still exploring I’m wondering about two features:

  1. is it possible to see the details of the task on the card? I’m no expert but on first look this info doesn’t appear to come through the integration.
  2. Failing something like that, can the task name provide a hyperlink to google tasks so one could get more details from google directly via clicking?

All in all, excellent work, thanks for doing this!

I can’t get this working, am new to Google tasks. Created the OAuth credentials and placed the JSON in the gtasks folder, that all works.

Try to add the integration, click the link to get the auth code between ‘code=’ and ‘&scope=’, but it comes back ‘unknown error ocurred’.

Have tried uninstalling and reinstalling the integration via HACS, restarting HA and creating a new OAuth credential, all to no avail. What should I do?

Hi. I Experience an issue. everytime i restart home assistant it creates a new gtask device so now i have 18 of them.

any suggestions?

Are you on the latest version? This was a bug, Reboot of HA creates an empty new Devices · Issue #3 · myntath/gtasks-ha · GitHub but I thought I had fixed it.

@brettfk is there anything that shows up in the logs when you get the error? If you can post anything from the logs I may be able to help better.

Deleting the ‘token.pickle’ file maybe be necessary to do a proper uninstall and reinstall if you set your directory to somewhere that would not have been uninstalled.

I just checked.
I do run 0.6.0 the latest.

what can I do to help you solve this.

Looks like I never created a version after I pushed the fix. I’ve released 0.6.1 now. Let me know if that fixes things. You might need to delete all the excess devices.

1 Like

ok will test

looka like it works thanks!! have a nice weekend

Hi @myntath, your integration works great, also in combination with the gtasks-card.

I have a question: I want to use it to announce the task via the google speakers, how can i make that possible?

I already tried to do that with state attribute, but that won’t work.

How do you normally announce through the google speakers? That is not something I do.

I think you should be able to use templating to achieve something. The below produces a list of the task titles from my ‘my_tasks’ list.

{% for attr in state_attr('sensor.gtasks_my_tasks', 'tasks') -%}
  {{ attr.task_title }}
{%- endfor %}

How do you normally announce through the google speakers? That is not something I do.

This is a google tts service with the code that you gave me to announce the tasks:

service: tts.google_translate_say
  entity_id: media_player.nest_hub
  message: >-
    {% for attr in state_attr('sensor.gtasks_google_tasks', 'tasks')
    -%}   {{ attr.task_title }} {{"\r\n"}} {%- endfor %}

The only problem is that it announces all the tasks of every day.
How can i only announce the task that is going to happen today?

(fixed) Not sure how.

Every time I try to configure this I get “unknown error occurred” we are supposed to copy between not including the code= and &scope not include them correct? Using version 0.6.1. Any advise would be appreciated.

Thanks for your help

You are correct that code= and &scope are not included. A few people seem to be having these issues. Can you see anything in the logs? I suspect it is likely a Google API issue usually and that is where I would first go double checking everything.

This is a bit beyond the scope of my knowledge and this topic. You can achieve this with jinja templating which is separate to anything this integration does.

However, here is my crack at it

{% for attr in state_attr('sensor.gtasks_google_tasks', 'tasks') -%}
 {% if "due_date" in attr and attr.due_date == states('') -%}
  {{ attr.task_title }} {{ attr.due_date }} {{"\r\n"}}
 {%- endif %}
{%- endfor %}