All Projects → iantrich → Restriction Card

iantrich / Restriction Card

Licence: mit
🔒 Apply restrictions to Lovelace cards

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Restriction Card

Hadotnet
🏡 A .NET Standard library for Home Assistant.
Stars: ✭ 52 (-27.78%)
Mutual labels:  home-assistant
Forked Daapd Card
forked daapd card for Home Assistant Lovelace UI
Stars: ✭ 60 (-16.67%)
Mutual labels:  home-assistant
Home Assistant Macbook Touch Bar
Displaying Home Assistant sensors in the Macbook Pro's touch bar using BTT 🤖💻
Stars: ✭ 64 (-11.11%)
Mutual labels:  home-assistant
Homeautomation.codesys3
Home Automation system build in CoDeSys 3 with MQTT communication to any third party Home Automation software
Stars: ✭ 55 (-23.61%)
Mutual labels:  home-assistant
Addon Adb
Android Debug Bridge - Home Assistant Community Add-ons
Stars: ✭ 58 (-19.44%)
Mutual labels:  home-assistant
Scenegen
🎆 Generate Scenes for Home Assistant
Stars: ✭ 60 (-16.67%)
Mutual labels:  home-assistant
Home Assistant Config
🏠 My Home Assistant configuration, a bit different that others :) Be sure to 🌟 this repository for updates!
Stars: ✭ 1,050 (+1358.33%)
Mutual labels:  home-assistant
Streamdeck Homeassistant
🏠 Use the Elgato Stream Deck as Home Assistant controller. Call any available service and toggle lights or resume your music.
Stars: ✭ 69 (-4.17%)
Mutual labels:  home-assistant
Netdaemon
An application daemon for Home Assistant written in .NET 5.0
Stars: ✭ 56 (-22.22%)
Mutual labels:  home-assistant
Lovelace Time Picker Card
🕰️ Time Picker Card for Home Assistant's Lovelace UI
Stars: ✭ 63 (-12.5%)
Mutual labels:  home-assistant
Addon Zwave2mqtt
Z-Wave to MQTT - Home Assistant Community Add-ons
Stars: ✭ 58 (-19.44%)
Mutual labels:  home-assistant
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-19.44%)
Mutual labels:  home-assistant
Addon Ide
IDE - Home Assistant Community Add-ons
Stars: ✭ 61 (-15.28%)
Mutual labels:  home-assistant
Esphome Config
My ESPHome configuration files for my ESP8266 / ESP32 plugs and boards for use with Home Assistant.
Stars: ✭ 53 (-26.39%)
Mutual labels:  home-assistant
Homeassistant Config
My personal Home Assistant config
Stars: ✭ 66 (-8.33%)
Mutual labels:  home-assistant
Home Assistant Z Wave Graph
Graph your Z-Wave mesh automatically from within Home Assistant.
Stars: ✭ 51 (-29.17%)
Mutual labels:  home-assistant
Addon Spotify Connect
Spotify Connect - Home Assistant Community Add-ons
Stars: ✭ 60 (-16.67%)
Mutual labels:  home-assistant
Node Red Contrib Home Assistant
Home Assistant + Node-Red
Stars: ✭ 71 (-1.39%)
Mutual labels:  home-assistant
Hass Amazon Rekognition
Home Assistant Object detection with Amazon Rekognition
Stars: ✭ 68 (-5.56%)
Mutual labels:  home-assistant
Home Assistant Config
Home Assistant Configuration & Documentation for my Smart House.
Stars: ✭ 1,115 (+1448.61%)
Mutual labels:  home-assistant

🔒 Restriction Card

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.

GitHub Release License hacs_badge

Project Maintenance GitHub Activity

Discord Community Forum

Minimum Home Assistant Version

Home Assistant version 0.110.0 or higher is required as of release 1.2.0 of restriction-card

Support

Hey dude! Help me out for a couple of 🍻 or a ☕️!

coffee

Installation

Use HACS or follow this guide

resources:
  url: /local/restriction-card.js
  type: module

Options

Name Type Requirement Description
type string Required custom:restriction-card
card map Required Card to render within restriction-card.
restrictions map Optional Additional restrictions. See Restrictions Options.
exemptions list Optional List of exemption objects. See Exemption Options.
condition map Optional Conditional object to make lock active. See Condition Options.
row boolean Optional Set to true to give a default margin:left: 24px
duration number Optional Duration of unlock in seconds. Default is 5
action string Optional Action type to trigger the unlock. Options are tap, double_tap, or hold. Default is tap
locked_icon string Optional Icon to show when locked. Default is mdi:lock-outline
unlocked_icon string Optional Icon to show when unlocked instead of fading the icon away

Restrictions Options

Name Type Requirement Description
confirm map Optional Confirmation unlock restriction. See Confirm Options.
pin map Optional Pin code restriction. See Pin Options.
block map Optional Block interaction restriction. See Block Options.
hide map Optional Hide card restriction. See Hide Options..

Confirm Options

Name Type Requirement Description
text string Optional Text to display in confirmation dialog
exemptions list Optional List of exemption objects. See Exemption Options.
condition map Optional Conditional object to make restriction active. See Condition Options.

Pin Options

Name Type Requirement Description
code string Required Pin code the user needs to enter to unlock
text string Optional Text to display in prompt dialog
exemptions list Optional List of exemption objects. See Exemption Options.
condition map Optional Conditional object to make restriction active. See Condition Options.
retry_delay number Optional Number of seconds that you want to delay next attempt to unlock. Default is 0
max_retries number Optional Number of consecutive invalid retries allowed before blocking for the max_retries_delay seconds. Default is unlimited
max_retries_delay number Optional Number of seconds to block attempts to unlock after the max_retries has been reached

Block Options

Name Type Requirement Description
text string Optional Text to display in alert
exemptions list Optional List of exemption objects. See Exemption Options.
condition map Optional Conditional object to make restriction active. See Condition Options.

Hide Options

Name Type Requirement Description
exemptions list Optional List of exemption objects. See Exemption Options.
condition map Optional 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
restriction-lock-icon-size 24px Lock icon size
restriction-lock-opacity 0.5 Lock icon opacity

Example Configurations

Simple Lock example

lock

type: custom:restriction-card
card:
  type: thermostat
  entity: climate.house

More complex example

complex

type: custom:restriction-card
restrictions:
  confirm:
    exemptions:
      - user: adminid
  pin:
    code: 1234
    exemptions:
      - user: wifeid
      - user: adminid
  block:
    exemptions:
      - user: guestid
      - user: wifeid
      - user: adminid
exemptions:
  - user: ianid
card:
  type: thermostat
  entity: climate.house

Row example

row

type: 'custom:hui-entities-card'
entities:
  - card:
      entity: cover.garage_door
    restrictions:
      block: true
    type: 'custom:restriction-card'
    row: true
  - entity: light.kitchen

Troubleshooting

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].