Custom Component: Google Tasks (revived)

Is it possible to integrate the possibility to delete or finish tasks?

Clicking the tick icon to the right of the task will finish the task and remove it from the list. There is not a separate way to delete a task.

I meant the possibility to finish tasks by automation as a service.

Is i possible to translate the text ‘NEW TASK’ in the card?

@Zilla @myntath

Looks like i’m having the same issue. I place the credentials file in the gtasks folder but I get back a ‘Credentials not found’ error. BTW I had this working a few days ago but forgot to hit publish. I uninstalled everything and even rolled back my home assistant core but nothing seems to work. @zilla i’m not sure what you mean by moving the manifest.json. Can you explain?

@zilla @myntath

I just wanted to let you know that I resolved the issue. I changed the Default locations in the const.py to the locations my file lives. Zilla is right, the initial prompt to enter credentials seems dead. You can’t update the file path. Also, lines 91-99 in the config_flow.py may have some issues with indentions. A few lines showed red in VS code and I adjusted them until they turned green. I know nothing about python and this is just a guess but wanted to bring it to your attention. I’m not sure what fixed the issue because I made both changes at the same time before I restarted.

I’ll look into this. I don’t think anything in the card is translated at the moment.

From what I can tell the prompt is working for me. I can place the file in different locations and it will be found or not found depending on what I set the location to in the prompt. Of course the file and location must be readable to home assistant and using relative paths like the default one relies on where home assistant is running from.

I note that if you place the credentials file in the gtasks folder like you said then you will need to update the location as that is not the default location, at least for my setup. I would need to change the location to be ./custom_components/gtask/credentials.json

I’ve had a look at lines 91-99 and I agree it can be formatted more nicely (linebreak needed on line 97). I’ll make that fix but it shouldn’t cause any issues in the meantime.

It is very weird. The first time I set it up I had no issues it was only when I uninstalled/reinstalled I ran into problems. Any way, it works now and very grateful you have revived this project. Thank you!

hi, i really like this and is so happy that you revived it. I did run into a tiny problem with the lovelace-gtasks-card, it does not show up if I cast the view to my google tv chromecast. it would be really cool if that would work.

/fredrik

Great work. Thanks to you my dashboard is really coming to life.
Quick question: I have a task which isn’t due until March 2024. I don’t need/want to see it today when it’s so far in the future. Is there a way to only show a task on the day it’s due (for instance)?

Thanks again

You can make use of the paramter show_days at the gtasks-card
show_days: 5
for instance is shoing only tasks which are due within the next 5 days + tasks which are overdue.

Thanks so much. That worked. The sheer number of options is a blessing and a curse.

I got this set up and I can see my entities in HA which include my existing tasks, but when trying to make a service call to create a task, I get :

Could not parse date for dictionary value @ data['due_date']. Got None (invalid_format)

The YAML for the service call is :

service: gtasks.new_task
data:
  task_title: Blah
  tasks_list: HA
  due_date: 2023-03-27T00:00:00.000Z

The due_date format was filled in by “Fill Example Data” I just added 1 day to the date. I’ve also tried removing everything after and including the ‘T’

Thanks.

Edit - Just noticed that the fill example date is in the past, but it doesn’t matter if I set it to a date in the future

Edit #2 : this works :

service: gtasks.new_task
data:
  task_title: Eat Turkey
  tasks_list: My Tasks
  due_date: '2023-12-25'
1 Like

Is there any way to enable scrolling within the card? Right now, my cards are only showing a maximum of 8 tasks, and there are days where I have more that I would like to be able to see.

BTW, for me, this is bridging the massive gap Home Assistant has with any sort of repetitive task/chore list where grocy doesn’t quite fit the bill. Thank you!

There is nothing within the lovelace card itself to enable scrolling, I’m not aware of any cards that you can scroll in, do you have an example?

I wonder if this is more connected to the layout of the cards? My card can hold as many tasks as I add it just increases in size and then the whole dashboard scrolls.

What is your particular layout setup? Maybe a screenshot would help.

There are also custom layout cards that might help get things where needed such as GitHub - thomasloven/lovelace-layout-card: 🔹 Get more control over the placement of lovelace cards.

I’ll have a look into the casting issue when I have time. I don’t normally cast the dashboard but I know I have all the equipment to do it and have done it in the past so hopefully can replicate. It seems this is a common issue with custom cards. I’ve opened an issue for it on Github.

1 Like

Lol feel free to laugh at me for breaking down tasks into such minute detail, but you know, sometimes the kids need really specific guidance.

Anyway, I’m not understanding why, if there’s no limit to the tasks shown, that it’s only pulling few tasks from each day. Even today, when there were six things due, it only showed 3 of those before moving on to tomorrow’s tasks. In this screenshot, it should kinda illustrate that there’s 7 tasks due for tomorrow, but only 3 of those get listed before the card moves on to show tasks for the following day, but never more than 8 total. I have tried all the different lovelace layouts with no effect on how the card renders.

Can you check in Developer Tools > States > sensor.gtasks_my_tasks to see whether all the tasks are showing in there? If not then it probably isn’t an issue with the card but with the component not retrieving all tasks.

Also does the same problem occur if you remove the ‘show_days’ option?

It’s pulling 20 tasks, but they’re not the next 20, chronologically. If I remove the show_days option, it shows all 20, but again, those aren’t actually the next twenty.