home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.06k stars 29.13k forks source link

Switchbot Lock Pro: Lock/unlock/open issue #121165

Open Chris-126 opened 2 weeks ago

Chris-126 commented 2 weeks ago

The problem

Finally with HA 2024.7 my Switchbot Lock Pro apeared as bluetooth device. As the already available matter integration does only support lock/unlock feature and does not provide any more information (like battery status etc.) I was looking forward to try the bluetooth based integration. As expected there are more entities provided which helps me to keep track of i.e. the battery level.

However, the switchbot app allows to lock the door and to unlock or open if the doors has a door latch. I would like to have the option to simply unlock the door instead of opening it, to implement an automation for overnight locking/unlocking.

Currently the lock.unlock service and the provided buttons in the matter and bluetooth based integration both would open the door completly. I don't want my door being opened automatically ;)

So, I actually remember watching a video related to "Switchbot Lock" which had the option available (Home Assistant bluetooth integration). So, how can I have/activate this for the Switchbot Lock Pro, too?

Ah, one thing might be involved... I cannot use the door closed sensor, as the magnet cannot be applied within range. The door frame is too far away. I don't know, if this is affecting the unlock/open feature. It does not in the Switchbot App, I can use open/unlock as expected.

Also, there service lock.lock and lock.unlock is available for this device but lock.open is not.

Thanks in advance for your replies and evaluations! Best regards Christian

What version of Home Assistant Core has the issue?

core-2024.7.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SwitchBot

Link to integration documentation on our website

https://www.home-assistant.io/integrations/switchbot

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Nothing

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @danielhiversen, @renierm26, @murtas, @eloston, @dsypniewski, mind taking a look at this issue as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `switchbot` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign switchbot` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


switchbot documentation switchbot source (message by IssueLinks)

varyamereon commented 2 weeks ago

@Chris-126 This should have been included as part of the addition, maybe take a look at this issue in the pySwitchbot repo?

wunderbaum commented 2 weeks ago

Hello, since this morning, my lock pro appeared, too. Thanks to everybody that made that happen! Great work! I have three states and can address them:

service: lock.unlock
service: lock.open
service: lock.lock

Here a complete yaml for a 4x-tuya-switch:

alias: Haustür öffnen
description: 
trigger:
  - platform: device
    domain: mqtt
    device_id: xyz
    type: action
    subtype: 1_single
condition: []
action:
  - service: lock.open
    metadata: {}
    data: {}
    target:
      device_id: xyz
mode: single
bepeit01 commented 2 weeks ago

Hi everyone, I also had the issue that the Integration opened the door instead of unlocking. By checking the logs i saw that the mdata had the latch marked as false. Only after rebooting the Lock it reported a true and now unlocking and opening works AS expected. So this could as Well be a Firmware issue...

andys73 commented 1 week ago

what I see it is a status not being reported back to HA when you manually press the lock pro button. But is not all the time, is sporatic.

andys73 commented 6 days ago

see how it behaves when you lock it unlock it via button... in both switchbot and HA

https://github.com/user-attachments/assets/d0890991-efd0-49fc-82ed-cc7a42a4c0e7