请看一下:
https://git.ti.com/zigbee-iot-agent/zigbee-iot-agent
这是一个节点 js 应用程序,它连接到 ZStack Linux 网关(在 BBB 上运行)并提供以下功能:
将 ZigBee 设备(灯、温度传感器、光传感器、开关)抽象为 JSON 对象。这已通过 Philips Hue Lights、TI ZLights (https://store.ti.com/cc2530zdk-zll-cc-debugger.aspx) 和 ZigBee 传感器标签(运行可从 BLE iOS 应用下载的 ZigBee 固件)进行测试。
提供一个网页,让您可以控制 ZigBee 网络和设备。
将设备数据转发到 QuickStart 服务,无需 Bluemix 帐户即可访问。
Web 界面可用于供应设备,以便它们可以连接到供应的 Bluemix 服务。这是控制设备所必需的,但确实需要一个 Bluemix 帐户。
这是一个示例节点红色流程,用于根据传感器标签光传感器报告的发光度控制灯光级别:
[{"id":"12345678.abcde","type":"ibmiot","name":"a-4sogfzc9cogqrg7d"},{"id":"12345678.abcde","type":"ibmiotin","authentication":"apiKey","apiKey":"12345678.abcde","inputType":"evt","deviceId":"001289ec0b10","applicationId":"","deviceType":"","eventType":"","commandType":"","format":"","name":"IBM IoT AppIn","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":true,"x":434,"y":260,"z":"6581e5ae.9a7e1c","wires":[["fbbb817e.04448"]]},{"id":"12345678.abcde","type":"ibmiotout","authentication":"apiKey","apiKey":"12345678.abcde","outputType":"cmd","deviceId":"0012dc63f111","deviceType":"zbdevice","eventCommandType":"blink","format":"json","data":"{\"a\":\"on\":1}","name":"Light0012dc63f111Out","service":"registered","x":1026,"y":260,"z":"6581e5ae.9a7e1c","wires":[]},{"id":"fbbb817e.04448","type":"function","name":"LuminToLevel","func":"var lightMsg ={\n\t\"payload\": {\n\t \"a\": {\n\t\t \"on\":1,\n\t\t \"level\":255,\n\t}\n\t}\n};\n\t\n//light sensor Lumin is 0-0xFFFF, may this to 0xFF-0 light level\nlightMsg.payload.a.level= 0xFF -msg.payload.d.lumin / 0x100;\n\n//bound check\nif(lightMsg.payload.a.level > 0xFF)lightMsg.payload.a.level = 0xFF;\n//if(lightMsg.payload.a.level < 0)lightMsg.payload.a.level = 0;\n\nreturnlightMsg;\n","outputs":1,"valid":true,"x":639,"y":260,"z":"6581e5ae.9a7e1c","wires":[["cebf6c53.31409"]]},{"id":"cebf6c53.31409","type":"json","name":"","x":807,"y":260,"z":"6581e5ae.9a7e1c","wires":[["a9314c4.f56ceb"]]}]
问候,
TC。