Lovelace Restriction Card - Client-side Security

Please read this. Especially as I have nothing to do with the development of this frontend resource.

Hi there,
First thanks for this feature, i use it to confirm my gate oppening, i dont want to open the main gate by missclick, this feature saves my smart house big time.
I need little help though, can i change the after confirmation time to interact with some entity?

Now after i press the confirmation dialog i have 3seconds time to interact even though i have not clicked the switch, i want to be able to interact with the switch at least 1min, because i use the same switch to open/stop/close the main gate.

Thanks

If you just want to prevent miss-clicks you can use the core tap action confirmation.

https://www.home-assistant.io/dashboards/actions/#confirmation

Screenshot 2023-03-17 at 09-06-59 Actions

My sincere apologies for tagging you! This was literally my first post ever in HA forums and thank you for setting me straight! :slight_smile:

Hi there, thanks for the amazing card.
I read the thread but honestly couldnā€™t make this work with only those information

Is it possible to have the lock icon on the right side of the card? I would like it in the empty space left by the title
image

type: custom:restriction-card
duration: 10
action: hold
card:
  square: false
  columns: 1
  type: grid
  cards:
    - type: custom:mushroom-title-card
      title: Chiavi
....

Any help is appreciated, thank you!

Itā€™s a global setting in your theme. restriction-lock-margin-left

https://github.com/iantrich/restriction-card#theme-variables

Thank you, I never used themes so I had to read something in the documentation, but your post pointed me in the right direction.

For anyone trying to achieve this whth no experience with themes, you have to put this string in your config.yaml file:

frontend:
  themes:
    Lock:
      restriction-lock-margin-left: 95%

And you need to select the new created theme ā€œLockā€ on each dashboard that needs to have the lock on the right side

has anyone found an alternative to this card? since 2023.5 it has some display issues: locks shown past dashboard limits when scrolling, multiple locks displayed over the ā€œmore infoā€ pop-up. an issue was open on github about the upgrade following polymer deprecation, but the project looks more or less abandoned.

on the Lock, depending on your card, you need to set the z-index.
eg, using custom:button-card, you can do:

  styles:
    lock:
      - color: red
      - icon: mdi:lock-alert
      - z-index: 1

this has been the case for some time, and has become even more of a requirement with latest HA Frontend, where I believe a setting below or beyond 7 is necessary.

restriction card requires a mod-card (because it has no ha-card element):

card:
  type: custom:mod-card
  card_mod:
    style: |
      ha-card {
        z-index: 1;
        }
  card:
    type: custom:restriction-card
1 Like

I have this configuration of the Restriction Card which is working great by the way, but there are a few issues with it, visually speaking. I have a dashboard view with a single alarm panel card, set to Panel view. Once I added it to the Restriction Card its height got smaller, it didnā€™t fit the dashboard view anymore. Any suggestions? Also the text to show when locked option doesnā€™t show up when locked.

type: custom:restriction-card
restrictions:
  block: true
  text: xxxxxxxxxxx
condition:
  entity: input_boolean.alarm_helper_switch
  value: 'on'
card:
  type: alarm-panel
  states:
    - arm_home
    - arm_away
    - arm_night
  entity: alarm_control_panel.gc131_alarm

Anyone willing to help with this issue? Theme showing lock icon under pop-up window Ā· Issue #86 Ā· iantrich/restriction-card Ā· GitHub
It seems that @iantrich is not available anymore.

This options should be implemented into HA nativelyā€¦

It would be nice, but there isnā€™t anything similar there AFAIKā€¦

I do not recommend updating to 1.2.8.
(unless you use the card with ā€œrow: trueā€)

1 Like

Same, it stopped working on my card after the update. I think Iā€™ll downgrade, the pop-up problem didnā€™t bother me so much because I only have one lock in the dashboard and I reduced its size

This card is so useful. Is it still supported?

The latest update was two weeks ago, so yes. However the developer has said, regarding the current non-functioning state:

If someone can submit a PR, Iā€™ll get it merged in, but I donā€™t have the capacity to work on this myself at the moment.

I have lots of issues with getting restrictions to work.
This is just one example:

type: custom:restriction-card
restrictions:
  pin:
    code: 9999
condition:
  entity: alarm_control_panel.security_state
  operator: '!='
  value: disarmed
card:
  type: custom:mushroom-template-card
  primary: Access blocked
  secondary: Tap to enter pin
  icon: mdi:shield-off
  tap_action:
    action: navigate
    navigation_path: /path/to/unlocked/panel

No locking icon shown and access to card interaction seems to be unlimited.
Same thing if I remove the whole ā€œconditionā€ section.
The only card I had a slight success with was a row-based card.

The latest version is broken.

My fault. I did notice what this thread said about the version. Then tried to downgrade to 1.2.7 bu apparently I did something wrong and was still on 1.2.8. Iā€™m now on 1.2.7 and it seems to work fine.

2 Likes