[
{
"id": "46cfc3b5.ec68cc",
"type": "tab",
"label": "后院自动关灯",
"disabled": false,
"info": ""
},
{
"id": "b5a42f15.0fc0c",
"type": "server",
"z": "",
"name": "Home Assistant",
"addon": true
},
{
"id": "514d15d8.48056c",
"type": "baidu-face-configurator",
"z": "",
"name": "人流量统计",
"client_id": "换成自己的",
"client_secret": "换成自己的"
},
{
"id": "961df4c2.d34e88",
"type": "ui_base",
"theme": {
"name": "theme-light",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#0094CE",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#097479",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": false
},
"customTheme": {
"name": "Untitled Theme 1",
"default": "#4B7930",
"baseColor": "#4B7930",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
},
"themeState": {
"base-color": {
"default": "#0094CE",
"value": "#0094CE",
"edited": false
},
"page-titlebar-backgroundColor": {
"value": "#0094CE",
"edited": false
},
"page-backgroundColor": {
"value": "#fafafa",
"edited": false
},
"page-sidebar-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"group-textColor": {
"value": "#1bbfff",
"edited": false
},
"group-borderColor": {
"value": "#ffffff",
"edited": false
},
"group-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"widget-textColor": {
"value": "#111111",
"edited": false
},
"widget-backgroundColor": {
"value": "#0094ce",
"edited": false
},
"widget-borderColor": {
"value": "#ffffff",
"edited": false
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey"
}
},
"site": {
"name": "Node-RED Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "false",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 48,
"sy": 48,
"gx": 6,
"gy": 6,
"cx": 6,
"cy": 6,
"px": 0,
"py": 0
}
}
},
{
"id": "8f72f829.a59ea8",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open"
},
{
"id": "6a6962b1.5468fc",
"type": "server-state-changed",
"z": "46cfc3b5.ec68cc",
"name": "后院开灯",
"server": "b5a42f15.0fc0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "switch.wall_switch_ln_left_158d0002114b19",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 280,
"y": 660,
"wires": [
[
"33e78dfc.6de672"
],
[]
]
},
{
"id": "857d188e.b948b8",
"type": "http request",
"z": "46cfc3b5.ec68cc",
"name": "海康威视摄像头抓图",
"method": "GET",
"ret": "bin",
"paytoqs": "body",
"url": "http://192.168.1.3/ISAPI/Streaming/channels/100/picture?videoResolutionWidth=1920&videoResolutionHeight=1080",
"tls": "",
"persist": false,
"proxy": "",
"authType": "digest",
"x": 680,
"y": 460,
"wires": [
[
"405fcaf4.cf3194"
]
]
},
{
"id": "405fcaf4.cf3194",
"type": "base64",
"z": "46cfc3b5.ec68cc",
"name": "base64编码",
"action": "",
"property": "payload",
"x": 750,
"y": 560,
"wires": [
[
"afec3153.5879"
]
]
},
{
"id": "afec3153.5879",
"type": "change",
"z": "46cfc3b5.ec68cc",
"name": "转换参数名称",
"rules": [
{
"t": "move",
"p": "payload",
"pt": "msg",
"to": "image",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 660,
"wires": [
[
"bb33f0e5.46b86"
]
]
},
{
"id": "87d4737f.de24d",
"type": "delay",
"z": "46cfc3b5.ec68cc",
"name": "",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 480,
"y": 400,
"wires": [
[
"857d188e.b948b8"
]
]
},
{
"id": "bb33f0e5.46b86",
"type": "baidu-body-num",
"z": "46cfc3b5.ec68cc",
"name": "百度ai统计图片中的人数",
"baiduface": "514d15d8.48056c",
"image": "",
"show": false,
"x": 1110,
"y": 560,
"wires": [
[
"67c656c2.394088"
],
[]
]
},
{
"id": "67c656c2.394088",
"type": "switch",
"z": "46cfc3b5.ec68cc",
"name": "判断人数是否为零",
"property": "payload.person_num",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "gt",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1270,
"y": 260,
"wires": [
[
"ec6459c0.e12648"
],
[
"87d4737f.de24d"
]
]
},
{
"id": "ef751980.148608",
"type": "api-call-service",
"z": "46cfc3b5.ec68cc",
"name": "后院关灯",
"server": "b5a42f15.0fc0c",
"version": 1,
"debugenabled": false,
"service_domain": "switch",
"service": "turn_off",
"entityId": "switch.wall_switch_ln_left_158d0002114b19",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 2040,
"y": 160,
"wires": [
[]
]
},
{
"id": "b6c9443a.d2c498",
"type": "api-call-service",
"z": "46cfc3b5.ec68cc",
"name": "语音播报",
"server": "b5a42f15.0fc0c",
"version": 1,
"debugenabled": false,
"service_domain": "media_player",
"service": "play_media",
"entityId": "media_player.mopidy",
"data": "{"media_content_type":"music","media_content_id":"http://192.168.2.18:8123/local/sound/lutai_off_light.mp3"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 2120,
"y": 700,
"wires": [
[]
]
},
{
"id": "d1d08464.f725b8",
"type": "delay",
"z": "46cfc3b5.ec68cc",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 2120,
"y": 600,
"wires": [
[
"b6c9443a.d2c498"
]
]
},
{
"id": "10fac6cd.0d5779",
"type": "api-call-service",
"z": "46cfc3b5.ec68cc",
"name": "打开功放",
"server": "b5a42f15.0fc0c",
"version": 1,
"debugenabled": false,
"service_domain": "script",
"service": "turn_on",
"entityId": "script.prepare_for_tts",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 2100,
"y": 500,
"wires": [
[
"d1d08464.f725b8"
]
]
},
{
"id": "fd1b23fb.b4dbf",
"type": "comment",
"z": "46cfc3b5.ec68cc",
"name": "连接到下面的点是图片通道,不是返回值",
"info": "",
"x": 1060,
"y": 520,
"wires": []
},
{
"id": "5615b242.afd1ec",
"type": "time-range-switch",
"z": "46cfc3b5.ec68cc",
"name": "时间范围",
"lat": "30.917265839216284",
"lon": "120.07766738374926",
"startTime": "22:00",
"endTime": "07:00",
"startOffset": 0,
"endOffset": 0,
"x": 1960,
"y": 420,
"wires": [
[],
[
"10fac6cd.0d5779"
]
]
},
{
"id": "33e78dfc.6de672",
"type": "function",
"z": "46cfc3b5.ec68cc",
"name": "人数检测为零检查次数",
"func": "flow.set('count', 2);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 340,
"y": 540,
"wires": [
[
"87d4737f.de24d"
]
]
},
{
"id": "ec6459c0.e12648",
"type": "function",
"z": "46cfc3b5.ec68cc",
"name": "检查次数减1",
"func": "var count = flow.get('count')||0;\nif(count>0){\n count = count-1;\n flow.set('count', count);\n}\nmsg.payload = count;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 1530,
"y": 260,
"wires": [
[
"c20e7912.628898"
]
]
},
{
"id": "c20e7912.628898",
"type": "switch",
"z": "46cfc3b5.ec68cc",
"name": "判断检查次数是否为零",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "gt",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1580,
"y": 60,
"wires": [
[
"ef751980.148608",
"5615b242.afd1ec"
],
[
"87d4737f.de24d"
]
]
}
]