I have made some changes since my last post, but here is my flow.
[
{
"id": "364678b5.984258",
"type": "function",
"z": "9d603216.7eee9",
"name": "Create message PushOver",
"func": "var date = new Date();\nvar fDate = date.toString();\nfDate = fDate.replace(\"GMT+0200\", \"\");\nfDate = fDate.replace(/\\(|\\)/g, \"\");\nfDate = fDate.replace(\"Central European Summer Time\", \"\");\nvar lastActiveCamera = flow.get('lastActiveCamera') || \"binary_sensor.frontdoor_camera_motion\" ;\n\n//msg.payload = \"Sensor: \" + msg.data.attributes.friendly_name + \"\\nTime: \" + fDate;\nif (lastActiveCamera == \"binary_sensor.frontdoor_camera_motion\") \n{\n msg.payload = \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;msg.payload = \"Sensor: \" + \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;\n msg.topic = \"Se upp!! NÄgon Àr pÄ framsidan\"\n}\nelse if (lastActiveCamera == \"binary_sensor.patio_camera_motion\" )\n{\n msg.payload = \"Rörelsesensor baksidan\" + \"\\nTime: \" + fDate;\n msg.topic = \"Se upp!! NÄgon Àr pÄ baksidan\"\n}\nelse if (lastActiveCamera == \"binary_sensor.back_camera_motion\" )\n{\n msg.payload = \"Rörelsesensor baksidan\" + \"\\nTime: \" + fDate;\n msg.topic = \"Se upp!! NÄgon Àr pÄ baksidan\"\n}\n//msg.payload = \"Sensor: \" + \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;\nmsg.attachment = \"/config/node-red/data/img/deepstack_latest_person.jpg\";\nmsg.sound = \"spacealarm\"\n//msg.topic = \"Se upp!! NÄgon Àr pÄ framsidan\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1300,
"y": 1400,
"wires": [
[
"774e49.793b11b8"
]
]
},
{
"id": "2c729bcd.3cb854",
"type": "api-current-state",
"z": "9d603216.7eee9",
"name": "DeepStack People Result",
"server": "bac22f38.4b474",
"version": 1,
"outputs": 2,
"halt_if": "1",
"halt_if_type": "num",
"halt_if_compare": "gte",
"override_topic": false,
"entity_id": "image_processing.person_detector_back",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 930,
"y": 1520,
"wires": [
[
"364678b5.984258"
],
[]
]
},
{
"id": "97b2e023.14716",
"type": "api-current-state",
"z": "9d603216.7eee9",
"name": "DeepStack People Result",
"server": "bac22f38.4b474",
"version": 1,
"outputs": 2,
"halt_if": "1",
"halt_if_type": "num",
"halt_if_compare": "gte",
"override_topic": false,
"entity_id": "image_processing.person_detector_patio",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 930,
"y": 1440,
"wires": [
[
"364678b5.984258",
"f25b6dd.58ed49"
],
[]
]
},
{
"id": "6125bbd5.c38ac4",
"type": "api-current-state",
"z": "9d603216.7eee9",
"name": "DeepStack People Result",
"server": "bac22f38.4b474",
"version": 1,
"outputs": 2,
"halt_if": "1",
"halt_if_type": "num",
"halt_if_compare": "gte",
"override_topic": false,
"entity_id": "image_processing.person_detector_frontdoor",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 930,
"y": 1380,
"wires": [
[
"364678b5.984258",
"f25b6dd.58ed49"
],
[]
]
},
{
"id": "ba992093.a6b92",
"type": "api-call-service",
"z": "9d603216.7eee9",
"name": "DeepStack People Scan",
"server": "bac22f38.4b474",
"version": 1,
"debugenabled": false,
"service_domain": "image_processing",
"service": "scan",
"entityId": "image_processing.person_detector_back",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 650,
"y": 1520,
"wires": [
[
"2c729bcd.3cb854"
]
]
},
{
"id": "e7c10aa0.0515b8",
"type": "api-call-service",
"z": "9d603216.7eee9",
"name": "DeepStack People Scan",
"server": "bac22f38.4b474",
"version": 1,
"service_domain": "image_processing",
"service": "scan",
"entityId": "image_processing.person_detector_patio",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 650,
"y": 1440,
"wires": [
[
"97b2e023.14716"
]
]
},
{
"id": "c9128e2f.51e1c",
"type": "api-call-service",
"z": "9d603216.7eee9",
"name": "DeepStack People Scan",
"server": "bac22f38.4b474",
"version": 1,
"service_domain": "image_processing",
"service": "scan",
"entityId": "image_processing.person_detector_frontdoor",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 650,
"y": 1380,
"wires": [
[
"6125bbd5.c38ac4"
]
]
},
{
"id": "70df4b2a.700bb4",
"type": "change",
"z": "9d603216.7eee9",
"name": "Set Entity_id AND flow.Variable",
"rules": [
{
"t": "set",
"p": "entity_id",
"pt": "msg",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "lastActiveCamera",
"pt": "flow",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "msg_payload",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 1520,
"wires": [
[
"ba992093.a6b92"
]
]
},
{
"id": "ef058ff5.58dd7",
"type": "change",
"z": "9d603216.7eee9",
"name": "Set Entity_id AND flow.Variable",
"rules": [
{
"t": "set",
"p": "entity_id",
"pt": "msg",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "lastActiveCamera",
"pt": "flow",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "msg_payload",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 1440,
"wires": [
[
"e7c10aa0.0515b8"
]
]
},
{
"id": "18127063.6ce1f",
"type": "change",
"z": "9d603216.7eee9",
"name": "Set Entity_id AND flow.Variable",
"rules": [
{
"t": "set",
"p": "entity_id",
"pt": "msg",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "lastActiveCamera",
"pt": "flow",
"to": "data.entity_id",
"tot": "msg"
},
{
"t": "set",
"p": "msg_payload",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 1380,
"wires": [
[
"c9128e2f.51e1c"
]
]
},
{
"id": "83f6bb11.513ca8",
"type": "server-state-changed",
"z": "9d603216.7eee9",
"name": "Back Motion",
"server": "bac22f38.4b474",
"version": 1,
"entityidfilter": "binary_sensor.back_camera_motion",
"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": 90,
"y": 1520,
"wires": [
[
"70df4b2a.700bb4"
],
[]
]
},
{
"id": "5ef20b03.e9bf44",
"type": "server-state-changed",
"z": "9d603216.7eee9",
"name": "Patio Motion",
"server": "bac22f38.4b474",
"version": 1,
"entityidfilter": "binary_sensor.patio_camera_motion",
"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": 90,
"y": 1440,
"wires": [
[
"ef058ff5.58dd7"
],
[]
]
},
{
"id": "77a215e7.10463c",
"type": "server-state-changed",
"z": "9d603216.7eee9",
"name": "Front Door Motion",
"server": "bac22f38.4b474",
"version": 1,
"entityidfilter": "binary_sensor.frontdoor_camera_motion",
"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": 110,
"y": 1380,
"wires": [
[
"18127063.6ce1f"
],
[]
]
},
{
"id": "bac22f38.4b474",
"type": "server",
"z": "",
"name": "Home Assistant 101",
"legacy": false,
"hassio": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true
}
]