Lovelace Custom Card: Todoist-List

Hi all.

I spent a bit of time playing with custom cards in lovelace, and felt that I needed one for todoist.
I created a card that, given a specific calendar, shows the list of open tasks of the project that calendar references.

It is just a small project, but I would like to share it and, if possibile, improve it thanks to your opinions.

Give it a try, if you think it is usefull for you.

5 Likes

Hi, sounds interesting. Do you have a screenshot of it?

Here is the screenshot:

hey! will you consider having this custom card up and runing again?

Ok,
When I’ll have a bit of free time I’ll try to make it work again.
Stay tuned for updates

1 Like

tnx.
i got it working, but scan_interval wont work can you help changing the scan interval some how?

Hey there,
With version 100.0 of homeassistant todoist integration is back working, but your lovelace card won’t load, does anyone know a solution for that problem? or is there a way to rewrite the file to work again?

Greetings to all of you out there :slight_smile:

1 Like

working great for me

and thank you to @letherwin for creating it!

Loving this card for a Todoist shopping list. I am using Google Assistant with IFTTT to automatically put new tasks in several Todoist lists.

Feature request; Can subtasks be indented in this card to match the formatting in Todoist? i.e.

Project House

  • Build Deck
    • Buy Lumber
    • Dig Post holes

Can i complete the tasks in this card?

Give this a shot: https://github.com/grinstantin/todoist-card
This was done “for home use”, so there may be some bugs - for example, when using nested lists and so on. Not sure if I’ll have time for this repository anytime soon, but I’m always open for requests/suggestions anyway.

3 Likes

Thanks for doing todoist-card! I would love an option to disable the delete button. Thanks!

Saw the update with the options added! Thanks! :wink:

1 Like

Happy to help!

Is there a way you could add something similar to the “Undo” button that shows up when you finish an action at the todoist site? It would be great to be able to repair a mistake after pushing the wrong item… :slight_smile:

I’ll think about it. So far I don’t see a simple way to solve this, because Todoist API doesn’t include completed tasks in response. They have endpoint for obtaining list of completed tasks, but that endpoint is a part of Todoist Premium subscription (at least right now). Most likely, we’ll have to create one more entity (maybe also a sensor - for less confusion) for storing information about completed tasks, which will “partially empty” itself after some timeout.
Anyway, I’ve added this to the project roadmap :slight_smile:

Hello Guys!
As I don’t want to use the todois cloud, i have build an python sqlite backend for this card.
You can find my fork here: https://github.com/Dielee/localToDo-card
Maybe, I will build an docker container for easier use.
Docker container now available.

1 Like

Finally got some time to work on this card. Yesterday I’ve added similar implementation of “undo” button (see new show_completed option).

Note that list of completed items is cleared on page refresh. I tried to store the necessary data about them in a new special entity (template sensor, in my case), but I could’t figure out how to update the attributes of this entity from the card. If that is possible (without API token) and someone has a working example - I’ll be grateful for it.

Thank you for this! Very handy.

Three things that I would personally find helpful:

  1. filter tasks from a project by label
  2. a way to display the due date/time
  3. a method to add a link

There seems to be a minor bug in “Only show today or overdue”. If the task has a time of day set for the due date (as opposed to just “tuesday”) that is later than the current time, it will not get displayed.

I think it could be fixed by changing the following line:

return item.due && (+(new Date()) >= +(new Date(item.due.date))); 

to:

return item.due && (+(new Date(new Date().setHours(24,0,0,0))) >= +(new Date(item.due.date))); 

FYI…I figured out a work-around for my #1 request above. I just made a second sensor from the first. I guess this solution is probably obvious to the more experienced people here.

template:
  - sensor:
    - name: "General To-do List"
      state: "{{ states('sensor.to_do_list') }}"
      attributes:
        items: >
          {% set data = namespace(values=[]) %}
          {% set value = [] %}
          {% for item in state_attr('sensor.to_do_list','items') %}
            {% if item.section_id == 51654132 %}
              {% set data.values = data.values + [item] %}
            {% endif %}
          {% endfor %}
          {{ data.values }}

There is probably a more efficient way to do the template, but templates & jinja (I could add yaml,json,…pretty much everything about home assistant) are new to me.

One more note for anybody looking to do something similar. I used “section_id” in the above since I am using cards in todoist. It could just as easily have been filtered by label or priority.

I messed around with how to display the due date too, but my html/css/js skills are so poor that I couldn’t figure out how to make the formatting look ok. Specifically, I couldn’t figure out how to display the date smaller and on the next line (below the item.content) without making a new row the same size as the existing row.

Again…many thanks for the great card.