I am trying to build a dashboard for my ToDo Lists. I am using Local ToDo as it is the only one that allows full control locally and exposes the data for some sumariztion.
The problem I am hitting is when using auto-entities to grab all of the todo.X lists and populate to a todo-list card, I can not find a way to set the title. I have tried using a sensor, decluttering card, and even bolting on markdown card as a separate header. Just can figure it out.
Below is the working code to auto generate how ever many todo list exist. Works perfectly. I commented out the part that isn’t. No matter what I try to put in for code it either gives me the
- Literal code I type in as a title.
- A competely blank card.
- A todo list card with no title.
type: custom:auto-entities
view_layout:
grid-area: tasks
card:
type: grid
columns: 4
square: false
card_param: cards
filter:
include:
- domain: todo
options:
type: todo-list
# title: |
# [[[
# const name = entity.entity_id.split('.')[1]
# .replace('_local', '')
# .replace(/_/g, ' ');
# return name.charAt(0).toUpperCase() + name.slice(1);
# ]]]
exclude: []
I have tried everything I can think of, by entity_id
title: >
{% set name = entity.entity_id.split('.')[1] | replace('_local', '') | replace('_', ' ') %}
{{ name | capitalize }} # Generate the title dynamically from entity_id
By sensor value
sensor:
- platform: template
sensors:
todo_entity_list:
friendly_name: "Todo Entity List"
value_template: >
{% set task_list = states('sensor.todo_entity_list').split(',') %}
{% set task_list_clean = task_list | map('trim') %}
{{ task_list_clean | join(', ') }}
I’ve tried lots of other but there is no sense posting more non-working code.
Does anyone know how to pass a variable/name/state to the title of todo_list inside and auto-entities card?
I imagine this happens with other cards as well but I haven’t seen it yet.
It’s impossible to tell which card is which until I make the first task in each a title and never delete it, which is just to much a hack for me.
Thanks.