Skip to content

Instantly share code, notes, and snippets.

@thewindev
Created Mar 4, 2021
Embed
What would you like to do?
Node-Red face recognition
[{
"id": "dc813b26.76fc98",
"type": "subflow",
"name": "Identify office person",
"info": "",
"category": "",
"in": [{
"x": 20,
"y": 160,
"wires": [{
"id": "9ac7f4c6.687b18"
}]
}],
"out": [{
"x": 860,
"y": 140,
"wires": [{
"id": "5c452e3.e8d49d",
"port": 0
}]
}, {
"x": 860,
"y": 200,
"wires": [{
"id": "5c452e3.e8d49d",
"port": 1
}]
}],
"env": [],
"color": "#DDAA99"
}, {
"id": "9946c8cf.e15928",
"type": "http request",
"z": "dc813b26.76fc98",
"name": "",
"method": "use",
"ret": "obj",
"paytoqs": "ignore",
"url": "",
"tls": "f2c4d347.ff9bb",
"persist": false,
"proxy": "",
"authType": "",
"x": 430,
"y": 160,
"wires": [
["5c452e3.e8d49d", "feac5093.cb356"]
]
}, {
"id": "9ac7f4c6.687b18",
"type": "function",
"z": "dc813b26.76fc98",
"name": "Prepare RPI4 Request",
"func": "msg.url = \"https://192.168.1.133:5003/facerecognition\";\nmsg.headers = {};\nmsg.method = \"GET\";\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 200,
"y": 160,
"wires": [
["9946c8cf.e15928"]
]
}, {
"id": "5c452e3.e8d49d",
"type": "switch",
"z": "dc813b26.76fc98",
"name": "Check if it's me",
"property": "payload.isMe",
"propertyType": "msg",
"rules": [{
"t": "true"
}, {
"t": "false"
}],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 640,
"y": 160,
"wires": [
[],
[]
]
}, {
"id": "feac5093.cb356",
"type": "debug",
"z": "dc813b26.76fc98",
"name": "Face API",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 300,
"wires": []
}, {
"id": "f2c4d347.ff9bb",
"type": "tls-config",
"name": "",
"cert": "",
"key": "",
"ca": "",
"certname": "",
"keyname": "",
"caname": "",
"servername": "",
"verifyservercert": false
}, {
"id": "59d82776.4cbd08",
"type": "api-call-service",
"z": "9bed5193.e06f9",
"name": "Turn on office lightstrip",
"server": "8501408e.93b69",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.office_lightstrip",
"data": "{\"brightness\":155, \"transition\": 1}",
"dataType": "jsonata",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 900,
"y": 280,
"wires": [
[]
]
}, {
"id": "67963b40.4e4814",
"type": "api-call-service",
"z": "9bed5193.e06f9",
"name": "Wake Laptop",
"server": "8501408e.93b69",
"version": 1,
"debugenabled": false,
"service_domain": "wake_on_lan",
"service": "send_magic_packet",
"entityId": "",
"data": "{\"mac\": \"30-9C-23-91-FF-D1\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 870,
"y": 340,
"wires": [
[]
]
}, {
"id": "7cd18f59.2a5a9",
"type": "api-call-service",
"z": "9bed5193.e06f9",
"name": "Summary of the day",
"server": "8501408e.93b69",
"version": 1,
"debugenabled": false,
"service_domain": "script",
"service": "activate_alexa_actionable_notification",
"entityId": "",
"data": "{\"text\":\"Good morning Bogdan, do you want a summary of the day?\",\"event_id\":\"actionable_notification_office_summary\",\"alexa_device\":\"media_player.office_echo_dot\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 900,
"y": 420,
"wires": [
[]
]
}, {
"id": "5d29e06c.2cecf",
"type": "subflow:dc813b26.76fc98",
"z": "9bed5193.e06f9",
"name": "Check if it's me in the office",
"env": [],
"x": 620,
"y": 460,
"wires": [
["8dab9174.eebaa", "7cd18f59.2a5a9", "67963b40.4e4814", "59d82776.4cbd08"],
[]
]
}, {
"id": "849d274b.461408",
"type": "time-range-switch",
"z": "9bed5193.e06f9",
"name": "Between 5-12",
"lat": "",
"lon": "",
"startTime": "05:00",
"endTime": "15:00",
"startOffset": 0,
"endOffset": 0,
"x": 320,
"y": 460,
"wires": [
["5d29e06c.2cecf"],
[]
]
}, {
"id": "e5474e23.c4ce8",
"type": "server-state-changed",
"z": "9bed5193.e06f9",
"name": "Office door",
"server": "8501408e.93b69",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [{
"property": "name",
"value": ""
}, {
"property": "icon",
"value": ""
}],
"entityidfilter": "binary_sensor.office_door",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": true,
"x": 120,
"y": 460,
"wires": [
["849d274b.461408"]
]
}, {
"id": "8501408e.93b69",
"type": "server",
"name": "Home Assistant"
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment