Love-Lock-Card → A custom lovelace card to lock entire cards with a password or toggle

Hi everyone,

Yesterday I posted this and it seems a few people were interested so I’m releasing my first beta version of the card.

This is a custom lovelace card to lock entire cards and works exactly like vertical-stack-in-card, except you can specify a lock type. Password, Confirm, or Timeout lock.

Use case I’d imagine would be to stop children messing with the thermostat, or flatemates turning off and on things that shouldn’t be.

This is my first contribution to Home Assistant. I have no knowledge of Python and I’ve been scratching my head trying to understand Polymer but I did my best to provide a simple front-end quick lock.

Feedback is welcome, pull requests welcome.
Let me know if you experience bugs, this is beta.

Github here

8 Likes

This is a fantastic card thank you ver much it works really well.

If you can add a option to set the timeout of the lock it needs to be a bit longer.
something like ‘option_timeout: 20’ secs.

Well done on your first card and hopefully many more to come.

1 Like

Thank you @cameron. That is def something I’d like to do, will also look at getting it working with Hacs.

It already works https://i.ibb.co/TRtssxM/image.png :wink:

1 Like

Nice card! I’ve found good use for it :blush: However I found an issue. When I have a input-select in an entity card above the love-lock-card and the box with choices is drawn over the love-lock-card, I can’t pick any of the choices that are shown over the love-lock-card. Only after unlocking the card, I can choose the lowest choices. Hopefully you can fix that!

Hi @wummeke, could you provide a screenshot of your layout? I’m having trouble understanding what you mean. The love-lock-card should only cover the card you specify. So all entities within that card wouldn’t work unless you unlock it.

Everything below “Badezimmer putzen” can’t be picked as long as the love-lock-card is locked.

1 Like

27

title: Home
# Include external resources
resources:
  - url: /local/slider-entity-row.js
    type: js
  - url: /local/love-lock-card.js 
    type: js
  - url: /local/my-webfont.css
    type: css

# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
background: center / cover no-repeat url("/background.png") fixed

views:
    # View tab title.
  - badges: []
    cards:
      - entity: media_player.onkyo_receivery
        type: media-control
      - entity: media_player.samsung_tv_remote
        type: media-control
      - entity: light.stue_lys
        type: custom:love-lock-card
        popup: password
        password: 1234
        name: Lounge Lamp
    path: media
    title: Media

Could you try this:

type: 'custom:love-lock-card'
    title: Lounge
    cards:
      - entities:
          - entity: light.stue_lys
            name: Lounge Lamp
            type: entities
        type: entities
    password: '1234'
    popup: password

while parsing a block mapping in “/config/ui-lovelace.yaml”, line 1, column 1 expected , but found ‘’ in “/config/ui-lovelace.yaml”, line 289, column 5

title: Home
# Include external resources
resources:
  - url: /local/slider-entity-row.js
    type: js
  - url: /local/love-lock-card.js 
    type: js
  - url: /local/my-webfont.css
    type: css

# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
background: center / cover no-repeat url("/background.png") fixed

views:
    # View tab title.
  - badges: []
    cards:
      - entity: media_player.onkyo_receivery
        type: media-control
      - entity: media_player.samsung_tv_remote
        type: media-control
type: 'custom:love-lock-card'
    title: Lounge
    cards:
      - entities:
          - entity: light.stue_lys
            name: Lounge Lamp
            type: entities
        type: entities
    password: '1234'
    popup: password
    path: media
    title: Media

After download love-lock-card.js got following error in log:

ERROR (MainThread) [frontend.js.latest.201907211] http://<IP>:<PORT>/local/love-lock-card.js:7:1 Uncaught SyntaxError: Unexpected token '<'

Does anyone know what I’m doing wrong?

@CyrisXD How can this be used for a switch?

hi love your mod but i cant seem to get it to work followed install instructions but no luck please can you tell me if this works with latest version of HA supervised do you have video how to install and use?thanks

Hi,

Can it be locked and unlocked depending on a condition, using an automation?

hi @CyrisXD is there any option for encrypted password (hash/salt) ?
or/and asterisk (hidden pass) during input ?

thanks