I have the current flow below:
[{"id":"ae241fcf.558a78","type":"api-call-service","z":"50957880.0bf298","name":"Remind Me to Fix","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"todoist","service":"new_task","entityId":"","data":"{\"content\":\"Fix {{payload.attributes.friendly_name}} because it is {{payload.state}}.\",\"project\":\"House\",\"labels\":\"Bedtime\",\"priority\":4,\"due_date_string\":\"in 2 hours\",\"due_date_lang\":\"en\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":670,"y":100,"wires":[[]]},{"id":"5f897886.83f0f8","type":"ha-get-entities","z":"50957880.0bf298","name":"Which Vacuum","server":"8efa78ba.f10338","version":0,"rules":[{"property":"entity_id","logic":"starts_with","value":"vacuum.","valueType":"str"},{"property":"state","logic":"does_not_include","value":"on, cleaning, returning, docked, paused, idle","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":440,"y":100,"wires":[["ae241fcf.558a78"]]},{"id":"ccaf8493.3d07a","type":"server-state-changed","z":"50957880.0bf298","name":"Dining Room Vacuum","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.dining_room","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"running","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":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":180,"y":40,"wires":[["5f897886.83f0f8"],[]]},{"id":"f3ffd7b7.3fb39","type":"server-state-changed","z":"50957880.0bf298","name":"House Vacuum","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.house_vacuum","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"running","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":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":160,"y":100,"wires":[["5f897886.83f0f8"],[]]},{"id":"92a268df.2a53d8","type":"server-state-changed","z":"50957880.0bf298","name":"Upstairs Vacuum","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.upstairs_bedroom","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"running","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":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":160,"y":160,"wires":[["5f897886.83f0f8"],[]]},{"id":"32c219dc.a7307e","type":"server-state-changed","z":"50957880.0bf298","name":"Kitchen Mop","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.kitchen_mop","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"running","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":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":150,"y":220,"wires":[["5f897886.83f0f8"],[]]},{"id":"df9f6fb6.8b163","type":"inject","z":"50957880.0bf298","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":410,"y":200,"wires":[["5f897886.83f0f8"]]},{"id":"8efa78ba.f10338","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
The spirit of the flow is to capture any error on my vacuums and add a task in Todoist to fix the error. As the flow triggers anytime a vacuum changes its state to ‘not running’ this causes the remainder of the flow to execute and add duplicate tasks.
Is there anyway to limit the creation of a task to once per day per entity?