Yup, you’ve got it right. It steps through multiple lists searching for today’s date and then adds them as attribute today
of the sensor.eink_tasksboard_data
sensor then does the same thing for upcoming
starting with tomorrow, the next day, etc. On the second run, it extracts those 2 attributes into more attributes like today_0
and upcoming_0
so that the ESPHome device can read it more cleanly.
If I remember, I think it’s actually set to run every 3 minutes (so 6 minutes to fully populate)… but Home Assistant syncs with Google Tasks far less often.
In the YAML file, you should see ways to use different lists. I’m pretty sure Google Tasks and Home Assistant’s native Todo lists work in the same way.
By the way, a big part of how I organize my lists is with https://fullscreen-for-googletasks.com/ - makes it a bit easier to set dates for tasks than trying to deal with Google’s calendar integration. At some point, I’ll probably just end up using Home Assistant’s native lists anyway since it has due dates.
Addition: This could be a rabbit hole but I know for a fact that you can actually make automations that add and delete tasks (based on name so they better have the same name).
First, need this script (no editing required):
alias: "To-do: Item exists"
sequence:
- target:
entity_id: "{{ list }}"
response_variable: todo
action: todo.get_items
- variables:
result: >
{% set x = (item in todo[list]['items'] | map(attribute='summary')) %}
{% set item = todo[list]['items'] | selectattr('summary', 'eq', item) |
list | first | default([]) %} {{ {'exists': x, 'item': item} }}
- stop: Finished
response_variable: result
mode: single
icon: mdi:checkbox-marked-circle-auto-outline
fields:
item:
selector:
text: null
name: Item
description: The todo item to check
required: true
list:
selector:
entity:
filter:
- integration: todo
name: List
required: true
description: The todo list entity
I use this automation to add devices with low batteries to my todo.to_do
list (actually a Google Task list):
alias: Battery Actions
description: ""
mode: queued
max: 10
triggers:
- type: battery_level
device_id: 6c243272196f29f225e06c71dac7e8e5
entity_id: 769104ac11666f0ef74a4bee2556ee0e
domain: sensor
below: 10
trigger: device
- entity_id:
- sensor.zb_laundry_sensor_temperature
to: unavailable
for:
hours: 1
minutes: 0
seconds: 0
enabled: false
trigger: state
- entity_id:
- binary_sensor.rf_motion_1_battery_warning
- binary_sensor.rf_motion_2_battery_warning
to: "on"
enabled: false
trigger: state
conditions: []
actions:
- data:
item: "{{ trigger.from_state.attributes.friendly_name }}"
list: todo.to_do
response_variable: result
action: script.to_do_item_exists
- if:
- condition: template
value_template: "{{ result.exists == true }}"
then:
- metadata: {}
data:
item: "{{ trigger.from_state.attributes.friendly_name }}"
target:
entity_id: todo.to_do
action: todo.remove_item
- metadata: {}
data:
item: "{{ trigger.from_state.attributes.friendly_name }}"
due_date: >-
{{ (as_timestamp(now()) + (0*3600)) | timestamp_custom('%Y-%m-%d', True)
}}
target:
entity_id: todo.to_do
action: todo.add_item
I keep thinking I should use kind of thing to make repeatable tasks… press a physical button and have it delete that task, re-add it with a due date of tomorrow.
Oh and I think that timestamp weirdness might have to with UTC? I can’t honestly remember what’s up with that. I feel like it was adding it with yesterday’s date but I can’t remember… haha. But it’s definitely there for a reason and it’s not to add it with tomorrow’s date.