Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The unlatch action should be available also when the lock is locked #876

Open
2 tasks done
alexdelprete opened this issue Nov 29, 2022 · 10 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@alexdelprete
Copy link

alexdelprete commented Nov 29, 2022

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

The Lock Card should show the Open button (unlatch action) based on the supported_features attribute of the lock, but since I migrated to Mushroom, I don't always see the second button on the card, it appears only when the lock is unlocked.

I'll show 2 screenshots where you can see the card with only 1 button and with the 2nd (I updated the template in one of them but the Lock Card is the same), the lock device is the same (Nuki). You can also see the attribute of the lock: supported_features: 1.

image
image

Expected Behavior

No response

Steps To Reproduce

No response

Context

image

Environment

- Browser: Chrome
- Home Assistant 2022.11.4 / Frontend 20221108.0
- Mushroom: v2.4.1

Anything else?

No response

@alexdelprete alexdelprete added the bug Something isn't working label Nov 29, 2022
@alexdelprete
Copy link
Author

alexdelprete commented Nov 29, 2022

Ok, now I understood the logic: when the door is locked, you only see the unlock button, not the unlatch one. When it's closed and unlocked, you see both action buttons.

I think this logic is not the best, because unlatch actually implies unlock, so you should be able to unlatch also when the door is locked. That's how it works at the API level with Nuki locks for example: you can unlatch in both unlocked/locked states, unlatch basically means do an extra half-turn of the knob after the unlock, to physically open the door.

So I don't know if this was intentional or not (if it is, this is not a bug), but I would ask if this kind of behavior could be configured via an option of the Lock Card. I also saw in another issue that someone would like the unlatch button to be optionally off.

Thanks.

@piitaya
Copy link
Owner

piitaya commented Dec 21, 2022

Oh you can open when it's locked ? You don't have to unlock before open? What integration do you use ?

@alexdelprete
Copy link
Author

alexdelprete commented Dec 21, 2022

Oh you can open when it's locked ?

There are two possible actions: unlock and open (unlatch)

Basically the difference between unlock and open actions is that the latter does a half turn more to open the door. :)

What integration do you use ?

I use a Nuki lock.

UPDATE: I updated the title and the description of the issue.

@alexdelprete alexdelprete changed the title [Bug]: Inconsistent behaviour of Lock card: the Open button shows randomly [Bug]: The unlatch action should be available also when the lock is locked Dec 21, 2022
@Lyr3x
Copy link

Lyr3x commented Feb 10, 2023

When using e.g the Nuki Opener with the nukihub integration, the lock entity uses the lock/unlock mechanism to configure ring to open. The lock.open service can always be used to really open the door, so its quite unhandy that the open action is hidden.
Could it be an option to add an attribute, to change the behavior? Right now I need to activate ring to open to open the front door (which is technically not required).

@alexdelprete
Copy link
Author

its quite unhandy that the open action is hidden

That is also true for HA default behaviour when exposing the lock entity in lovelace, the lock.open service is not exposed in the UI, only lock.lock and lock.unlock are.

Problem is that many think that if the lock is locked, the only possible action is lock.unlock but that's not true, you can do lock.open when the state is locked.

I hope at least with mushroom this can be corrected.

@thor9898
Copy link

thor9898 commented Mar 11, 2023

I also think there should be an option for the unlatch button to not show up when the door is unlocked, or at least a way to get a confirmation message.
For security reasons I have my card setted up in such a way that if I tap on the card it call service lock.open but with a confirmation message, even with this I'm still always a bit afraid of misclicking the unlatch button when i'm out.

This is my card code:

type: custom:mushroom-lock-card
entity: lock.nuki
layout: vertical
fill_container: true
name: Puerta
tap_action:
  action: call-service
  service: lock.open
  target:
    device_id: b460a03dacba9254c4d9189feffe8219
  data: {}
  confirmation:
    text: ¿Abrir la puerta?

@alexdelprete
Copy link
Author

@piitaya Paul, will this be corrected?

@calielc
Copy link

calielc commented Jun 11, 2023

Any upgrade on this matter?
I'm facing the same problem when using Nuki.
Since the open/unlatch button only shows when the door is unlocked, I need to:

  • press the unlock button
  • wait a couple of seconds until nuki/hass sync the state
  • wait for the refresh of the card to show the Lock and Open buttons
  • click into Open.

I pretty sure we have to options:

  1. always show the open/latch button (when supported)
  2. have an property on the configuration to always show the button

I really like the suggestion from @thor9898 to ask for a confirmation before open it, it avoids the mistake to wide open it when im not at home

@fjfricke
Copy link

fjfricke commented Feb 22, 2024

Probably a bit too simple (no config entry and no confirmation before opening) but here is a one-line change to always show "open" even when locked (for the ones who can't wait for a proper change):
https://github.com/fjfricke/lovelace-mushroom

@alexdelprete
Copy link
Author

Probably a bit too simple

Did you submit a PR? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants