You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS IoT Button触发后仅返回三个参数?技术问询

Hey there fellow AWS IoT developer! 😊

I’ve confirmed that when you press an Amazon IoT Button, it will only send the three core parameters shown in the code snippet below by default:

// Amazon的IoT Button被按下时会发送三个参数...
var body = JSON.stringify({ 
  clickType: event.clickType, // (string) 按键类型;可选值为"SINGLE"、"DOUBLE"或"LONG"
  serialNumber: event.serialNumber, // (string) 设备序列号,位于按钮背面
  batteryVoltage: event.batteryVoltage // (string) 设备电池电压,单位为毫伏,例如"1567"
})

Let me break down each parameter for clarity:

  • clickType: A string that indicates how the button was pressed. Valid values are "SINGLE", "DOUBLE", or "LONG" — this is super useful for triggering different actions based on the press type.
  • serialNumber: A unique string identifier for your button, which you can find printed on the back of the device. This helps you distinguish between multiple buttons if you have a fleet deployed.
  • batteryVoltage: A string representing the button's battery level in millivolts (e.g., "1567"). You can use this to monitor when the battery needs replacement.

内容的提问来源于stack exchange,提问作者James Watson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:03:30