Lovelace Custom Card: Todoist-List

@Grinstantin your template sensor is doing the trick exactly like described :slight_smile:
Can now create a list based on a label, which is great.
Many thanks !

just updated to the new release (v1.1.0) and my list shows on the cardā€¦however, I canā€™t seem to add anything manually by entering it in the form field. I also canā€™t delete any items by clicking on the trash can icon?

I changed the rest and command configs from v8 to v9ā€¦

Any idea what Iā€™m doing wrong?

Edit: Iā€™m getting the following errors in my log:

Template variable warning: ā€˜urlā€™ is undefined when rendering 'https://api.todoist.com/sync/v9/{{ url }}

https://api.todoist.com/sync/v9/. Status code 404. Payload: bā€™token=ddacxxxxxxxxxxd908&commands=[{ā€œtypeā€:ā€œitem_deleteā€,ā€œuuidā€:ā€œ42-1661396201777-777ā€,ā€œargsā€:{ā€œidā€:ā€œ6114558442ā€}}]

https://api.todoist.com/sync/v9/. Status code 404. Payload: bā€™token=ddac182bc0xxxxxxxxxxa80d908&commands=[{ā€œtypeā€:ā€œitem_addā€,ā€œtemp_idā€:ā€œ19-1661396393302-302ā€,ā€œuuidā€:ā€œ19-1661396393302-302ā€,ā€œargsā€:{ā€œproject_idā€:ā€œ2284842733ā€,ā€œcontentā€:ā€œeggsā€}}]ā€™

There are some small tweaks in configuration.yaml and secrets.yaml, please, check your configs.

Yepā€¦I forgot to change the todoist_api_payload codeā€¦got it! Works great! Thanks for all you do!

Hi, Iā€™m trying to increase the font size of the todoist-item-text via card-mod. I can change the color of all the text in todoist-card and change the font size of the header via the following code:

type: custom:todoist-card
card_mod:
  style: |
    ha-card {
      color: red;
      --ha-card-header-font-size: 250%;
    }
only_today_overdue: true
entity: sensor.to_do_list
show_item_delete: false
show_item_add: false

However, Iā€™m unable to figure out what the proper syntaxis is for the item-text. Any suggestions would be very welcome. Below is a screenshot from the developer console with the target of font size modification being the second highlight.

Is it possible to add these extra features like pin, filter etc. to the HACS card? a drop down for changing project within the same card would be amazing

Hi. The integration is no longer workingā€¦ I created a new projectā€¦ no way.

2302406442

Is the integration changed?
It was very helpful in our family :smiley:
Thankyou

Hi all, I changed the js version, modified the secret file and the yaml file.
What is wrong?
I can only select in the add card section but I cannot see it in the dashboard.

secret
odoist_api_token: ad4291a4e79c431cd0468xxxxxdd272
todoist_api_payload: token=ad4291a4e79c431cd0468xxxxxxxxxxxefd272&{{ payload }}

configuration

sensors

  - platform: rest
    name: Cose da fare
    method: GET
    resource: 'https://api.todoist.com/sync/v9/projects/get_data'
    params:
      token: !secret todoist_api_token
      project_id: 2302406442
    value_template: '{{ value_json[''project''][''id''] }}'
    json_attributes:
      - project
      - items
    scan_interval: 30




rest_command:
  todoist:
    method: post
    url: 'https://api.todoist.com/sync/v9/{{ url }}'
    payload: !secret todoist_api_payload
    content_type: 'application/x-www-form-urlencoded'

calendar:
  - platform: todoist
    token: ad4291a4e79c431cd0468xxxxxxd272
    custom_projects:
      - name: 'Cose da fare'
        due_date_days: 7
      

RAW
   cards:
      - type: custom:todoist-card
        show_completed: 15
        entity: sensor.cose_da_fare
        show_item_delete: true
        only_today_overdue: false
        show_header: true
        show_item_add: true
        show_item_close: true
   

Hey @Grinstantin ! Hope all is well.

All of the Todoist ā€œcalendarsā€ I created via my configuration.yaml for this card have been unavailable since just after noon today. Iā€™m on Home Assistant 2022.12.0b6 Supervisor 2022.11.2.

In trying to troubleshoot this, I saw that the Todoist v1 api was removed Nov 30 (see here) - might that be causing the issue? Oddly, my various lists SEEM to be accurate on HA (in cross checking them with the Todoist app) so Iā€™m not sure what to make of this.

