SwitchBot Cloud: Lock Pro reports "locked" after lock.open (deadbolt): webhook sends LOCKED for latchBoltLocked, and the poll maps it to locked too
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:
The status API distinguishes the two states, but HA collapses them. After
deadboltthe status API returnslatchBoltLocked, and afterlockit returnslocked.lock.pyputsLATCH_BOLT_LOCKED(andHALF_LOCKED) intoLOCKED_STATES("A latch bolt or half locked door is secured"), so both end up aslocked. For a Lock Pro,latchBoltLockedis exactly the result of HA's ownopenaction. The deadbolt is retracted and the door opens by its handle, so reporting it aslockedis misleading.The webhook does not distinguish the two states at all. The final webhook after
deadbolthaslockState: 'LOCKED', the same value as after a reallock. Once a webhook has arrived, the coordinator setsupdate_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
lockedafter the morninglock.open. - Every time the door is opened by handle, the webhook reports
UNLOCKEDand thenLOCKED2–5 s later. The history shows these pairs all day (about 125 state changes in 7 days). - The raw
lockStateis 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
latchBoltLockedto unlocked, or at least expose the raw cloudlockStateas 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
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 lockedAnything in the logs that might be useful for us?
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.
Source: home-assistant/core