[
{
"id": "93fd9ed1.715b6",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Announce Movement",
"server": "",
"service_domain": "media_player",
"service": "alexa_tts",
"data": "",
"mergecontext": "",
"x": 1280,
"y": 540,
"wires": [
[
"8e0a4f52.ef639"
]
]
},
{
"id": "a86147a9.721cc8",
"type": "template",
"z": "591813ae.77999c",
"name": "Message Convert",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{ \"data\": \n{ \"entity_id\" : \"media_player.kitchen, media_player.master_bedroom, media_player.living_room_2\",\n\"message\" : \"{{payload}}\" }\n}",
"output": "json",
"x": 1050,
"y": 540,
"wires": [
[
"93fd9ed1.715b6"
]
]
},
{
"id": "8fcecb8c.58e798",
"type": "switch",
"z": "591813ae.77999c",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "ON",
"vt": "str"
},
{
"t": "neq",
"v": "ON",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 370,
"y": 280,
"wires": [
[
"fe775fb1.1f8f5",
"18761d3c.8a1043"
],
[
"d1c30640.b89778",
"18761d3c.8a1043"
]
]
},
{
"id": "f9ab8435.80b738",
"type": "delay",
"z": "591813ae.77999c",
"name": "",
"pauseType": "delay",
"timeout": "13",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 940,
"y": 340,
"wires": [
[
"576b63fe.0f0dfc",
"5497a58b.216e3c",
"9859e536.a475d8"
]
]
},
{
"id": "e200f3ed.19506",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Play Camera Stream",
"server": "",
"service_domain": "media_player",
"service": "play_media",
"data": "",
"mergecontext": "",
"x": 1460,
"y": 140,
"wires": [
[
"cc1c49fb.f51ce8"
]
]
},
{
"id": "a3e802d0.83504",
"type": "delay",
"z": "591813ae.77999c",
"name": "",
"pauseType": "delay",
"timeout": "250",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 950,
"y": 300,
"wires": [
[
"d9ee0f84.e543a"
]
]
},
{
"id": "d090d82a.628c68",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Switch to Chromecast",
"server": "",
"service_domain": "remote",
"service": "turn_on",
"data": "{ \"entity_id\": \"remote.living_room_harmony\", \"activity\": \"Watch Funky Cold\" }",
"mergecontext": "",
"x": 1460,
"y": 300,
"wires": [
[
"bc877772.e59c68"
]
]
},
{
"id": "576b63fe.0f0dfc",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "Last Harmony Activity",
"server": "",
"halt_if": "",
"override_topic": true,
"override_payload": true,
"entity_id": "input_text.last_harmony_activity",
"x": 1220,
"y": 340,
"wires": [
[
"7f744077.7559e"
]
]
},
{
"id": "7f744077.7559e",
"type": "template",
"z": "591813ae.77999c",
"name": "Activty Conversion",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{ \"data\": \n {\"entity_id\": \"remote.living_room_harmony\",\n \"activity\": \"{{payload}}\"}\n}",
"output": "str",
"x": 1450,
"y": 340,
"wires": [
[
"3333b094.49642"
]
]
},
{
"id": "661eefbd.a47f5",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Stop camera Stream",
"server": "",
"service_domain": "media_player",
"service": "media_stop",
"data": "{ \"entity_id\": \"media_player.funky_cold\" }",
"mergecontext": "",
"x": 1380,
"y": 460,
"wires": [
[]
]
},
{
"id": "3333b094.49642",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Switch Back",
"server": "",
"service_domain": "remote",
"service": "turn_on",
"data": "",
"mergecontext": "",
"x": 1710,
"y": 340,
"wires": [
[
"aae8fddb.ae771"
]
]
},
{
"id": "e4a56143.25bc6",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Motion Detected Message",
"server": "",
"template": "{% if is_state('binary_sensor.porch_camera_motion', 'on') %}\n Motion detected by the porch camera.\n{% elif is_state('binary_sensor.back_yard_camera_motion', 'on') %}\n Motion detected by the back yard camera.\n{% elif is_state('binary_sensor.driveway_camera_motion', 'on') %}\n Motion detected by the driveway camera.\n{% elif is_state('binary_sensor.side_camera_motion', 'on') %}\n Motion detected by the side camera.\n{% else %} \n{% endif %}",
"x": 810,
"y": 540,
"wires": [
[
"a86147a9.721cc8"
]
]
},
{
"id": "5dbe9d0f.bfe414",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Which Camera Stream?",
"server": "",
"template": "{% if is_state('binary_sensor.porch_camera_motion', 'on') %}\n http://LocalBlueIrisIPAddressHere/mjpg/porch/video.mjpg\n{% elif is_state('binary_sensor.back_yard_camera_motion', 'on') %}\n http://LocalBlueIrisIPAddressHere/mjpg/backyard/video.mjpg\n{% elif is_state('binary_sensor.driveway_camera_motion', 'on') %}\n http://LocalBlueIrisIPAddressHere/mjpg/driveway/video.mjpg\n{% elif is_state('binary_sensor.side_camera_motion', 'on') %}\n http://LocalBlueIrisIPAddressHere/mjpg/side/video.mjpg\n{% else %} \n{% endif %}",
"x": 990,
"y": 140,
"wires": [
[
"a8fea8bf.96c258"
]
]
},
{
"id": "a8fea8bf.96c258",
"type": "template",
"z": "591813ae.77999c",
"name": "Stream Convert",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{ \"data\": \n{\n \"entity_id\": \"media_player.funky_cold\",\n \"media_content_id\": \"{{{payload}}}\",\n \"media_content_type\": \"image/jpg\" \n}\n}",
"output": "str",
"x": 1200,
"y": 140,
"wires": [
[
"e200f3ed.19506"
]
]
},
{
"id": "650b159e.1143fc",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Current Harmony State",
"server": "",
"template": "{{state_attr('remote.living_room_harmony', \n'current_activity')}}",
"x": 990,
"y": 220,
"wires": [
[
"ac1423f0.b58dd"
]
]
},
{
"id": "ac1423f0.b58dd",
"type": "template",
"z": "591813ae.77999c",
"name": "Activity Name",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{ \"data\": \n{ \"entity_id\" : \"input_text.last_harmony_activity\",\n\"value\" : \"{{payload}}\" }\n}",
"output": "str",
"x": 1200,
"y": 220,
"wires": [
[
"84585fc4.b341"
]
]
},
{
"id": "84585fc4.b341",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Set Last Activity",
"server": "",
"service_domain": "input_text",
"service": "set_value",
"data": "",
"mergecontext": "",
"x": 1440,
"y": 220,
"wires": [
[
"88da5adc.4a4378"
]
]
},
{
"id": "80ed5624.8c4348",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Pause Current Activity",
"server": "",
"service_domain": "remote",
"service": "send_command",
"data": "",
"mergecontext": "",
"x": 1220,
"y": 180,
"wires": [
[
"4da8c887.980b38"
]
]
},
{
"id": "eaefc4d3.6ea188",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Pause Current Media",
"server": "",
"template": "{% if is_state('input_text.last_harmony_activity', 'Watch Apple TV') %}\n { \"data\": \n { \"entity_id\" : \"remote.living_room_harmony\",\n \"device\": \"50819014\",\n \"command\": \"Pause\"\n }\n }\n{% else %} false \n{% endif %}",
"x": 980,
"y": 180,
"wires": [
[
"80ed5624.8c4348"
]
]
},
{
"id": "2b51a0a.63aa06",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Resume Media",
"server": "",
"template": "{% if is_state('input_text.last_harmony_activity', 'Watch Apple TV') %}\n { \"data\": \n { \"entity_id\" : \"remote.living_room_harmony\",\n \"device\": \"50819014\",\n \"command\": \"Play\"\n }\n }\n{% else %} false \n{% endif %}",
"x": 1360,
"y": 500,
"wires": [
[
"d62345fe.197538"
]
]
},
{
"id": "d62345fe.197538",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Resume Media",
"server": "",
"service_domain": "remote",
"service": "send_command",
"data": "",
"mergecontext": "",
"x": 1720,
"y": 500,
"wires": [
[]
]
},
{
"id": "8e0a4f52.ef639",
"type": "debug",
"z": "591813ae.77999c",
"name": "Announcement",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1500,
"y": 540,
"wires": []
},
{
"id": "cc1c49fb.f51ce8",
"type": "debug",
"z": "591813ae.77999c",
"name": "Camera Stream",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1720,
"y": 140,
"wires": []
},
{
"id": "5497a58b.216e3c",
"type": "delay",
"z": "591813ae.77999c",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1180,
"y": 460,
"wires": [
[
"2b51a0a.63aa06",
"661eefbd.a47f5"
]
]
},
{
"id": "145a8116.f1c55f",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Apple TV Pause",
"server": "",
"template": "{% if is_state('input_text.last_harmony_activity', 'Watch Apple TV') %}\n { \"data\": \n { \"entity_id\" : \"remote.living_room_harmony\",\n \"device\": \"50819014\",\n \"command\": \"Pause\"\n }\n }\n{% else %} false \n{% endif %}",
"x": 1360,
"y": 420,
"wires": [
[
"a4698f08.89ec7"
]
]
},
{
"id": "a4698f08.89ec7",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Apple TV Pause",
"server": "",
"service_domain": "remote",
"service": "send_command",
"data": "",
"mergecontext": "",
"x": 1540,
"y": 420,
"wires": [
[
"cf75b377.e2b84"
]
]
},
{
"id": "9859e536.a475d8",
"type": "delay",
"z": "591813ae.77999c",
"name": "",
"pauseType": "delay",
"timeout": "250",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1190,
"y": 420,
"wires": [
[
"145a8116.f1c55f"
]
]
},
{
"id": "cf75b377.e2b84",
"type": "delay",
"z": "591813ae.77999c",
"name": "",
"pauseType": "delay",
"timeout": "250",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1710,
"y": 420,
"wires": [
[
"af2253c9.aca4d"
]
]
},
{
"id": "af2253c9.aca4d",
"type": "api-render-template",
"z": "591813ae.77999c",
"name": "Apple TV Rewind",
"server": "",
"template": "{% if is_state('input_text.last_harmony_activity', 'Watch Apple TV') %}\n { \"data\": \n { \"entity_id\" : \"remote.living_room_harmony\",\n \"device\": \"50819014\",\n \"command\": \"Rewind\"\n }\n }\n{% else %} false \n{% endif %}",
"x": 1890,
"y": 420,
"wires": [
[
"b50b79bd.8bfae8"
]
]
},
{
"id": "b50b79bd.8bfae8",
"type": "api-call-service",
"z": "591813ae.77999c",
"name": "Apple TV Rewind",
"server": "",
"service_domain": "remote",
"service": "send_command",
"data": "",
"mergecontext": "",
"x": 2090,
"y": 420,
"wires": [
[]
]
},
{
"id": "88da5adc.4a4378",
"type": "debug",
"z": "591813ae.77999c",
"name": "Last Activity",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1710,
"y": 220,
"wires": []
},
{
"id": "aae8fddb.ae771",
"type": "debug",
"z": "591813ae.77999c",
"name": "Switch Back",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1870,
"y": 340,
"wires": []
},
{
"id": "5891b76d.e27418",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "TV State",
"server": "",
"halt_if": "off",
"override_topic": true,
"override_payload": true,
"entity_id": "remote.living_room_harmony",
"x": 760,
"y": 260,
"wires": [
[
"eaefc4d3.6ea188",
"650b159e.1143fc",
"a3e802d0.83504",
"5dbe9d0f.bfe414"
]
]
},
{
"id": "a0ebc1c5.247d2",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "TV State",
"server": "",
"halt_if": "off",
"override_topic": true,
"override_payload": true,
"entity_id": "remote.living_room_harmony",
"x": 760,
"y": 300,
"wires": [
[
"f9ab8435.80b738"
]
]
},
{
"id": "fe775fb1.1f8f5",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "Automation State",
"server": "",
"halt_if": "off",
"override_topic": true,
"override_payload": true,
"entity_id": "input_boolean.camera_motion_detection",
"x": 550,
"y": 260,
"wires": [
[
"5891b76d.e27418",
"16e5141f.42e7dc"
]
]
},
{
"id": "d1c30640.b89778",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "Automation State",
"server": "",
"halt_if": "off",
"override_topic": true,
"override_payload": true,
"entity_id": "input_boolean.camera_motion_detection",
"x": 550,
"y": 300,
"wires": [
[
"a0ebc1c5.247d2"
]
]
},
{
"id": "4da8c887.980b38",
"type": "debug",
"z": "591813ae.77999c",
"name": "Pause Activity",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1440,
"y": 180,
"wires": []
},
{
"id": "bc877772.e59c68",
"type": "debug",
"z": "591813ae.77999c",
"name": "Switch to Chromecast",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1740,
"y": 300,
"wires": []
},
{
"id": "2e000c0a.f87854",
"type": "comment",
"z": "591813ae.77999c",
"name": "Check if Alerts Allowed",
"info": "",
"x": 560,
"y": 220,
"wires": []
},
{
"id": "a8857a2f.6b7758",
"type": "comment",
"z": "591813ae.77999c",
"name": "TV On or Off?",
"info": "",
"x": 770,
"y": 220,
"wires": []
},
{
"id": "cce03bd7.055078",
"type": "comment",
"z": "591813ae.77999c",
"name": "Where was motion detected?",
"info": "",
"x": 820,
"y": 500,
"wires": []
},
{
"id": "2c071a2d.1dd746",
"type": "comment",
"z": "591813ae.77999c",
"name": "Cameras",
"info": "",
"x": 160,
"y": 180,
"wires": []
},
{
"id": "1e81a769.12e5f9",
"type": "comment",
"z": "591813ae.77999c",
"name": "HTML Address Format",
"info": "The Payload MUST be in tripple brackets\n{{{payload}}}\nOtherwise, the URL will not pass correctly",
"x": 1220,
"y": 100,
"wires": []
},
{
"id": "2b31fce7.6f11e4",
"type": "comment",
"z": "591813ae.77999c",
"name": "Since Harmony's Apple TV \"On\" command is just play, this section pauses and rewinds to properly resume",
"info": "",
"x": 1480,
"y": 380,
"wires": []
},
{
"id": "3d379467.3ea82c",
"type": "comment",
"z": "591813ae.77999c",
"name": "This delay is to allow storing of the last Harmony Activity before switching",
"info": "",
"x": 1140,
"y": 260,
"wires": []
},
{
"id": "d9ee0f84.e543a",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "Halt if On Chromecast",
"server": "",
"halt_if": "Watch Funky Cold",
"override_topic": true,
"override_payload": true,
"entity_id": "remote.living_room_harmony",
"x": 1220,
"y": 300,
"wires": [
[
"d090d82a.628c68"
]
]
},
{
"id": "16e5141f.42e7dc",
"type": "api-current-state",
"z": "591813ae.77999c",
"name": "Anyone Home?",
"server": "",
"halt_if": "off",
"override_topic": false,
"override_payload": false,
"entity_id": "switch.virtual_presence_switch",
"x": 780,
"y": 460,
"wires": [
[
"e4a56143.25bc6"
]
]
},
{
"id": "18761d3c.8a1043",
"type": "debug",
"z": "591813ae.77999c",
"name": "Detected",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 520,
"y": 380,
"wires": []
},
{
"id": "67a1055c.99a0dc",
"type": "mqtt in",
"z": "591813ae.77999c",
"name": "Porch",
"topic": "BlueIris/Porch",
"qos": "2",
"broker": "",
"x": 150,
"y": 220,
"wires": [
[
"8fcecb8c.58e798"
]
]
},
{
"id": "66ed0213.09713c",
"type": "mqtt in",
"z": "591813ae.77999c",
"name": "Driveway",
"topic": "BlueIris/Driveway",
"qos": "2",
"broker": "",
"x": 140,
"y": 260,
"wires": [
[
"8fcecb8c.58e798"
]
]
},
{
"id": "2e5efd24.81c762",
"type": "mqtt in",
"z": "591813ae.77999c",
"name": "Side",
"topic": "BlueIris/Side",
"qos": "2",
"broker": "",
"x": 150,
"y": 300,
"wires": [
[
"8fcecb8c.58e798"
]
]
},
{
"id": "23f388c8.ebd9d8",
"type": "mqtt in",
"z": "591813ae.77999c",
"name": "Back Yard",
"topic": "BlueIris/Back_Yard",
"qos": "2",
"broker": "",
"x": 140,
"y": 340,
"wires": [
[
"8fcecb8c.58e798"
]
]
},
{
"id": "",
"type": "server",
"z": "",
"name": "",
"url": "",
"pass": ""
},
{
"id": "",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]
Hopefully I did this right…if you find better ways to do some of what I did, please let me know! This was an ambitious first stab at Node-RED for me.