PowerTodoist-card: Lists, Kanbans, and much more [beta release]

Hi! Sorry to hear those news - I will pray for you :pray:

I am not sure how to achieve what you want, but I think it should be possible. With scripts, you could do basically anything, but that requires some Python which is not my thing.

With simple automations, it should also be possible, I think you could try first creating a sensor directed specifically at the task you want to know if it is done. So, instead of having a sensor that gets everything from Todoist API, so that my add-on then filters and organizes what to show, you would have a separate sensor (totally unrelated to my add-on) that grabs a specific task and (probably using a value template) compresses the returned info into a simple boolean true/false indicating if the task is done.

This should then be straight-forward to use in the automation.

Good luck and if you get it working, tell us how you did it. If you have difficulties I suggest asking in the forums, in a more generic format (“I have this sensor that grabs everything, help me get a duplicate sensor with just the state of one item”).

Thank you on all counts - I think I’m following what you’re saying.

The mini pc I have running Proxmox (which holds HA) decided to kick the bucket (better it than me?) so I’ll have to attack this again once I’m back online.

Thanks!!

1 Like

hey @pgr ! As I noted in my last comment, I (unintentionally) nuked my Proxmox server and then made the decision to quasi start over rather than rebuild. Well, I rebuilt enough to be able to copy information over but the new system is much better equiped for anything. I digress…

I’ve been doing a LOT of copy/pasting, including cards that I had working just fine beforehand that are now showing this instead:

image

The code is

type: custom:powertodoist-card
entity: sensor.bens_bedroom
show_item_delete: false
show_completed: 0
show_item_add: false
filter_today_overdue: true
show_header: false
sort_by_due_date: ascending
filter_show_dates_ending: '0'

The sensors are pulling in data (you can see it’s due today):

image

Any ideas? Surgery is Monday, and I’d at least like to have this working again in the kitchen (the one you saw in the photo I posted a month or so ago) so my caretaker will be able to mark down when she’s fed the furkids.

Hi. I think this has to be a sensor problem, getting data from sensors is really happening before my code ever gets to do anything.

I suggest a full OS-level reboot, sometimes I’ve seen this “unblock” sensors.

Other than that, check that you really have fresh data showing in the sensor, not just today’s date which could have been set days ago, but add a task with a funny name and see it appear.

I have attempted using CSS and CardMod without success. Is there a way to change font size and spacing/padding between items on the list?
TIA

I would expect Cardmod to work…

There aren’t proper CSS options, I mentioned that here:

If you do try to change the JS file, bear in mind that you will need to re-zip it:

Sorry for never getting back to you. I did solve the issue. I don’t remember now what it was, but I feel like it was something pretty dumb on my end.

Still one of my favorite cards.

1 Like

Hi, thx for this implementation.
I now tried a few hours and got the entity filed with values from the webside and can see them under the developer stuff.
Now I put the js file in the config/ww folder manual (it was missed after the instalation) but in the UI I only get this:

Any ideas how to get this working?
Thx and Cheers
Marco

Hi again,
now I have seen that the “sensor.label_colors” is not created. Don’t know why but I can only see “sensor.to_do_list” with values

grafik

… but the lable_colors is not visible there…
grafik

…both are defined in my sensor.yaml

and the rest_command is still in the configuration.yaml located

grafik

So what I’m doing wrong?

Cheers
MarcO

Fixed it. Problem was that I put all sensors in my sensor.yaml.
But I need to relocate the 'platform: command_line" - part to my configuration.yaml and have to change it like this:

command_line:
  - sensor:
      name: label_colors
      command: !secret todoist_cmd_with_api_token
      value_template: > 
          {{ value_json.label_colors | length }}
      json_attributes:
          - label_colors 
      scan_interval: 200

Now its working. :slight_smile:

1 Like

Hi @pgr

This was a discussion we had on the original Todoist-List thread, but I’ve just created a new task and hoped to have it marked completed within the automation (will paste below how we’d done this previously) but it looks like Todoist has changed the arg from ID numbers to random characters. Would this still work?

  - data:
      url: sync
      payload: >-
        commands=[{ "type": "item_close",  "uuid": {{ range(1, 500) | random
        }},  "args": {"id": "6590698001"} }]      
    action: rest_command.todoist
    enabled: false

The new item ID I’m getting is 6WvFfRcXFq2xrmJ7.

I think it will likely work well. Have you tried it?

