Hi, I've been banging my head for a couple of hours now, trying to parse the data from the JSON response from todo.get_items.
Background: I have a to-do list for my exercise routine, with a To Do for each day which contains a markup-based description. (It's actually stored in Google Tasks but I don't think that matters). I'm trying to create a markup card which shows only today's exercise, but I'm struggling to get the data out in a usable format.
The todo.get_items response comes back in the following format
{
"todo.exercise": {
"items": [
{
"summary": "Monday: Steps",
"uid": "RmdwakV4bVp2UjJTNkxNUA",
"status": "needs_action",
"due": "2026-06-15",
"description": "\n15min+ Steps"
}
}
(there's an entry each day of the week but I've just shown the first
I'm trying to create a sensor "today's exercise" that would have state=done or not, and attributes activity="Steps",description, and use this to populate a Markup card.
I've got as far as extracting the object for today's exercise by exact match:
{% set action_response = {"todo.exercise":{"items":[{"summary":"Monday: Steps","uid":"RmdwakV4bVp2UjJTNkxNUA","status":"needs_action","due":"2026-06-15","description":"\n15min+ Steps"},{"summary":"Sunday: Stretch and Measure","uid":"RW5XcGpUNDlpOWRlYmJGbw","status":"needs_action","due":"2026-06-14","description":"\n1. Measure Weight\n2. Measure Blood Pressure occasionally"},{"summary":"Saturday: Run or other Cardio","uid":"bFRQRDJvZVBGaWU4cXVQUg","status":"needs_action","due":"2026-06-13","description":""},{"summary":"Friday: Wii Yoga, Stretch or Catch-up","uid":"TW1yaWM3a3RSN0otRThaRQ","status":"needs_action","due":"2026-07-10","description":""},{"summary":"Thursday: Core Strength","uid":"WFJiWUJBSUJHRzlDa1FQNA","status":"needs_action","due":"2026-06-11","description":"\n1. Weighted waist bend\n2. Side Bend\n3. Squat\n4. Sit-ups\n5. Heel Raise\n6. Glute Bridge (lie on back, calves vertical, raise butt)"},{"summary":"Wednesday: Run","uid":"VDhhcFR4QmhZWDlUZGgyZQ","status":"completed","due":"2026-06-10","description":"\n\nRun at least 15min/2Km","completed":"2026-06-10T11:39:10.468000+00:00"},{"summary":"Tuesday: Upper Body Strength","uid":"SjVNZENjQ0FKOFVlM0tIVA","status":"completed","due":"2026-06-09","description":"\n1. Bicep Curl\n2. Shoulder Fly\n3. Shrug\n4. Tricep Curl (!)\n5. Lateral Lift\n6. Pressup or chest resistance band\n7. *Shoulder Lift* (!!)\n","completed":"2026-06-09T17:39:24.937000+00:00"}]}} %}
{{ action_response['todo.exercise']['items'] | selectattr('summary','eq','Monday: Steps') | list }}
Which gives me
[{'summary': 'Monday: Steps', 'uid': 'RmdwakV4bVp2UjJTNkxNUA', 'status': 'needs_action', 'due': '2026-06-15', 'description': '\n15min+ Steps'}]
But I can't figure out how to do a partial match on the 'summary' field. If I could do the following that would be lovely selectattr('summary','startswith','Monday:') but this isn't an operator so I guess I need to do something much more complicated.
Is there a straightforward way to do this? Or should I simplify the data to match my limited JSON/Jinja2 skills?
Or, alternatively, is there a custom To Do List card that offers more flexibility than the built-in one and would help me with this?
Thanks, Home Assistant hive mind!
