#183517·core

SwitchBot Cloud: Lock Pro reports "locked" after lock.open (deadbolt): webhook sends LOCKED for latchBoltLocked, and the poll maps it to locked too

Author: cyborgx1986Created Sep 28, 2026Updated Sep 28, 2026
Labelsintegration: switchbot_cloud

The problem

With a SwitchBot Smart Lock Pro via switchbot_cloud, lock.open sends the cloud command deadbolt. This retracts only the deadbolt and leaves the latch bolt engaged, which is the "unlock only" behaviour, so the door can be opened by its handle. Afterwards the entity reports locked. It stays that way until the next real lock/unlock, although the SwitchBot app shows the lock as unlocked.

I captured both data paths with debug logging, running lock.open, waiting, update_entity, then lock.lock, waiting, update_entity (device IDs redacted):

# lock.open (deadbolt)
23:24:20.650 Received data from switchbot webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 72, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED',   'timeOfSample': 1790630660551}}
23:24:27.952 Received data from switchbot webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 72, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'UNLOCKED', 'timeOfSample': 1790630667845}}
23:24:29.735 Received data from switchbot webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 70, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED',   'timeOfSample': 1790630669631}}
# homeassistant.update_entity (status API)
23:24:35.563 Refreshing XXXX with {'version': 'V2.9', 'battery': 70, 'onlineStatus': 'online', 'lockState': 'latchBoltLocked', 'doorState': 'opened', 'calibrate': True, 'deviceType': 'Smart Lock Pro', ...}

# lock.lock
23:24:54.825 Received data from switchbot webhook: {... 'lockState': 'LOCKED', ...}
23:25:01.675 Received data from switchbot webhook: {... 'lockState': 'LOCKED', ...}
# homeassistant.update_entity (status API)
23:25:08.450 Refreshing XXXX with {... 'lockState': 'locked', ...}

So there are two independent problems:

  1. The status API distinguishes the two states, but HA collapses them. After deadbolt the status API returns latchBoltLocked, and after lock it returns locked. lock.py puts LATCH_BOLT_LOCKED (and HALF_LOCKED) into LOCKED_STATES ("A latch bolt or half locked door is secured"), so both end up as locked. For a Lock Pro, latchBoltLocked is exactly the result of HA's own open action. The deadbolt is retracted and the door opens by its handle, so reporting it as locked is misleading.

  2. The webhook does not distinguish the two states at all. The final webhook after deadbolt has lockState: 'LOCKED', the same value as after a real lock. Once a webhook has arrived, the coordinator sets update_interval = None, so the status API is never polled again, and a corrected mapping alone would not fix the entity. The webhook side is probably something SwitchBot has to fix. HA could still work around it, for example by requesting a status refresh after a lock webhook, or after lock commands.

Consequences:

  • The entity cannot be used as a condition. A nightly "lock if unlocked" automation never locked, because the entity already claimed locked after the morning lock.open.
  • Every time the door is opened by handle, the webhook reports UNLOCKED and then LOCKED 2–5 s later. The history shows these pairs all day (about 125 state changes in 7 days).
  • The raw lockState is not exposed as an attribute, so a template cannot tell the two states apart either.
  • Removing and re-adding the config entry does not change anything.

Suggested fix:

  • Map latchBoltLocked to unlocked, or at least expose the raw cloud lockState as an extra state attribute.
  • For locks, refresh from the status API after a webhook or command instead of relying on the ambiguous webhook lockState.

Related but different: #154467 (half locked shown as unlocked, switchbot BLE), #178177 (switchbot BLE, unlock retracts latch).

What version of Home Assistant Core has the issue?

core-2026.9.4

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 Cloud

Link to integration documentation on our website

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

Diagnostics information

switchbot_cloud does not provide a diagnostics platform. The debug log excerpt is in the problem description.

Example YAML snippet

yaml
actions:
  - action: lock.open   # sends "deadbolt" -> cloud state latchBoltLocked
    target:
      entity_id: lock.lock_pro_22
# entity: "unlocked" (optimistic) -> "locked" ~2 s later via webhook, and stays locked

Anything in the logs that might be useful for us?

txt
No errors or warnings. The debug output is in the problem description.

Additional information

Device: SwitchBot Smart Lock Pro, firmware V2.9, connected via Hub. Auto-lock is disabled on the device and the lock is calibrated. doorState is not reliable on this door (steel door) and can be ignored.