设备状态变更 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 | 打扫请求 |
| 紧急呼叫 | sos | SOS 按键触发 |
| 开门 | open_door | 门磁打开 |
