Because there is no visual editor available for this custom card, as per the first words of the error messageā¦
Itās nothing to worry about, as per the last words of the error message
Because there is no visual editor available for this custom card, as per the first words of the error messageā¦
Itās nothing to worry about, as per the last words of the error message
possible to lock a switch in a glance card?
this here dont work
type: glance
title: Schlafzimmer
entities:
- entity: switch.on_off_plug_in_unit_4
type: 'custom:restriction-card'
row: true
name: Licht
icon: 'mdi:lightbulb'
tap_action:
action: toggle
state_color: true
show_icon: true
show_name: true
show_state: true
trying to 'restrict my garage door, as per suggestion of Thomas, I started with the core row on an entity cover:
- type: entities
entities:
- type: custom:restriction-card
row: true
condition:
entity: cover.garage_deur
value: closed
restrictions:
confirm:
text: 'Garagedeur openen?'
pin:
text: 'Voer Pincode in:'
code: !secret tahoma_secret
max_retries: 3
max_retries_delay: 30
card:
entity: cover.garage_deur
secondary_info: last_changed
however, just to be sure, please let me ask: this makes the pin text appear first, and, after successfully entering the code, makes the confirm text appear. Which is the other way round from what I expected
is this as per design, or did I make a user error?
in the repo, thereās an āInvalid pin enteredā dialogue video, but no instruction how to do thatā¦ Would anyone know which confirmation text that is? Right now, with the above code, simply nothing happens except for the icon to flash.
the last_changed isnt displayed on the entity. Since there is plenty space, that canāt be it. Does the lock overlay prevent displaying secondary_info
? Would be really appreciated if this could be done.
Though I realize we can set the position of the icon in a theme, and I do use the relative setting to do so, I need the lock to be on a different spot using the cover, than when using eg a single toggle.
Would it be possible to do so?
thanks for having a look.
btw, I also added the restriction on a core entity card, but that seems futile, because clicking that simply opens the more-info, where the lock is not displayed?
thanks for having a look.
however, just to be sure, please let me ask: this makes the pin text appear first, and, after successfully entering the code, makes the confirm text appear. Which is the other way round from what I expected
The design is to use one restriction. The example is just for show. Sounds pretty unfriendly to put so many clicks in the way. The the order is what it is, I have no intention of changing it.
in the repo, thereās an āInvalid pin enteredā dialogue video, but no instruction how to do thatā¦ Would anyone know which confirmation text that is? Right now, with the above code, simply nothing happens except for the icon to flash.
That was removed
the last_changed isnt displayed on the entity. Since there is plenty space, that canāt be it. Does the lock overlay prevent displaying
secondary_info
? Would be really appreciated if this could be done.
No, it doesnāt. You are not using the correct option; last-changed
Though I realize we can set the position of the icon in a theme, and I do use the relative setting to do so, I need the lock to be on a different spot using the cover, than when using eg a single toggle.
I will not be changing it
btw, I also added the restriction on a core entity card, but that seems futile, because clicking that simply opens the more-info, where the lock is not displayed?
Iām not following what youāre saying here
yes! thank you for spotting thatā¦
I tried the lock on
- type: entity
entity: cover.garage_deur
but it didnt work, probably because of a wrong config, didnt see an error though, just the more info clicking the entity. Using:
- type: custom:restriction-card
<<: *restrict
card:
type: entity
entity: cover.garage_deur
now makes it happen.
was only asking, so cool, not an issue at all. thanks for your time and effort replying in such short notice!
Good day!
Started testing this card.
Questions:
"restrictions::hide"
.type: vertical-stack
cards:
- type: entities
entities:
- entity: sun.sun
- type: 'custom:restriction-card'
restrictions:
hide:
condition:
entity: input_boolean.test_boolean_4
operator: ==
value: 'on'
action: hold
row: true
card:
entity: sun.sun
- type: 'custom:restriction-card'
action: hold
duration: 10
row: true
card:
entity: sun.sun
- type: entities
entities:
- entity: input_boolean.test_boolean_4
name: hide
There are 3 entity rows:
"hide"
option;
If the toggle button ("input_boolean.test_boolean_4"
) is ON then the 2nd row is supposed to be hidden.
But it happens only after manual refresh (F5):
Is it a bug?
"pin: !secret my_pin"
(no success).Of course, there is a walkaround - we can create a "decluttering-card"
template for this:
decl_restriction_card_row:
default:
- VALUE_ROW: false
card:
type: 'custom:restriction-card'
restrictions:
pin:
code: 1234
text: ŠŠ²ŠµŠ“ŠøŃŠµ PIN Š“Š»Ń ŃŠ°Š·Š±Š»Š¾ŠŗŠøŃŠ¾Š²ŠŗŠø
retry_delay: 3
max_retries: 3
max_retries_delay: 10
action: hold
duration: 10
row: '[[VALUE_ROW]]'
card: '[[CARD_OR_ROW]]'
The idea is to define a restriction-card with required settings (presumably same settings for all HA views) in ONE place (with specified pin & user id data) and then use this template in all views.
How to use the template for a row:
type: entities
entities:
- type: 'custom:decluttering-card'
template: decl_restriction_card_row
variables:
- VALUE_ROW: true
- CARD_OR_ROW:
entity: sun.sun
How to use the template for a card:
type: 'custom:decluttering-card'
template: decl_restriction_card_row
variables:
- CARD_OR_ROW:
type: entities
entities:
- entity: input_boolean.test_boolean
Hello Ian, thank you very much for your card and a quick reply!
Great that you found a reason of that behaviour. Looking forward for an update, will test it when released. Probably this āhideā option could be useful.
Every time I start learning a new card, I am usually trying to test it with some test cases (may find some new issues).
Regarding PIN - basically this is not about a privacy (āsomeone can steal my PIN !!!ā), this is about reducing a code (ādefine it in one place, call it from many placesā).
So I will proceed (and recommend it to other people) with decluttering-card. Together these two cards will help a lot.
How do change the placement of the lock, or what color it has?
I have this code:
type: custom:restriction-card
restrictions:
confirm:
text: Sikker??
card:
type: entities
entities:
- switch.05301030f4cfa2341de5
state_color: true
And it looks like this:
But no matter where I put lines like:
restriction-regular-lock-color
or
restriction-lock-margin-left
Nothing seems to change.
So what am I doing wrong?
Thanks.
Iām assuming this is an answer to me.
And yes, this is the question.
I donāt understand where to put / configure the Theme Variables.
I havenāt found one example that can tell me this.
Thanks for answering, but these are not really answers at all.
First, I have never heard of themes before, and therefore I had no configuration for it.
And how is it logical to assume that configuration that applies to this specific card only goes into a global configuration file?
It is ok not to answer questions. Better that, than to āanswerā questions.
I had a feeling that you may not be aware of themes after you ignored the first link I made to help you that linked to this (emphasis mine):
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.
So I linked to the Home Assistant themes document for you. Where you could read all about them.
Apologies if that was not clear enough for you.
Since you apparently have a card like this configured, why donāt you just copy / paste a few lines from that config, and this would have been answered a long time ago.
Thanks.
Because as I said many times already it does not go in the card, it goes in your theme. And as my theme makes extensive use of card mod it would just be confusing. But sure, here you go: Day and Night - #29 by tom_l
I just discovered by accident that this card seems to have a bug. If I hover my mouse slightly above the locked entity switch I get control.
Has anyone else noticed this?
Yeah I see that too. If you get it just on the edge of the touch radius:
HereĀ“s the issue you created