Entities card with lock confirmation text and colored icon problem

I’m struggling with this entity card and a lock entity for the last couple or hours;

            - type: entities
              entities:
              - entity: lock.loqed_achterdeur
                name: Achterdeur

              - type: conditional  # ACHTERDEUR LOCKED
                conditions:
                  - entity: lock.loqed_achterdeur
                    state: 'locked'
                row:
                  type: button
                  name: Achterdeur
                  entity_id: lock.loqed_achterdeur                       
                  action_name: 'ONTGRENDELEN' 
                  icon: mdi:lock                   
                  tap_action:
                    action: call-service
                    service: lock.unlock
                    service_data:
                      entity_id: lock.loqed_achterdeur
                    confirmation:
                      text: Wil je de achterdeur ontgrendelen?

              - type: conditional  # ACHTERDEUR UNLOCKED
                conditions:
                  - entity: lock.loqed_achterdeur
                    state: 'unlocked'
                row:
                  type: button
                  name: Achterdeur
                  entity_id: lock.loqed_achterdeur
                  action_name: 'VERGRENDELEN'
                  icon: mdi:lock-open-variant 
                  tap_action:
                    action: call-service
                    service: lock.lock
                    service_data:
                      entity_id: lock.loqed_achterdeur
                    confirmation:
                      text: Wil je de achterdeur vergrendelen?

I would like to have a confirmation text, which I think is necessary, when locking or unlocking a lock AND a yellow colored icon whenever the state of the lock is ‘unlocked’.

The confirmation text doesn’t seem to be possible with the normal - entity: lock.loqed_achterdeur and with a conditional card there is no possibility to color the icon. I tried card-mod but that doesn’t work with conditional cards unfortunately.

Is there another option to have a confirmation text AND a colored icon?

I think the Lovelace Restriction Card meets your criteria: https://smarthomepursuits.com/how-to-create-a-lovelace-restriction-card-in-home-assistant/

Check again in a corresponding thread.

Which corresponding thread do you mean excactly? Could you share the link to the thread/post?

And because I use a row instead of a card it doesn’t work. Or I must be missing something but I can’t figure it out… Maybe you can clear it up.

I posted the link to the thread where these issues should be discussed. Otherwise we got 100500 threads about similar questions(((
In short - for some cases like vertical-stack etc try using mod-card. Or specify a style on the Entities card’s level.

Thought this forum was also for helping each other out with (mis)configurations. Thanks for your… help, I guess… Will try to figure it out, but just can’t get it to work.

Card-mod can be a real pain. This is a working example with color changing icon and confirmation text:


type: entities
state_color: true
entities:
  - type: button
    entity: input_boolean.test
    icon: mdi:lock
    name: Lock
    style: |
      :host {
        --paper-item-icon-color:
          {% if states('input_boolean.test') == 'on' %} red
          {% else %} yellow
          {% endif %};
      }
    action_name: run
    tap_action:
      action: call-service
      confirmation:
        text: your text
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test