Skip to content

[Lock Pro] Webhook changeReport sends lockState "LOCKED" when the status API reports "latchBoltLocked" #513

Description

@cyborgx1986

Analysis

For a Smart Lock Pro (firmware V2.9, via Hub), the webhook changeReport and the status API (GET /v1.1/devices/{deviceId}/status) report different lock states for the same physical state.

After sending the deadbolt command, the deadbolt is retracted and the latch bolt stays engaged (the "unlock only" state, the door opens by handle):

  • The status API correctly returns lockState: "latchBoltLocked".
  • The webhook instead sends lockState: "LOCKED", the same value it sends after a real lock command.

So webhook consumers cannot tell "deadbolt retracted, latch engaged" apart from "fully locked". Integrations that rely on webhooks (e.g. Home Assistant switchbot_cloud, which stops polling once webhooks arrive) show the lock as locked all day, although the SwitchBot app shows it as unlocked. Automations that check the lock state then fail, e.g. a nightly "lock if unlocked" never runs.

Expected Behavior

The webhook lockState should match the status API. After deadbolt, the changeReport should contain "LATCH_BOLT_LOCKED" (or "latchBoltLocked"), not "LOCKED". It would also help if the webhook documentation listed all possible lockState values for Lock Pro / Lock Ultra, including latchBoltLocked and halfLocked.

Steps To Reproduce

  1. Smart Lock Pro in locked state, webhook configured (setupWebhook).
  2. Send command deadbolt (POST /v1.1/devices/{deviceId}/commands, {"command":"deadbolt","commandType":"command","parameter":"default"}).
  3. Observe the webhook changeReport: UNLOCKED briefly, then LOCKED.
  4. Call GET /v1.1/devices/{deviceId}/status: it returns latchBoltLocked.
  5. Send lock: the webhook again reports LOCKED, and the status API reports locked.

The same happens whenever the door is opened by its handle while in the latchBoltLocked state: webhook UNLOCKED, then LOCKED 2–5 s later.

Logs

# 1) command "deadbolt" (times CEST, device IDs redacted)
23:24:20.650 webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 72, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED',   'timeOfSample': 1790630660551}}
23:24:27.952 webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 72, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'UNLOCKED', 'timeOfSample': 1790630667845}}
23:24:29.735 webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 70, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED',   'timeOfSample': 1790630669631}}
23:24:35.563 status API: {'version': 'V2.9', 'battery': 70, 'onlineStatus': 'online', 'lockState': 'latchBoltLocked', 'doorState': 'opened', 'calibrate': True, 'deviceId': 'XXXX', 'deviceType': 'Smart Lock Pro', 'hubDeviceId': 'XXXX'}

# 2) command "lock"
23:24:54.825 webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 70, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED', 'timeOfSample': 1790630694805}}
23:25:01.675 webhook: {'eventType': 'changeReport', 'eventVersion': '1', 'context': {'battery': 70, 'deviceMac': 'XXXX', 'deviceType': 'WoLockPro', 'doorState': 'OPENED', 'lockState': 'LOCKED', 'timeOfSample': 1790630701655}}
23:25:08.450 status API: {'version': 'V2.9', 'battery': 70, 'onlineStatus': 'online', 'lockState': 'locked', 'doorState': 'opened', 'calibrate': True, 'deviceId': 'XXXX', 'deviceType': 'Smart Lock Pro', 'hubDeviceId': 'XXXX'}

Configuration

No custom configuration. API v1.1 via the Home Assistant switchbot_cloud integration (webhook registered with setupWebhook). Auto-lock is disabled on the lock, and the lock is calibrated.

Environment

  • Device: SwitchBot Smart Lock Pro, firmware V2.9, connected via SwitchBot Hub
  • API: v1.1 (status + webhook), client: Home Assistant 2026.9.4, integration switchbot_cloud (python library switchbot-api)
  • OS: Home Assistant OS 18.3

Additional Context

Related: #179 (support for latchBoltLocked), #347 (meaning of latchBoltLocked). Neither covers the webhook reporting LOCKED for this state.
Home Assistant side: home-assistant/core#183517
Note: doorState is unreliable on this door (steel door) and can be ignored.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions