Automation to Mark a Todo as Complete

I use Todoist as my primary task manager for a variety of reasons. Thanks to HA, I can now see my Todoist items in HA and can even go as far as to add tasks to Todoist using Node Red. Now I want to try and figure out how to mark these tasks as complete. Here is an example automation and I cannot seem to determine how to automate this in Node Red:

  1. If I arrive Home, HA checks my Tesla battery and adds a Todoist reminder to charge the battery if below a certain number of miles.

  2. I would like to create an automation that would mark the Todoist reminder above as complete if the Tesla changes its state to charging.

Has anyone done something similar to this? I can’t seem to figure out how to (i) find the individual task (based on a search) in NR and then mark that task as complete?

I have been testing this, much along the same lines.

To mark as completed, all you have to do is find the entry in the list, and update the status to ‘completed’.

This is a basic flow - you will have to modify the entity in the service calls, and the JSONata in the change node for your particular list name, and for the summary text you are looking for.

[{"id":"12bf508631efe6f7","type":"api-call-service","z":"7dd6029db0cd3fa9","name":"","server":"","version":5,"debugenabled":false,"domain":"todo","service":"get_items","areaId":[],"deviceId":[],"entityId":["todo.inverter_control"],"data":"{\"status\":\"needs_action\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"queue":"none","x":300,"y":1660,"wires":[["454bfd567b87aeea"]]},{"id":"e5b0728ea6e54785","type":"inject","z":"7dd6029db0cd3fa9","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":1660,"wires":[["12bf508631efe6f7"]]},{"id":"454bfd567b87aeea","type":"change","z":"7dd6029db0cd3fa9","name":"Get Item","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t    $find:=payload.`todo.inverter_control`.items[summary=\"Boost Battery\"];\t    {\"data\": {\"item\": $find.summary, \"status\": \"completed\"}}\t    \t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1660,"wires":[["68287c5c7994870a"]]},{"id":"1c939a848a540597","type":"api-call-service","z":"7dd6029db0cd3fa9","name":"","server":"","version":5,"debugenabled":false,"domain":"todo","service":"update_item","areaId":[],"deviceId":[],"entityId":["todo.inverter_control"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"queue":"none","x":810,"y":1660,"wires":[[]]},{"id":"68287c5c7994870a","type":"switch","z":"7dd6029db0cd3fa9","name":"Found","property":"payload.data.item","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":1660,"wires":[["1c939a848a540597"]]}]

Good Morning,

I have the flow below which is to trigger on the status of the vacuum chaning to docked.

The Flow appears to trigger but the resulting task is not marked completed:

[{"id":"4501f74f750d3e9d","type":"debug","z":"99dc8ef930de5404","name":"debug 93","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1820,"y":3560,"wires":[]},{"id":"9f2fd633eae9fd16","type":"api-call-service","z":"99dc8ef930de5404","name":"Update Completed Item","server":"6e751b1b.8f17c4","version":5,"debugenabled":false,"domain":"todo","service":"update_item","areaId":[],"deviceId":[],"entityId":["todo.house"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"queue":"none","x":1590,"y":3560,"wires":[["4501f74f750d3e9d"]]},{"id":"ac8f010273a36bea","type":"switch","z":"99dc8ef930de5404","name":"Found","property":"payload.data.item","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":1350,"y":3560,"wires":[["9f2fd633eae9fd16","eadd02636c1b3c70"],[]]},{"id":"c6c3b49ec427cda4","type":"change","z":"99dc8ef930de5404","name":"Get Item - House Vacuum Mop","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t   $find:=payload.`todo.house`.items[summary=\"Fix The Downstairs Vaccum is unavailable, fixt it..\"];\t   {\t       \"data\": {\t           \"item\": $find.summary,\t           \"status\": \"completed\"\t       }\t   }\t    \t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":3520,"wires":[["ac8f010273a36bea","1ebabdf23518bae6"]]},{"id":"eadd02636c1b3c70","type":"debug","z":"99dc8ef930de5404","name":"debug 92","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1480,"y":3520,"wires":[]},{"id":"597358feb93badcc","type":"api-call-service","z":"99dc8ef930de5404","name":"Get all House Tasks","server":"6e751b1b.8f17c4","version":5,"debugenabled":false,"domain":"todo","service":"get_items","areaId":[],"deviceId":[],"entityId":["todo.house"],"data":"{\"status\":\"needs_action\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"queue":"none","x":800,"y":3520,"wires":[["c6c3b49ec427cda4","2ebd3236d6a2b5f7"]]},{"id":"1ebabdf23518bae6","type":"debug","z":"99dc8ef930de5404","name":"debug 91","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1320,"y":3480,"wires":[]},{"id":"0a1b82db7b0e88fb","type":"server-state-changed","z":"99dc8ef930de5404","name":"House Vaccum Mop Is Docked","server":"6e751b1b.8f17c4","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"vacuum.house_vacuum_mop","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"docked","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":510,"y":3520,"wires":[["597358feb93badcc"],[]]},{"id":"2ebd3236d6a2b5f7","type":"debug","z":"99dc8ef930de5404","name":"debug 89","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":960,"y":3600,"wires":[]},{"id":"6e751b1b.8f17c4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]