Lovelace Restriction Card - Client-side Security

Is there any easy way to control the height?

I have 3 horizontal stacks with button cards and the restriction card has a different height than the button card. In the past I’ve used stuff like card-mod, but I’d like to get rid of that as much as possible because it always causes some kind of problems.

created the whole dashboard from scratch and the problem is gone

1 Like

I have been tearing my hair out. I have the simplest card, just trying to test it out. A basic block that shouldn’t matter to my user. When I go to interact with the card, I get the flashing lock and can’t do anything.

Apparently, I don’t know what user I am or something. Is there a special ID or something?

  • I have tried what is on the Profile page: Steve You are currently logged in as Steve. You are an owner.
  • I have tried it in quotes

I have no idea, what stupid thing am I missing or do I not understand exemptions? Any help would be appreciated. Thank you

type: custom:restriction-card
restrictions:
  block:
    exemptions:
      - user: Steve
card:
  type: thermostat
  entity: climate.icomfort

You need to use the user ID not username.

Untitled

2 Likes

Thanks a lot. I never went into the users section looking for it, just profile and people. Thanks

Hi,
great card. I have a question how can i configure this card? I need to disable a boolean (Jeden Tag) if both booleans (Zeit and Helligkeit) are off:

image

The restriction-card supports ONE entity for a condition.
This may be done w/o the restriction-card - use card-mod.
image

1 Like

Another way to do this would be to put Zeit and Helligkeit in a group and the the group status as your restriction card condition.

Thank you. My solution looks like this.

  - type: entities
    entities:
      - entity: input_boolean.aussen_automatisierung
        name: Zeit
        icon: mdi:clock-time-three-outline
        show_header_toggle: false
        state_color: true
      - entity: input_boolean.aussen_automatisierung_lux
        icon: mdi:brightness-auto
        name: Helligkeit
        show_header_toggle: false
        state_color: true
      - entity: input_boolean.aussen_jeden_tag
        name: Tageweise
        show_header_toggle: false
        state_color: true
        tap_action:
          action: none
        card_mod:
          style:
            hui-generic-entity-row:
              ha-entity-toggle:
                $:
                  ha-switch:
                    $: >
                      {% if is_state('input_boolean.aussen_automatisierung_lux',
                      'off') and
                          is_state('input_boolean.aussen_automatisierung', 'off') %}
                         .mdc-switch .mdc-switch__thumb input {
                          pointer-events: none;
                        }
                      {%endif%}  
                    .: >
                      {% if is_state('input_boolean.aussen_automatisierung_lux',
                      'off') and
                          is_state('input_boolean.aussen_automatisierung', 'off') %}
                      ha-switch {
                        --switch-unchecked-button-color: var(--disabled-text-color);
                        --switch-checked-button-color: var(--disabled-text-color);
                      }

                      {%endif%}
                .: >
                  {% if is_state('input_boolean.aussen_automatisierung_lux',
                  'off') and
                        is_state('input_boolean.aussen_automatisierung', 'off') %}
                  :host {
                    color: var(--disabled-text-color);
                    --paper-item-icon-color: var(--disabled-text-color);
                  }

                  {%endif%}
    title: Schaltung nach
    show_header_toggle: false

It’s not pretty but it works, how i expected.

Thanks sparkydave, i will try you suggestion.

I think it is better to put {% xxx %} stuff INSIDE a style section:
zzzz {

}

I think and use the opposite. As Brainjay is doing (right, in my point of view) If false, why having empty css instead of no css. No is better in this case.

I only use it sometimes inside, if I have if and else.

1 Like

Hello.
I’ve been using the component for a long time, but I don’t know if it’s possible to keep the ‘press’ or ‘run’ (for scripts) button instead of the switch.

As now and as you wish…:
Снимок экрана (50)

And maybe yet someone knows how to add an icon next to the first one, according to some condition, to the place where the lock icon is (the lock icon will be moved to another location)… Rather, this question needs to be clarified in the “Card mod”.

Thanks.

Any way to use this with custom-card, so that you can change the buttons icon based on an entity state? E.g. I want the button to show a garage door closed or open.

reading this, and the subsequent replies, I can not understand why you wouldn’t simply hide the boolean, instead of disabling it with that cumbersome card_mod code?
you can do that with a conditional card on a intermediary binary, or group as sparky suggests.

Hiding it would be just that bit more concealed than disabling it… dont want to give prying eyes a reason to start looking for ways to enable

template:
  - binary_sensor:
      - unique_id: both_booleans_off
        name: Both booleans off
        state: >
          {{is_state('input_boolean.aussen_automatisierung_lux','off') and
            is_state('input_boolean.aussen_automatisierung', 'off')}}

and then in the card:

type: conditional
conditions:
  - entity: binary_sensor.both_booleans_off
    state: 'off'
row:
  - entity: input_boolean.aussen_jeden_tag
    name: Tageweise
    show_header_toggle: false
    state_color: true
    tap_action:
      action: none

@iantrich Great work! I use this for my DIY alarm system (no alarm control panel, just buttons)
image

1 Like

How do you edit the theme? All I’m trying to do is make the lock icon disappear. Zero pixels wide or something like that. I want the function of the lock but I don’t want to see it

Hi

I want to put a confirm on only when the plug is drawing over 20w.
If under then PC is already off, so no lock.

type: custom:hui-entities-card
entities:
  - card:
      entity: switch.office_pc
    restrictions:
      confirm: true
    condition:
      entity: sensor.office_pc_power
      attribute: raw_state
      value: 20
      operator: >
    type: custom:restriction-card
    row: true
title: Office


Doesn’t seem to work

Text

The operator tried both ways. It saves and removes the " then deletes it the next save.

Tried different indents.

    restrictions:
      confirm:
        condition:
          entity: sensor.office_pc
          attribute: current_consumption
          value: "20"
          operator: "<"

Is there any way to get a numeric keypad for the pin, kind of like the alarm panel cards?

3 Likes

I would also like to know this! Having an option to restrict the input to numeric only and result into a keypad for the PIN would be nice.

2 Likes

Yea, basically this card is useless on a tablet in kiosk mode… at least it is for me…

Is it possible to unlock it using pin and it will directly to the site? This code gives me when i insert the pin code, it will unlocked but i need to tap it once again to open the path.