Lovelace - Actions - Use dynamic values for confirmation text

Hi community,

I coulnd’t find any official docs or forum posts in regards to my desired lovelace function. I want to control my lights on the groundfloor and hence am using a light group in a lovelace card. To prevent that my chubby fingers mistakenly switch on or off the whole floor, I want to protect my tap_action with a confirmation. So far so good - a standard thing with the built-in action function, like following example:

  - entity: light.groundfloor
    icon: 'mdi:lightbulb-group'
    tap_action:
      action: toggle
      confirmation:
         text:
            Are you sure to toggle light?

But I want to achieve more: within that confirmation text I want to use dynamic values (e.g. a current sensor value, or an attribute,…) - to be specific I want just to be able to show that upcoming state of the entity:

  • Are you sure to toggle light on?
  • Are you sure to toggle light off?

I was hoping and testing following sample functions, without any success:

      confirmation:
        text: >
          Test value: {% states('input_number.test') %}
...
      confirmation:
        text: >
          Test value: {{ input_number.test }}

Is my request doable with the current builtin action - confirmation function?

Thanks a lot

You can’t just use templates in Lovelace, you need something like this →

Try installing the card and see if you can get it to work.

Thanks for the info! Will have a look at that integration/card.