Skip to content

设备状态变更 Webhook

当设备状态变化时,hapi 主动 POST 到第三方应用的 notify_url

POST {app.notify_url}
X-Beancomm-Timestamp: 1693700000
X-Beancomm-AppId: {app_id}
X-Beancomm-Signature: {md5(JSON.stringify(notifyData) + ts + app_secret)}
Content-Type: application/json

{
  "room_uuid": "xxx",
  "device_name": "床头灯",
  "nick_name": "床头灯",
  "type": "smart_light",
  "mac": "aabbccddeeff",
  "change": {
    "on_off": { "previous": "off", "current": "on" },
    "brightness": { "previous": "50", "current": "80" }
  }
}

特殊语义事件:

事件change 字段说明
勿扰do_not_disturb勿扰模式开关
打扫房间make_up_room打扫请求
紧急呼叫sosSOS 按键触发
开门open_door门磁打开