Hello,
i have a custom love-lock-card with this configuration:
type: custom:love-lock-card
title: Flur Unten (locked)
popup: password
password: 1234
cards:
- entity: light.flur_unten_licht
name: Flur Unten (Locked)
type: light
Is it possible to replace the password with a variable ?
something like:
password: !include pw.yaml
Hope this is not a dumb question, im a Newbie with HomeAssistant…
At the end it was great when the Password generate automatically every Day, something like STRING & Day * Month
Is it possible ?
By using secret only:
password: !secret glob_secret__pwd_for_xxx
The secret must be placed inside the basic secrets.yaml
file (basic
= not a secrets
file in some package).
Possible if:
- Either the
password
option of this card supports templates.
- Or the whole card is placed inside
custom:config-template-card
and then you provide a template for the password
option.
In the template mentioned above the password should be generated according to your intentions.
Alternatively - you may generate the password inside a dedicated template sensor and then use the sensor’s state for that templated password
option.
But - if the password is automatically generated (i.e. not constant) then you cannot address it as a secret (also, you cannot use templates in the secrets.yaml
file).
I suggest you to rename the topic to something like “How to specify a password inside a Lovelace card”.
Thanks for the help!
thats not working for me. Like i told, im a absolute HA Beginner ^^
I try it like that:
Addressing a secrets (as well as using !include
) works only in yaml mode of lovelace.
Now you are using a storage mode - i.e. adding dashboards & views & cards by UI.
You may combine these two modes: first create a prototype dashboard/view/card by UI (place any password temporarily), then after finalizing etc move the code into a corresponding yaml file (and address a secret).
Read docs & the forum about storage vs yaml modes.
Sorry but i have no idea what i have to do now

Do not get upset.
Start learning how to create lovelace dashboards/views/cards by UI (“lovelace storage mode”).
Use static passwords & pins etc in your cards.
Then start reading about “lovelace yaml mode”.
Check other people examples on Github - most people use “yaml-mode”.