Dynamic page view titles. Possible?

I have a number of electric power meter devices. And I have a dashboard with a page view for each of them. Until now I manually changed the title of these views to whatever these devices were monitoring at the time. That varies.

I wonder if it is possible to use the contents of an input_text helper to assign to these titles.

An example snippet:

...
  - theme: Backend-selected
    title: Shelly 1 (TV)
    type: sidebar
    icon: ''
    badges: []
    cards:
...

In this case I would want to make to title dependent on the value of an input_text helper.
Some formula with brackets, quotes and states, I guess? Possible?
I already have custom:config-template-card installed, by the way.

Update:
When I try

    title: {{ states( 'input_text.labelshelly1' ) }}

That is then automatically changed after saving to

    title:
      '[object Object]': null
1 Like

Very few core dashboard cards support templates. Unless you use this:

Thanks for the tip. Actually I had installed this custom card a few days ago for another purpose.

I now made a change from:

title: Stroom
views:
  - type: masonry
    theme: Backend-selected
    title: Test
    path: test
    badges: []
    cards:
      - type: entity
        entity: sensor.stat_shellyplug1_energy_yesterday
...

to

title: Stroom
views:
  - type: custom:config-template-card
    variables:
      SHELLY1_LABEL: states[input_text.labelshelly1]
    entities:
      - input_text.labelshelly1
    card:
      type: masonry
      theme: Backend-selected
      title: ${SHELLY1_LABEL}
      path: test
      badges: []
      cards:
        - type: entity
          entity: sensor.stat_shellyplug1_energy_yesterday
...

But unfortunatly this didn’t work. The view is not visible after the change. I get ‘Unnamed view’ as title with an empty view.
I’ll keep trying variations on this. If I can’t figure it out I guess I’ll go ask at the authors webpage.

try with states['input_text.labelshelly1']

That makes a difference. Instead of an empty ‘Unnamed View’ I now get another error message:

Unknown type encountered: masonry

type: masonry
theme: Backend-selected
title:
  entity_id: input_text.labelshelly1
  state: TV
  attributes:
    editable: true
    min: 0
    max: 100
    pattern: null
    mode: text
    icon: mdi:card-text
    friendly_name: label
  context:
    id: 01GKRD8XA32Y47MXBXSEEANB0F
    parent_id: null
    user_id: null
  last_changed: '2022-12-08T08:22:46.339Z'
  last_updated: '2022-12-08T08:22:46.339Z'
  _cui_keep: true
path: test
badges: []
cards:
  - type: entity
    entity: sensor.stat_shellyplug1_energy_yesterday
  - type: entity
    entity: input_text.labelshelly1

At least it now recognizes the variable.
But I think the problem is that config-template-card wants to see a card (or a row?) and a view is not a card.

Do not think you may place your whole view inside CTC (config-template-card).
It works for cards only.
If you need to modify a view title dynamically - card-mod-theme is your Way.

I have now installed that mod. But I don’t see yet how to use it to change the view title. The examples I’ve seen were all about style.
Could you please explain?

Let’s precisely define what you need.
Correct me if I am wrong.
You need to dynamically define a View’s name - like this one:
изображение
“Dynamically” = by using templates (like jinjia) & state objects (like “states()”, “state_attr()” etc).
“Define” = “change font-size, color, the text itself”.
Right?

If so - go to Community → Themes → Supercharge you themes (smth like that), in short - to card-mod theme thread.
Then ping me there - I’ll give you a solution.

@Ildar_Gabdullin do you mean this thread?

I’d love to know if this is possible!

Yes, that thread