which is perfect for my needs. However, click/holding it doesnt show the more-info. It does show the blue circle, bt when releasing the mouse the lock disappears, as if I simply clicked it.
filed a feature request for adding a lock (permanent-not switchable) and to differentiate that from the current (allow-)lock.
would appreciate feedback to maybe find other solutions to the goal Id like to accomplish: having a button for a switch entity, and not allow it to switch at all (so not the current lock: true which still offers 5 seconds of opportunity)
you can achieve exactly what you want by putting an unknown name in unlock_users array. If the user is unknown from HA, no-one will ever be able to unlock it.
I have an Aqara motion sensor that also has a temperature sensor. I want to use that sensor on a another card.
I can’t see what I’m doing wrong with this card and I’m soon getting bonkers.
I’d go for an input_boolean as the switch, and a state template to show the state. The button wil now correctly show the state (you might consider templating color as well) but the button will do nothing (just like a permanent lock would do).
You could also do a tap_action: none for example or a service-call to do something else. This way you wouldn’t need the input boolean.
Not the most beautiful solution but it works for me. For example I have servers in HA as switches which should never ever be turned of. Pressing the button does nothing but show a more-info window.
Edit: lol I should have read up this was already answered
tbh, I think a switch needs to be able to be a switch… lots of hacks possible, but thats what makes it all too complex all over.
I probably will endup not using lock: true, set a dedicated icon lock-alert, and have tap action show more info…
o wait, that can’t be, I need the lock-alert to be the lock icon, not the entity icon…
feature request holds…
tap_action and hold_action don’t work as configured
Lock is the same for hold and tap and double tap. There’s no way to differentiate it.
You have to see it as an overlay that captures all your clicks until it’s unlocked.
If you want to display a lock icon just use a custom field and put the tap_action to none while keeping the hold action to more info.
I don’t quite understand your use case honestly
BTW, putting icon: mdi:something in the styles of the lock will not do anything, it’s not valid css.
You’re not using the latest version of button card. label_template doesn’t exist anymore, it’s just label now. Plus the template would be "[[[ return entity.attributes.temperature + ' °C' ]]]"
I don’t need to differentiate it for these actions, I need it to be different than the default lock icon. Can’t that be done styling the lock, just as we can set the color?
so I understand correctly with unlock_users: unknown, the lock will never be unlocked, and no action at all is possible?
That will be my first custom field, will have to check the docs how to create this overlay, with the lock-alert icon.
well, I want it to be visually different from the regular locks (since the behavior is different), so need another lock icon.
I do want to be able to use a more-info, probably of the locked switch, maybe even use another entity. for now, simply the locked switch as more info, on both tap and hold to be sure.
I noticed that since I now need to use it in a custom-field, I must check the docs for setting a custom icon here. don’t suppose you could assist me, please?
Ah true, the problem with that is that it will not update automatically because your entity will not change over time and the display will not update, that’s why we have a specific show_last_changed option.
Your code should just work in button-card by replacing attributes.last_triggered with entity.attributes.last_triggered but again, it will not update properly