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.
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?
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.
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…
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
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.
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.
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:
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.