目录
前言
选择门磁传感器作为智能家居系统的第一款设备,主要有以下几个方面的考虑.
功能简单:目前主要构想通过门磁传感器来检测冰箱门是否长时间未关闭 而产生警报
物料简单:目前市面上可以各种门磁提供选择
开发简单:目前门磁传感器主要可以通过IO来接入,不需要协议上的对接,这样可以大程度上减少前期的开发时间
功能构想
冰箱门磁传感器主要作为一个低功耗传感器,使用ESP8266开发.功能非常简单.
接入三个门磁传感器,对应冰箱的三个门,当冰箱门被打开时,唤醒单片机,上报触发属性,并开始计时.如果规定时间内没有关闭的话,将会上报警告.
该警告会触发智能家居系统的警报器发出响声,并将警告推送到小程序
物料以及代码
单片机:ESP8266
SDK:ESP8266_RTOS_SDK
门磁:MC-38 单价3.5
原理图
待定
物模型
{
"profile": {
"productFatherID": 2345,
"productID": 1007,
"productSubID": 3,
"productName":"门磁传感器"
},
"nature":{
"Name":null,
"productUUID":null,
"location":null
},
"properties": [
{
"identifier": "door1_onoff",
"name": "door1_onoff",
"accessMode": "r",
"required": true,
"dataType": {
"type": "bool",
"specs": {
"0": 0,
"1": 1
}
}
},
{
"identifier": "door2_onoff",
"name": "door2_onoff",
"accessMode": "r",
"required": true,
"dataType": {
"type": "bool",
"specs": {
"0": 0,
"1": 1
}
}
},
{
"identifier": "door3_onoff",
"name": "door3_onoff",
"accessMode": "r",
"required": true,
"dataType": {
"type": "bool",
"specs": {
"0": 0,
"1": 1
}
}
}
],
"events": [
{
"identifier": "door_open_alarm_event",
"name": "door_open_alarm_event",
"desc": "开门超时警告",
"type": "error。",
"required": true,
"outputData": [
{
"identifier": "alarm",
"name": "alarm",
"dataType": {
"type": "bool",
"specs": {
"0": true,
"1": false
}
}
}
],
"method": null
}
],
"services": [
{
"identifier": "set_heartbeat_time_services",
"name": "set_heartbeat_time_services",
"desc": "设置上传心跳包的时间",
"required": true,
"callType": "sync",
"inputData": [
{
"identifier": "set_heartbeat_time_s",
"name": "set_heartbeat_time_services",
"dataType": {
"type": "int",
"specs": {
"min": 5,
"max": 60,
"unit": null,
"unitName": "s",
"step": 1
}
}
}
],
"outputData": null,
"method": null
},
{
"identifier": "set_door_open_alarm_time_services",
"name": "set_door_open_alarm_time_services",
"desc": "设置打开超时时间",
"required": true,
"callType": "sync",
"inputData": [
{
"identifier": "set_door_open_alarm_time_s",
"name": "set_door_open_alarm_time_s",
"dataType": {
"type": "int",
"specs": {
"min": 10,
"max": 300,
"unit": null,
"unitName": "s",
"step": 1
}
}
}
],
"outputData": null,
"method": null
}
]
}