A card to provide restrictions on Lovelace cards defined within.
Disclaimer
This card is not to be used as a means to truly protect an instance. Someone with the means and knowledge will be able to bypass the restrictions presented by this card should they choose to.
Conditional object to make restriction active. See Condition Options.
Exemption Options
Name
Type
Requirement
Description
user
string
Required
User id to exempt. This is found in the user profile ID .
Condition Options
Name
Type
Requirement
Description
value
string
Required
String representing the state.
entity
string
Required
Entity to use condition and is what also causes the card to update
attribute
string
Optional
Attribute of the entity to use instead of the state.
operator
string
Optional
Operator to use in the comparison. Can be == , <= , < , >= , > , != , or regex . Default is == .
Theme Variables
The following variables are available and can be set in your theme to change the appearance of the lock. Can be specified by color name, hexadecimal, rgb, rgba, hsl, hsla, basically anything supported by CSS.
name
Default
Description
restriction-regular-lock-color
primary-text-color
Lock color
restriction-success-lock-color
primary-color
Lock color when unlocked
restriction-blocked-lock-color
error-state-color
Lock color when card is blocked
restriction-invalid--color
error-state-color
Lock color after an invalid attempt to unlock
restriction-lock-margin-left
0px
Manually bump the left margin of the lock icon
restriction-lock-row-margin-left
24px
Manually bump the left margin of the lock icon in rows
I am having trouble figuring out how to implement this card as I get the error āno card type foundā when trying to add it via the GUI using the below test code.
Thatās what I tried to followā¦ I thought the card type was custom:restriction-card. What is the custom:hui-toggle-entity-row. Do I need to add that as another custom card? I was under the impression you were just nesting custom cards. The readme doesnāt mention adding the custom:hui-toggle-entity-row card, it just uses it
Is that top one meant to be ācustom:restriction-cardā? To me the example in the repo seems to have the lines jumbled up and is a bit confusingā¦ not to mention this custom:hui-entities-card that I had never heard of before
well Iām using the custom-template-card but in your case yes. I just posted that as an example of how one of Ians other cards worksā¦
the custom-hui-entities card is just the standard entities card but when itās wrapped in the other card you have to give itās full name.
I think the repo instructions need to include this valuable infoā¦
Anyway, I managed to play around with things and got it workingā¦ almost how I want. However the switch toggle is now completely missing and I was hoping to still see it, just not be able to activate it. (it gets controlled via automations so I really just want to be able to view the current status)
The original is on the left, restricted on the right, which has no switch toggle anymoreā¦ is there a way to still show the toggle? I have tried all optionsā¦
Your switch is not in the cover domain, so it wonāt show cover controls. Last night I added logic so that you no longer have to give the full element name for cards, and plan to do the same for rows soon. For now, instead of type: "custom:hui-cover-entity-row"
try type: "custom:hui-toggle-entity-row"
Typically you donāt have the fold row as your top-level element. Inside that youāve nested two entities cards. I donāt think you want to do that, right? Try this