Hi, same issue also on my side. Seems that sensor is not synchronizing with Todoist server.

if your secret is as you posted it, it says ā€œodoistā€ instead of ā€œtodoistā€.

Beyond that, donā€™t know.

Itā€™s a shame @Grinstantin didnā€™t comment here, but there was extensive changes in the documentation to both the configuration.yaml and the secrets.yaml. I can confirm making those changes DOES fix the card, but yeah, having to go digging to find the answer wasnā€™t ideal.

Sorry, I completely forgot about existence of this topic :frowning: But changes in configuration files were mentioned in the release notes (as it is the most efficient way to communicate with users of this card):

There are changes to how Todoist handles authorization, so you need to update your configuration files.

Hey everyone! Iā€™ve been playing with todoist-card, and finding it very useful.

Thanks @Grinstantin, great work. I hope life is not being too hard on you with the war and all :pray:

Iā€™ve been playing with Javascript changes to the card, to add functionality. Eventually if I get things generic enough I could make a Pull Request to improve the card for everyone.

I have a few things going: mostly I am looking to do more actions when an Item is completed: write a description (ā€œDone by user XYZ at 7:55pmā€), add a Label, move to a different section.

I have all of these working, but just for my peculiar case, not generic, not configurable yet. Thatā€™s a lot more work.

Iā€™m thinking of bringing in the Labels into HASS, so I can graphically see them on the items.

I also want to try building a swipe-card with multiple todo lists side by side, or maybe different sections, to emulate a Kanban view (without drag-and-drop, sorry). This part can be done just with HASS configs, no JS tweaks are necessary.

Iā€™d just like to ask, has anybody else been doing this sort of thing? And what Todoist functionality would you most want to be able to access from the Home Assistant side?

1 Like

Just curious, has anyone used something like a zigbee button to trigger a ā€˜job completionā€™ of a todoist task? And how did you do it if so? @Grinstantin , is this even possible?

You can make the Zigbee button call an automation.

Using the existing REST command recommended in todoist-card installation instructions, you can set up an automation for it, and in the actions do this:

service: rest_command.todoist
data: 
  url: sync
  payload: >-
    commands=[{ "type": "item_complete", 
    "uuid": "a74bfb5c-5f1d-4d14-baea-b7415446a873", 
    "args": {"id": "6874471432",
    "date_completed": "2023-05-29T01:00:00.000000Z"}
    }]

I am following the todoist API reference found here: Sync API Reference | Todoist Developer

But this has a few problems: that ID is the itemā€™s ID, so it specifies which task you will be completing. You can get it from the URL inside todoist when editing the task, so something like https://todoist.com/app/project/2342185948/task/6874471432

I donā€™t know if this will be useful to you in such a static way, but maybe yes.

The other problem, which is really going to require a solution, is that the uuid needs to be different each time. It can be anything, but it has to be unique because that is what the Todoist API uses to distinguish requests from one another. If you can find a way for HASS to put in some random number there, or a timestamp, then youā€™re good to go.

I think you can just omit the data_completed argument and it should work.

I hope this helps.

1 Like

I think this is very much a step in the right direction. It seems like I would need a way to not just generate the uuid daily (as these are daily tasks), but perhaps automatically update the automation(s) with this information as well? Pardon my ignorance, but is it even possible to adjust an automation like that from the backend?

Iā€™m waiting on my zigbee buttons to arrive to the States (gogo AE!) but if all else fails I think I could set a task (ironic) to myself to update each of those UUIDs at night (when all those other tasks are complete).

Appreciate you, @pgr !

I was being silly, of course you can use templates in Automations, so this works:

service: rest_command.todoist
data:
  url: sync
  payload: >-
    commands=[{ "type": "item_complete",  "uuid": {{ range(1, 500) | random }}, 
    "args": {"id": "6874471432"} }]

I removed the complete_data, and Todoist uses the current date. I added a random number for uuid, there are probably better ways to generate random numbers, but thatā€™s a start.

You can also probably use templates to facilitate getting the task id, if itā€™s not completely stable. If you want to complete the same action often, then you will also need some way to ā€œuncompleteā€.

1 Like

Itā€™s going to be 3 different daily tasks (each to take medications, as it were). So if I was only doing the trigger once daily, it should be reset by the next time I trigger it, yes?

Have a look at how Todoist allows recurring tasks, that should be fine for your purposes and will keep the ids stable.

1 Like