[APP][Pro] Todoist

Adds Todoist integration for Homey.
https://todoist.com/

Features

  • Create tasks (in project, with due date, with due time)
  • Fetch tasks
  • Respond to task events (completed/uncompleted for now)
  • Exposed API for HomeyScript (example)

https://homey.app/a/nl.jwienk.todoist
https://github.com/jeroenwienk/nl.jwienk.todoist

I’ve kept it very basic but Todoist has alot more features which can be implemented in the future if there is any interest.

1 Like

Dear Jero,

will it be possible in the future to create dynamic due-tasks?
Right now I can only create a static time and date card for due. But it would be very nice to create a task in the future based on events at my home. (e.g. my plant sensor registers a low level of water and creates me a task in the evening to water the plant).

Regards
Andreas

Yes, that is a good idea. I might be able to create a card that accepts a token as a date/time (basically the default text input). Would that suffice for your use case?

Only problem I see is you probably want to add +1 days/hours to the actual event. Another option to explore might be the due_string Todoist supports e.g. in two hours.

This works pretty well and it errors on faulty dates. Defaults to your Todoist language setting and timezone.

image

Released a test version (v1.1.0) that has this card. Let me know if you find any issues.

1 Like

You are unbelievable. Thank you very much for such a fast reaction.

The due-text ist working fine, and does exactly what I expected. The possibility to use a variable from the logic part is also great in case of a calculated date or time.

Thank you very much!
Andreas

1 Like

Dear Jero,

I just have a new idea for playing with Todoist.

Would it be possible to mark a task completed when a sensor value changes?

E.g.:
The moisture of a plant is below X% I creat a task for Todoist. If I give some water to the plant and the value rises above X% I want to mark the task in todoist completed by Homey.

Or the battery of a sensor is below X% - new task to todoist. After replacing the battery the task can be marked as done.

Would this be possible?

Regards
Andreas

Seems possible yes but I only see this working for a task that is somehow memorized in a Homey variable or something.

The task creation would have to store the ID somewhere and the other Flow has to mark this ID as completed.

So maybe a card Create a task ... with reference id: <my_reference_id>. And another card with Complete a task with reference id: <my_reference_id>. Only problem would be if the Flow with the first card is executed multiple times you could overwrite a not completed task. Your reference id in this case could be something like battery_level_low_device_1.

Some problems I see is statuses flipping quickly for some reason resulting in spamming complete and create.

I could give it a try next week to make something user friendly if I have some time.

I’ve exposed the API so you should now be able to do this with HomeyScript. Currently available in v1.3.0 (in test https://homey.app/a/nl.jwienk.todoist/test).

const app = await Homey.apps.getApp({ id: 'nl.jwienk.todoist' });
const userId = 1; // get from await app.apiGet(`/users`)

// https://developer.todoist.com/rest/v1/?shell#create-a-new-task
const createdTask = await app.apiPost(`/users/${userId}/tasks`, { content: 'My task' });

// global tag/token
await tag('Task ID', createdTask.id);
// or HomeyScript specific global
global.set("taskId", createdTask.id);

// from other script
const taskId = global.get('taskId');
await app.apiPost(`/users/${userId}/tasks/${taskId}/close`);

Hi!
I would like my flow to check if there is a task already in my list with the same text. For instance, every sunday at 10.00 create a task that is “water the flowers”. However, if there already is a task called “water the flowers” it shouldn’t create a new one.

Is this possible?

It is possible with HomeyScript right now not sure if that is an option for you. I could add a Flow condition that allows you to check on the name of a task in a specific project.

1 Like

Hello Jero, thanks for your quick reply!

Wow, that would be amazing! You are right, I don’t master Script, I looked at it and understood nothing!
What happened with the question from someone else, asking that a certain value should mark the task as completed? That would also be great!
For instance, if a task is “Empty the washing machine”, then a energy value from the machine should check the task as completed because obviously if the machine is running again it must have been emptied. I tried to figure something out but without success.

Hello Jero,
Is it possible to do this in a way that doesn’t require HomeyScript?

I had something in the works but not finished and I’m in the middle of moving so rather busy. Will not have any time for 1/2 weeks.

Oh, I wish you the best with your new home and look forward to talking more about this when you have time :smiley:

Hello Jero,
I hope you like your new home. I’m curious regarding the project, any news?

Sorry for the late response but I’ve create a test build with 2 new cards Todoist | Homey let me know if they work for you.

Hi Jero,
It works perfectly, thank you so much! I will continue later today to do different set-ups and if I come up with any new ideas, I will let you know.

BR // Jimmy

Hi,

I know i’m late to the party but would it be possible to have “when a task is completed” card please ? I know i can just use the conditional notification but…
Thanks in advance and thank you so much for this wonderful app!!!

There is a ‘A task was event’ card?