Hi there!
I have managed to create a task tracker that uses sensors to track due dates and then scripts to set the date to x amount of days in the future on clicking an associated button for the task on the lovelace dashboard:
I also have an automation that send me a notification to my phone every day at 9am with a list of the day’s tasks. It gets it’s information from a due date sensor:
#Due Date Sensor
- platform: template
sensors:
due_date:
friendly_name: "Due Date"
value_template: >
{%- for state in states.input_datetime %}
{%- if ((state.state_with_unit == now().strftime('%Y-%m-%d') )) %}
<li>{{state.name}}</li>
{% endif -%} {% endfor %}
alias: NOTIFICATION - Cleaning Tasks Due Today
description: ''
trigger:
- platform: time
at: '09:00'
condition: []
action:
- service: notify.mobile_app_sarah_s_phone
data:
title: Today's Cleaning Tasks
data:
actions:
- action: URI
title: Complete Today's Tasks
uri: https://XXXXXXXX.duckdns.org/new-home/cleaning
message: '{{ states.sensor.due_date.state }}'
mode: single
This all works great! Where I’ve come unstuck is that I wanted to be able to click the notification and have it call the respective scripts based on the tasks in the notification to complete the tasks and update the due date.
I created a sensor that gets me the entity ids of the tasks in the notification but I can’t figure out a way for me to use those in a script as they don’t appear to be in an array (and indeed I couldn’t figure arrays out in jinja at all!).
Is this an impossible dream?! My stop gap for now is simply opening the lovelace view with the tasks on it but this is a bit of a pain because you then have to hunt for the tasks you want to complete in the list.
Any help or insight much appreciated!