Will be tomorrow morning. I’ll circle back and let you know if it worked.

It may be worth noting that I canceled my paid Todoist sub. I’ve still got a few months on it, but I’ve consolidated my tasks down to be under the free usage.

Good news - it worked! So apparently those IDs can now include letters too, which seems to be the default for all my tasks - curiously/amusingly, the old IDs seem to still work too!

Hi,

i tried out your card and it works great in my dashboard. It’s a very good tool.

I tried to send notifications regarding the due today or overdue tasks, but I didn’t found a solution.

Is it possible to create an sensor (“sensor.overdue”) with the filter function. So that it only shows the number of overdue or due today tasks. I want to use this as an trigger for a message.

Sensor.overdue > 0 sent notification.

It would be also great if it is possible that I can show in the message then only the overdue or due today tasks.

When over

Have you considered trying to achieve that from Todoist? It’s probably simpler to do it there.

From home assistant, you would have to manage the sensor in a way that it wouldn’t send repeating notifications (once a day only?).

Anyway, I am tied in other projects and I don’t think I can find the time for new features currently, sorry …

In todoist it is not possible. I thought it would be easy possible with powertodoist and the filter function.
I want to send it once a day, so in a automation with that sensor and a defined time it would be possible.

@pgr Just wanted to say thank you for making this. My wife and kiddo have ADHD and I used the automation integration that you included with this to help give them the dopamine hit that they need when creating tasks.
I currently I have it set up so that when they complete a task it calls an automation that plays sounds and flashes some lights in the house.
My kid loves it!
Great job!

Well, that’s one use I would have never thought of :smile:

Thanks for sharing!

@pgr - I have recently gotten back into customizing my HA for a tablet dashboard, and am really looking forward to using this. (Especially after the Alexa/Todoist integration went away - that’s causing some issues for my partner :slight_smile: ).

I have followed your instructions exactly, but I’m running into a problem. When I try to add todoist_cmd_with_api_token: to secrets.yaml, saving it results in an “undefined” error and the line is removed from the file when it saves. Hence the configuration check via Developer Tools gives this error:
Error loading /config/configuration.yaml: Secret todoist_cmd_with_api_token not defined
I am running Core 2024.12.5, Supervisor 2024.12.3, Operating System 14.1, Frontend 20241127.8. (I am not going to upgrade to 2025.1 at this time). Thanks for any assistance!

Here is my YAML:

secrets.yaml

# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
some_password: welcome
todoist_api_token: 'Bearer (redacted)'
todoist_cmd_with_api_token: 'echo "{\"label_colors\":" $(curl -s https://api.todoist.com/rest/v2/labels -H "Accept: application/json" -H "Authorization: Bearer (redacted)") "}" '

configuration.yaml

sensor:
  - name: Household
    platform: rest
    method: GET
    resource: 'https://api.todoist.com/sync/v9/projects/get_data'
    params:
      project_id: (redacted)
    headers:
      Authorization: !secret todoist_api_token
    value_template: '{{ value_json[''project''][''id''] }}'
    json_attributes:
      - project
      - items
      - sections
      - project_notes
    scan_interval: 30
sensor:
  - name: Household Chores
    platform: rest
    method: GET
    resource: 'https://api.todoist.com/sync/v9/projects/get_data'
    params:
      project_id: (redacted)
    headers:
      Authorization: !secret todoist_api_token
    value_template: '{{ value_json[''project''][''id''] }}'
    json_attributes:
      - project
      - items
      - sections
      - project_notes
    scan_interval: 30
sensor:
  - name: Personal
    platform: rest
    method: GET
    resource: 'https://api.todoist.com/sync/v9/projects/get_data'
    params:
      project_id: (redacted)
    headers:
      Authorization: !secret todoist_api_token
    value_template: '{{ value_json[''project''][''id''] }}'
    json_attributes:
      - project
      - items
      - sections
      - project_notes
    scan_interval: 30
command_line:
  - sensor:
      name: label_colors
      command: !secret todoist_cmd_with_api_token
      value_template: >
        {{ value_json.label_colors | length }}
      json_attributes:
        - label_colors
      scan_interval: 200
rest_command:
  todoist:
    method: post
    url: 'https://api.todoist.com/sync/v9/{{ url }}'
    payload: '{{ payload }}'
    headers:
      Authorization: !secret todoist_api_token
    content_type: 'application/x-www-form-urlencoded'