Files
HA-NerdFlows/flows.json

40433 lines
1.2 MiB

[
{
"id": "4a8821853d4dd1ad",
"type": "tab",
"label": "Kallen Timer",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e44b1e7a8ef7ae1d",
"type": "tab",
"label": "Time-based automations",
"disabled": false,
"info": "",
"env": []
},
{
"id": "3abb5ae57afb4761",
"type": "tab",
"label": "Presence",
"disabled": false,
"info": "",
"env": []
},
{
"id": "eff21041cc941fef",
"type": "tab",
"label": "First Floor",
"disabled": false,
"info": "",
"env": []
},
{
"id": "5e238cbbe6d612c9",
"type": "tab",
"label": "Second Floor",
"disabled": false,
"info": "",
"env": []
},
{
"id": "47f17992fab9b4f5",
"type": "tab",
"label": "Basement",
"disabled": false,
"info": "",
"env": []
},
{
"id": "b5717a86ce55bc29",
"type": "tab",
"label": "Outdoor Lighting",
"disabled": false,
"info": "",
"env": []
},
{
"id": "b0286fae9f2ce547",
"type": "tab",
"label": "Media Scenes",
"disabled": false,
"info": "",
"env": []
},
{
"id": "72f99805df043603",
"type": "tab",
"label": "Climate",
"disabled": false,
"info": "",
"env": []
},
{
"id": "b7d34d3e9d0c9486",
"type": "tab",
"label": "Laundry",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ce79e27ec84983a9",
"type": "tab",
"label": "Batteries",
"disabled": false,
"info": "",
"env": []
},
{
"id": "458e4c0055c8c533",
"type": "tab",
"label": "Alarm Clocks",
"disabled": false,
"info": "",
"env": []
},
{
"id": "9824adcf61e30734",
"type": "tab",
"label": "Housewide Modes",
"disabled": false,
"info": "",
"env": []
},
{
"id": "5c4ac37140a54ac9",
"type": "tab",
"label": "Alexa",
"disabled": false,
"info": "",
"env": []
},
{
"id": "75e98103856848a6",
"type": "tab",
"label": "Google Home",
"disabled": false,
"info": "",
"env": []
},
{
"id": "9a8e84bd2945505e",
"type": "tab",
"label": "Announcements",
"disabled": false,
"info": "",
"env": []
},
{
"id": "bb961e59e2ef86c9",
"type": "tab",
"label": "Apple",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ee67610b4a0578d2",
"type": "tab",
"label": "Messaging",
"disabled": false,
"info": "",
"env": []
},
{
"id": "873eb2575d6e9014",
"type": "tab",
"label": "Gitea",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ebd5561c4f077718",
"type": "tab",
"label": "Weather",
"disabled": false,
"info": "",
"env": []
},
{
"id": "fc6801ef8637d652",
"type": "tab",
"label": "Sports",
"disabled": false,
"info": "",
"env": []
},
{
"id": "789ba711dc04fad2",
"type": "tab",
"label": "Twitch",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ffa6a885ac41a5ed",
"type": "tab",
"label": "Server Stuff",
"disabled": false,
"info": "",
"env": []
},
{
"id": "3e4ba157b540d183",
"type": "tab",
"label": "Global Variable Settings",
"disabled": false,
"info": "",
"env": []
},
{
"id": "d3dcbe534743b01d",
"type": "tab",
"label": "Discord",
"disabled": true,
"info": "",
"env": []
},
{
"id": "d49b385d8b582b20",
"type": "tab",
"label": "Test",
"disabled": false,
"info": "",
"env": []
},
{
"id": "a42343e035e3313c",
"type": "subflow",
"name": "Alexa Location (Serial #)",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "1102574d15bdad4c"
}
]
}
],
"out": [
{
"x": 460,
"y": 80,
"wires": [
{
"id": "afead614fabc01bb",
"port": 0
}
]
}
],
"env": [],
"meta": {
"type": "Alexa Subflow"
},
"color": "#DDAA99",
"icon": "node-red-contrib-alexa-remote2-applestrudel/alexa-remote-icon.png",
"status": {
"x": 460,
"y": 140,
"wires": [
{
"id": "afead614fabc01bb",
"port": 1
}
]
}
},
{
"id": "4107976aa434eb03",
"type": "subflow",
"name": "Weather Conversions",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 80,
"wires": [
{
"id": "388878f6056fa3e4"
}
]
}
],
"out": [
{
"x": 500,
"y": 80,
"wires": [
{
"id": "80ce4b42b82e3c78",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "font-awesome/fa-cloud"
},
{
"id": "6429099c4571dd6b",
"type": "subflow",
"name": "Speech Engine",
"info": "```msg.payload:``` The message you would like spoken\r\n\r\n```msg.topic:``` The room you would like the message spoken in\r\n\r\n```msg.type:``` The type of alert, 'normal', 'alert', 'weather', 'critical'\r\n\r\n```msg.voice: ``` (optional) The voice you would like the message spoken in. Will use default if not defined.",
"category": "",
"in": [
{
"x": 100,
"y": 160,
"wires": [
{
"id": "cee17a2c2fbb48ee"
}
]
}
],
"out": [
{
"x": 560,
"y": 160,
"wires": [
{
"id": "98bf66889d4287db",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "font-awesome/fa-comment",
"status": {
"x": 560,
"y": 220,
"wires": [
{
"id": "cee17a2c2fbb48ee",
"port": 1
}
]
}
},
{
"id": "a062d9e6d44506dc",
"type": "subflow",
"name": "Hue Dynamic Scene Handler",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "cee2f20718ddb03a"
}
]
}
],
"out": [
{
"x": 520,
"y": 40,
"wires": [
{
"id": "78a60e2da212f6aa",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "node-red-contrib-huemagic/hue-group.svg"
},
{
"id": "582b8363c9f33bf8",
"type": "subflow",
"name": "Scene Dropdown Cleanup",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "f1c11209a9226be9"
}
]
}
],
"out": [],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "node-red/mouse.png"
},
{
"id": "7cc13ada.b6712c",
"type": "subflow",
"name": "timerange",
"info": "Lets through or blocks a payload\nbased on a time range. This can\neither be configured through the\nenviroment variables in the node ui\nor as described below with a message\nthat has an override topic.\nIf in range the msg will be passed\nto the first output and otherwise\nto the second.\nThe start and stop time needs\nto be defined in an hh:mm format.\nThere is also a week array. The week\nstarts on monday so 4 for example is\nThursday. Payload will only be passed\non days that are in the array.\nOut of time range payloads will\nbe redirected to the second output.\nThe schedule can be overriden by injecting\na message with the topic of \"override\"\nthat contains a ```msg.payload``` object with the\nkeys of \"start\",\"stop\",\"days\" like\nthis:\n```\n{\n \"start\": \"10:00\",\n \"stop\": \"14:00\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n}\n```\nStart and stop need to be strings in the hh:mm\nformat and days an array of numbers as\ndescribed above.\nThe override can be deleted by injecting a\nmsg.payload string \"reset\".",
"category": "",
"in": [
{
"x": 100,
"y": 100,
"wires": [
{
"id": "da7f7d3f.da5af"
}
]
}
],
"out": [
{
"x": 620,
"y": 60,
"wires": [
{
"id": "694ce0e1.4bee58",
"port": 0
}
]
},
{
"x": 630,
"y": 140,
"wires": [
{
"id": "694ce0e1.4bee58",
"port": 1
}
]
}
],
"env": [
{
"name": "start",
"type": "str",
"value": "00:00",
"ui": {
"icon": "font-awesome/fa-arrow-right",
"label": {
"en-US": "from hh:mm"
},
"type": "input",
"opts": {
"types": [
"str"
]
}
}
},
{
"name": "stop",
"type": "str",
"value": "00:00",
"ui": {
"icon": "font-awesome/fa-circle",
"label": {
"en-US": "until hh:mm"
},
"type": "input",
"opts": {
"types": [
"str"
]
}
}
},
{
"name": "days",
"type": "json",
"value": "[1,2,3,4,5,6,7]",
"ui": {
"icon": "font-awesome/fa-calendar",
"label": {
"en-US": "days"
},
"type": "input",
"opts": {
"types": [
"json"
]
}
}
}
],
"color": "#C7E9C0",
"inputLabels": [
"payload input"
],
"outputLabels": [
"in time range",
"out of time range"
],
"icon": "node-red/switch.svg",
"status": {
"x": 480,
"y": 200,
"wires": [
{
"id": "1bc56c04.ca0a3c",
"port": 0
}
]
}
},
{
"id": "a4ee891237e460a2",
"type": "subflow",
"name": "Main Scenes Handler",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 360,
"wires": [
{
"id": "ca51f6e6bd51fb55"
}
]
}
],
"out": [],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "node-red-contrib-huemagic/hue-scene.svg",
"status": {
"x": 680,
"y": 360,
"wires": [
{
"id": "4ab49b8485f1886f",
"port": 3
},
{
"id": "9af9a2966a477b33",
"port": 3
}
]
}
},
{
"id": "05a2d9f89e72481f",
"type": "subflow",
"name": "Alexa Location (Room)",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "6088f5b9f13e0e36"
}
]
}
],
"out": [
{
"x": 500,
"y": 80,
"wires": [
{
"id": "8e803251d3e3c3ae",
"port": 0
}
]
}
],
"env": [],
"meta": {
"type": "Alexa Subflow"
},
"color": "#DDAA99",
"icon": "node-red-contrib-alexa-remote2-applestrudel/alexa-remote-icon.png",
"status": {
"x": 500,
"y": 140,
"wires": [
{
"id": "8e803251d3e3c3ae",
"port": 1
}
]
}
},
{
"id": "3aa2aec226246753",
"type": "subflow",
"name": "Lifx Testing",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 100,
"wires": [
{
"id": "8b4af77e07c66df9"
},
{
"id": "54f4bebfc9414dbd"
}
]
}
],
"out": [],
"env": [],
"meta": {},
"color": "#DDAA99",
"inputLabels": [
"Inject Node Here"
],
"icon": "node-red-contrib-huemagic/hue-light.svg"
},
{
"id": "85c4f81ca9628aea",
"type": "subflow",
"name": "Tina Desk Scenes Handler",
"info": "",
"category": "",
"in": [
{
"x": 140,
"y": 340,
"wires": [
{
"id": "9cd0aa12d56438c6"
}
]
}
],
"out": [],
"env": [],
"meta": {},
"color": "#DDAA99",
"status": {
"x": 960,
"y": 340,
"wires": [
{
"id": "8ad119b6c6e11ddd",
"port": 0
}
]
}
},
{
"id": "b88bb63bb13eeb27",
"type": "subflow",
"name": "Alexa Location (Entity ID)",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "b05ef328b90665d5"
}
]
}
],
"out": [
{
"x": 500,
"y": 80,
"wires": [
{
"id": "c2a8a3f1f00bc4b7",
"port": 0
}
]
}
],
"env": [],
"meta": {
"type": "Alexa Subflow"
},
"color": "#DDAA99",
"icon": "node-red-contrib-alexa-remote2-applestrudel/alexa-remote-icon.png",
"status": {
"x": 500,
"y": 140,
"wires": [
{
"id": "c2a8a3f1f00bc4b7",
"port": 1
}
]
}
},
{
"id": "17510314e84badd9",
"type": "subflow",
"name": "Team Color Converter",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "664a1a92c5c5546e"
}
]
}
],
"out": [],
"env": [],
"meta": {},
"color": "#DDAA99",
"inputLabels": [
"Hex"
],
"icon": "node-red-contrib-color-convert/color-convert.png"
},
{
"id": "384eaf2f63dcb5db",
"type": "subflow",
"name": "Input Datetime - With Date",
"info": "Takes a timestamp as input at msg.timestamp and converts it to the proper format for an input_datetime with date enabled. Output is on msg.datetime",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "8b3c203e7e901a8c"
}
]
}
],
"out": [
{
"x": 420,
"y": 80,
"wires": [
{
"id": "8b3c203e7e901a8c",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#C0DEED",
"icon": "font-awesome/fa-clock-o",
"status": {
"x": 420,
"y": 140,
"wires": [
{
"id": "8b3c203e7e901a8c",
"port": 0
}
]
}
},
{
"id": "9766d47584651edb",
"type": "subflow",
"name": "Convert Minutes to Seconds",
"info": "Input minutes on msg.duration, and it will output seconds on msg.duration",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "b2d071ca42e4a3c6"
}
]
}
],
"out": [
{
"x": 400,
"y": 80,
"wires": [
{
"id": "b2d071ca42e4a3c6",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#C0DEED",
"icon": "font-awesome/fa-clock-o",
"status": {
"x": 400,
"y": 140,
"wires": [
{
"id": "b2d071ca42e4a3c6",
"port": 1
}
]
}
},
{
"id": "ea629141206d5343",
"type": "subflow",
"name": "User Conversion",
"info": "",
"category": "",
"in": [
{
"x": 60,
"y": 80,
"wires": [
{
"id": "11aabd786c07244f"
}
]
}
],
"out": [
{
"x": 380,
"y": 80,
"wires": [
{
"id": "11aabd786c07244f",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "font-awesome/fa-user",
"status": {
"x": 380,
"y": 140,
"wires": [
{
"id": "11aabd786c07244f",
"port": 1
}
]
}
},
{
"id": "eccca853a916b662",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Upstairs Bathroom Motion Lights",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"a1ee07ab20229b45",
"74c0ced4ac160364",
"d2df58b074b9ba08",
"83686fab02a3d825",
"853abef16fadc824",
"2ad7be43ccdbdeaf",
"ea02f8930aa2c7aa",
"8859759915625e2f",
"3941b4a5b3493461",
"0b122b02cfb10c25",
"31b8c8291d19ffc6",
"34e2055344eea8fe",
"55e84ccb73ae9b74",
"017de174925e8c75",
"2dc5f9d3e00f4ddc",
"86922621398f4b79",
"a1fa2d2d1f55af4b",
"463689442b9d2046",
"5350d2264880d0ad",
"b9741e2e2ed0448b",
"fd33d3e819d8c772",
"f70e4a4480d43b2b",
"5e00ecbccbe51462"
],
"x": 14,
"y": 359,
"w": 1612,
"h": 382
},
{
"id": "39a7ac02f2727f1d",
"type": "group",
"z": "72f99805df043603",
"name": "Kallen Bedroom",
"style": {
"label": true,
"stroke": "#6f2fa0",
"fill": "#9363b7"
},
"nodes": [
"57651381835f659c",
"acb52adc50d34045",
"b4dbbf788c5a30d2",
"d6b56cb65c2ff140",
"e32aaeb51d3f2e95",
"61405a43f61f3d60",
"62211bf089bc5b04",
"d0dacbae4513b1ad",
"7b390a3b24fc3197",
"a417e93366843249",
"17e5f9acd57c2819",
"a8070806c0f88856",
"7b0648758704fad4",
"3937c38bc1bd0ee0",
"f1dbb3a206dba921",
"476f73cf6b540f96",
"46a1e386f7468d21",
"292cda64df0c1c10",
"a2c9a6a52d4d2591",
"7c483301056c67a9",
"a0dd18613130787f",
"324d56cbdc1eb170",
"ec4682a111a48b70",
"5b3a0cf1ee7d06b9"
],
"x": 14,
"y": 839,
"w": 1552,
"h": 462
},
{
"id": "e065b1ed4938b477",
"type": "group",
"z": "72f99805df043603",
"name": "Master Bedroom",
"style": {
"label": true,
"stroke": "#6f2fa0",
"fill": "#9363b7"
},
"nodes": [
"1aa901d26ce8ac46",
"21001f5409130f44",
"bc592ba259667f9d",
"1f7ac875e593d434",
"7a7f626dce181b23",
"6c06c2eec1583c66",
"e2581a5f3f4888df",
"1dfb0bcc98f1457b",
"096369136e9e607f",
"783cfb381b70afc5",
"1eb13d819ba7e226",
"a10629857d60f774",
"a8ef744455bb4c0a",
"9c01880c6319d29b",
"94c022d2eb71e7d5",
"ce5d8005cbf08144",
"7646c6833d5a1df2",
"8286284fc9598efa",
"cbe37fd5b5fc4381",
"5def5d2440e767b3",
"d153c7a7f050ce84",
"b1c0cca848416d74",
"73c2d06e9114a0f6",
"e914726b0364c6be",
"d613dbf3643d1d4a",
"9014f9e42a6b7c54",
"abd1783e6054329c",
"6a731b17c05f0496",
"86c9f3a3185215fc",
"b7ac7e6a2ad9f5df",
"92ce51a81f7bc58d",
"08335765e8c7eac0",
"b5cfb253dc157cc9",
"6fb6d8041e1a4cad",
"ade887c45bde00f1",
"d6c81a79393be92c",
"88b10efda9e2c047",
"96cf0949902f8572",
"6bbf7df2c43c481e",
"02f922bba32e4c71",
"ffa5d38853e1360a",
"5cce5b011ebc5d32",
"6f4235c9d4f6a6ea",
"862666f576addab8",
"bcef7debc9bda36c",
"5ee549aa5e97d4a5",
"b4d619d31ec9121d",
"d1dd42ebc53343df",
"1fc55a133a7d82c4"
],
"x": 14,
"y": 11.5,
"w": 1312,
"h": 809.5
},
{
"id": "5c50443a84910fb7",
"type": "group",
"z": "3e4ba157b540d183",
"name": "Tina Schedule Management",
"style": {
"label": true
},
"nodes": [
"4d724735025b0ed8",
"6ec62f6cf4fcf994",
"31ce8ad28dd41226",
"20271b0662a4d5df",
"16bf625c802d7910",
"a32c37ccf0102258",
"d5c6b45df763e57e",
"6f011420f6bb15a7",
"74bb3d48dd17bef9",
"486bca43ddc48fb8",
"d2c017d8f8c1dc68",
"7a6299413cbbbdcf",
"92c97bdd3ffb345d",
"1fd2518454b8b8a1",
"cc54107a01eca8c2",
"80fcb34c004369e7",
"5f0f296e4f242dfe",
"d2d529b327823c22",
"8fe032f757ed2b62",
"1e1eb662bad16e38",
"149704b9f6497881",
"b6cb206d9cb34610",
"b3ff9d6b11d09cc9",
"1e11dbd040532f1b",
"2a12efb509915160",
"b8ee23476d011484",
"edb4d8fcc9fe02e0"
],
"x": 34,
"y": 179,
"w": 1292,
"h": 382
},
{
"id": "477e752fcd2e2a19",
"type": "group",
"z": "ee67610b4a0578d2",
"name": "House Announcement System",
"style": {
"label": true
},
"nodes": [
"a4c477269b22f766",
"5095d45c90d5304f",
"3ae21589dd88c080",
"93b7bee28a7e896e",
"b2bc83c9195efe0f",
"f4bfbaca4d7fb1df"
],
"x": 14,
"y": 39,
"w": 1192,
"h": 82
},
{
"id": "46275dd0f9461013",
"type": "group",
"z": "ffa6a885ac41a5ed",
"name": "Functionality",
"style": {
"label": true
},
"nodes": [
"b109c8db1c2cd259",
"75a50e8dac7af692",
"baae5d6f53900594",
"619d1474239faf58",
"ca88f85ba00a6744",
"1d84f0da59682160"
],
"x": 34,
"y": 319,
"w": 532,
"h": 202
},
{
"id": "ff6d8150e8d5e606",
"type": "group",
"z": "b0286fae9f2ce547",
"name": "Living Room Entertainment Mode",
"style": {
"label": true
},
"nodes": [
"3a29cecbefa6cbe2",
"4a2031f363418db1",
"984386fa0a6369d6",
"0beae13503166379",
"6c77ade442a47a30",
"6392f2f0586d988a",
"e505e9f24bf919dd",
"9efd5346a1ca1972",
"8b53b9f4d5ba0bf0",
"cc8f6ab710549be2",
"346379575efad516",
"8b0b39deb5142557",
"7cb8056b3b41a9e8",
"d2390789a8b3101a",
"d961ffeaea408909",
"107f2c88924975fe",
"ed2e0f4f214ad76c",
"6110b45c374a5b7f",
"e5af55b177f37c65",
"27b2c22907382e6d",
"f111c40459e27629",
"33903d3f8f53dadd",
"f463df7e17e045e9",
"4c98b4516ab685ac"
],
"x": 34,
"y": 19,
"w": 1272,
"h": 502
},
{
"id": "208284848b13b85b",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Front Door Awareness",
"style": {
"label": true,
"stroke": "#ff0000",
"fill": "#ff3f3f"
},
"nodes": [
"97a441f1ac510844",
"fbe3667814a51f6f",
"ec543bc9adac3d08",
"d4019d35bf5a5f98",
"25e12d8e4a0a7f11",
"e91c3392b59ff9d1",
"981191938ab4ee2f",
"59af14a564176ce4",
"3c83c0ab0aa96e3d",
"7b71cb1967ec5255",
"03fad0a960ff39e7",
"c0933fcc8737bc0b"
],
"x": 94,
"y": 179,
"w": 1032,
"h": 322
},
{
"id": "1ca205a84922c8c2",
"type": "group",
"z": "4a8821853d4dd1ad",
"name": "Finish",
"style": {
"label": true
},
"nodes": [
"923538ef97772f0c",
"a3e3dc438a7b95fc",
"fe1ba086baf93ec0",
"50056b099a24a824",
"d8e2d16e313b938a",
"b0c92a72557d0ac6",
"408795055634e897",
"0a441953c41a18ae",
"08a22fa71fce5e91",
"d580c539c554a4c1",
"f0cc7b3b9622312a",
"206e512c5268020f",
"4da18a3f1e0298db",
"283661388275a459"
],
"x": 34,
"y": 559,
"w": 1012,
"h": 382
},
{
"id": "5595964c8367c984",
"type": "group",
"z": "ee67610b4a0578d2",
"name": "Text Notification System",
"style": {
"label": true
},
"nodes": [
"98626a8f2b59bde3",
"db6d955c039873be",
"d2fec32d385dae8c",
"0145961e8276c53e",
"fd623c46a558a01a",
"c52cae79eb97bcc0",
"6b039ef7895476e2",
"f44427c5a493c428"
],
"x": 14,
"y": 139,
"w": 1152,
"h": 242
},
{
"id": "eeafd13be593ae69",
"type": "group",
"z": "b5717a86ce55bc29",
"name": "Front Porch Light Timer",
"style": {
"label": true,
"stroke": "#92d04f",
"fill": "#addb7b"
},
"nodes": [
"091390f43bfeddf5",
"7a7229eb69c9b1a3",
"f34816b23181f21e",
"bd75b077a1c76fce",
"b69eeb738bbd4bdb",
"cfdcc7c9c168dc17",
"16029ccf061bdd10",
"d2751bc2cfc5af8f",
"435280acadb9f364",
"ec5937bc60874009",
"defcae57f9916394",
"459433738b64d14d",
"a2ec35a79d79bf2f",
"9a8c39dc1a0c20e6",
"8c29a2e1a06c5524",
"c7a8df4ebeb3b5c5",
"77759257dd9c9465",
"3a5bb57569e07beb",
"76815f07ec2f3eef",
"f5fb96bf1a33b3cd"
],
"x": 54,
"y": 119,
"w": 1492,
"h": 282
},
{
"id": "0c81dfaed25d225c",
"type": "group",
"z": "9a8e84bd2945505e",
"name": "Amazon Package Delivered",
"style": {
"label": true
},
"nodes": [
"11f5f6e0f1e4da25",
"3250ca66d8342dd8",
"6091f5e58812f97f",
"32816b7834e1b318",
"02cd94391e205cd9",
"059eaa30829a743e",
"a71c61b06a3e7b0d",
"1504548e7ebc3844",
"d8b6743cb853018d",
"ddbbde89f52be826",
"9726bd70b6b83774",
"5fbac3420d43ef9d",
"d336afe957a65e33",
"e2f0e53daa198581",
"398d300c5d0b6db5",
"d92ae2f7fd3171b5",
"96496719d1c09515",
"15fde8d3275b8455",
"fe7b309fe37cf8e2",
"458ddfa9d748f88f",
"37bdac2c9a4e2837"
],
"x": 54,
"y": 39,
"w": 1652,
"h": 382
},
{
"id": "8aee4d340a136bac",
"type": "group",
"z": "eff21041cc941fef",
"name": "Downstairs Bathroom",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"5123a607588fa737",
"f84e6b5157e857cf",
"b7d94cd0e420c650",
"41a8d5ef20cf55d7",
"3e40025ac99ec712",
"8d2e7fb5f214879c",
"b281061a4b08d2eb"
],
"x": 14,
"y": 879,
"w": 612,
"h": 262
},
{
"id": "550e5b2d99316b12",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Basement On",
"style": {
"label": true,
"stroke": "#0070c0",
"fill": "#3f93cf"
},
"nodes": [
"1f5808147fa975cf",
"1966d10d8f4467c7",
"a9bc78f321149316",
"b3bb08ff51e46985",
"0c7ef72bd0ef47d4",
"795c53ad6642733a",
"ea5306d6f92d9550",
"4829663e9913e2aa",
"61cb79c998ee0b59",
"73078f818abdc6c2",
"2516c6e3146cc851",
"d6e7197427bb4d1b",
"4b7ed8ad595ee9cb",
"b7022ac46a70a7d8",
"a64928d7a0b836cf",
"aecc95a3db3369e2",
"bd6bdc6ed9aded9d",
"3bd0a22c66de228a"
],
"x": 94,
"y": 839,
"w": 992,
"h": 322
},
{
"id": "f519aff597ece351",
"type": "group",
"z": "bb961e59e2ef86c9",
"name": "iOS Actions",
"style": {
"label": true
},
"nodes": [
"14c6951746b58a38",
"533921a587f031d4",
"65240dc52617459d",
"d3763c0194214956",
"638703bd017d6e5b",
"bc5f205fd5e7582e",
"1516f464e4d87c56",
"e21a948e9523bce7",
"6ec2fd7aaaf1fc98",
"c5e9589db7e0b0bf",
"50cf93faa2e3996c",
"89f6119d5702185b",
"15ae48c0b6e70f36",
"572b2040be874f4e",
"b57e12eb73074535",
"93b718cd47747ccc",
"c8af362d48d5c0ad",
"3463c4f2bf6388fe",
"9d1cf8af02a6c86b"
],
"x": 54,
"y": 39,
"w": 852,
"h": 682
},
{
"id": "26f91eb2ef77450d",
"type": "group",
"z": "bb961e59e2ef86c9",
"name": "iOS Notification Actions",
"style": {
"label": true
},
"nodes": [
"f5aff29df4e07a4a",
"7107656a6cbecce7",
"6bb57058f0a576e7",
"e97b782efaaf5976",
"d8c62e34298105b4",
"900c251ff10a2f5b",
"2a0e3a76af7ab628",
"53102bdc5d885602",
"a169eca7f3f1df15",
"2b63f908be8296d0",
"0be3c318e9e6df0a"
],
"x": 64,
"y": 759,
"w": 1022,
"h": 162
},
{
"id": "a46fc8e7e70ca893",
"type": "group",
"z": "4a8821853d4dd1ad",
"name": "Start/Pause",
"style": {
"label": true
},
"nodes": [
"7fc67fc156c0f4be",
"34dcb204b421710d",
"797d3e7cc53d773f",
"e69ad4771494c458",
"fdf9b6820eb7289a",
"5c44fd504453ae63",
"908543f7b78f7beb",
"dd0be4a0dd77e1db",
"d6728df5d1fdf67e",
"ae7073e78053da5d",
"6b086807971b2618",
"6736626753b33834",
"736d7433005436b3",
"0aa29248b560c45d",
"b8ca8a1a2655570b",
"24abb932c4cd0b1f",
"c0521b53f7efeb17",
"95d5ac486b4f9ee0",
"49767cbfa622a734",
"04113ab4977bf725",
"93a52960301bb3a3",
"0e39331337b021bb",
"82172c8ab1a9c8e2",
"afeb1d238a623c3d",
"49dbe17ff03ed572",
"9612270d4cdfbf07",
"1a0adfa82fff507a",
"27ae9c023ee2d1f6",
"88d088ea70f0030a",
"86c7f29776a59797"
],
"x": 34,
"y": 39,
"w": 1812,
"h": 502
},
{
"id": "6504d94aaaf9b8d9",
"type": "group",
"z": "ffa6a885ac41a5ed",
"name": "Power Stats",
"style": {
"label": true
},
"nodes": [
"ce8a6bb6e9460f13",
"ce5a2ea26f26e421",
"abb6e16585d7fe61",
"aa9b2f0ddc5b77d3",
"0a8426dd99cbaeec",
"8813b152ed76b96c",
"9833b2aff0f97ea9",
"51d05298561cfddb"
],
"x": 34,
"y": 39,
"w": 672,
"h": 262
},
{
"id": "265593f442864b6a",
"type": "group",
"z": "3e4ba157b540d183",
"name": "Climate Variables",
"style": {
"label": true
},
"nodes": [
"a09f10883f07aad0",
"464e9271285f8450",
"9c8056404bfcafed",
"a8d7f5e5d4f549b0",
"706c517f3575c162",
"4a507797422a5369",
"a232c2f584013596",
"738e35a2f51ff0e0"
],
"x": 34,
"y": 579,
"w": 792,
"h": 302
},
{
"id": "931cc27100c9317e",
"type": "group",
"z": "3e4ba157b540d183",
"name": "Last Alexa",
"style": {
"label": true
},
"nodes": [
"04fdddae578ee136",
"266634bf3c6019c8",
"4560584de593b5c1",
"488e4f61d16705d4",
"1f3142828a586d08",
"f9bc4d36a0df7947"
],
"x": 34,
"y": 899,
"w": 672,
"h": 222
},
{
"id": "6e83103b5c5311e9",
"type": "group",
"z": "3e4ba157b540d183",
"name": "Jarvis Voice",
"style": {
"label": true
},
"nodes": [
"e8d2135bb5564a4a",
"f6f45d3e3cf9aeab",
"40c9c33453179a21",
"b49f0642ce0153c6",
"a75651492e779bfc"
],
"x": 34,
"y": 19,
"w": 912,
"h": 142
},
{
"id": "88f099618e56926d",
"type": "group",
"z": "458e4c0055c8c533",
"name": "Master Bedroom",
"style": {
"label": true
},
"nodes": [
"9256f78107619596",
"fbd0b0d52ef452d5",
"1f44e8f6e98317a7",
"efec6f0b8a4ea382",
"cfcebd8452629535",
"0bfb330d42161fe7",
"216ebd5138f63087",
"e82fb1576245b7c7",
"67e6798433b7bc37",
"99c141f21de4feda"
],
"x": 74,
"y": 39,
"w": 1132,
"h": 262
},
{
"id": "a6de35af12739885",
"type": "group",
"z": "458e4c0055c8c533",
"name": "Kallen Bedroom",
"style": {
"label": true
},
"nodes": [
"5f4a234984a654e1",
"9ad1aee4f432c0da",
"33f1bded52754848",
"72052e61710200f9",
"9c2ea97d481e6428",
"56140b60b6406bd7",
"067bcc91d6a04be5",
"7f3909f76041b209",
"724f186878227dad"
],
"x": 74,
"y": 339,
"w": 1132,
"h": 202
},
{
"id": "0804d9edeca1c9fa",
"type": "group",
"z": "458e4c0055c8c533",
"name": "Emma Bedroom",
"style": {
"label": true
},
"nodes": [
"eff279edcac37798",
"adcce6ca1e459cd1",
"49a842a41a52f8f3",
"e036fd18c5d20645",
"9621d4c881da0188",
"a5a387d3522f49ed",
"53f8d279114dd476",
"4523045453de0a33"
],
"x": 74,
"y": 579,
"w": 1092,
"h": 202
},
{
"id": "385f03591bc34bcc",
"type": "group",
"z": "3e4ba157b540d183",
"name": "Temperature",
"style": {
"label": true
},
"nodes": [
"274be2385ae894ce",
"15f7382daddb4b3e",
"cc6386853b678420"
],
"x": 34,
"y": 1139,
"w": 632,
"h": 82
},
{
"id": "31767ffd6a647579",
"type": "group",
"z": "eff21041cc941fef",
"name": "Doorbell Alert",
"style": {
"label": true,
"stroke": "#92d04f",
"fill": "#addb7b"
},
"nodes": [
"c983b44381b46ab5",
"bc3e0a041efec910",
"2c351b21e13b7289",
"71e6ae54dc1b958b",
"41ababe9cfbe1297",
"c0ce3c040d25e0a1",
"e67a2b594c648ac6",
"e8510a6c66cd84e6",
"2ebe03f5023de47c",
"12e827e7416c9dac",
"e3ecd23a34c7f82e",
"58b11f0c0353d67b",
"45df5f447e52cb0f",
"e23e7b080ee3773f",
"1e1059008d19c0ee"
],
"x": 14,
"y": 359,
"w": 1532,
"h": 282
},
{
"id": "1cc8b382530c33d0",
"type": "group",
"z": "b0286fae9f2ce547",
"name": "Basement Entertainment Mode",
"style": {
"label": true
},
"nodes": [
"496fafb580e8af1b",
"6253b68980f8bbca",
"19907ff0b6cef449",
"98d5f1fa7001b848",
"8535d555f858eb5c",
"d2d07f8ee20733d0",
"7d266754621825e7",
"d41365c49024c8eb",
"c71a9ea311a86b7f",
"5d582639d1f6a501",
"cb285727507f50da",
"2a8f44429acdd1ea",
"50b997d6e5680e6e",
"65aaba2528dfde3d",
"55962141df8ef164",
"5ff13862fb36f90e",
"99fccb06d0ae097b",
"f3efe80c6ffa4522",
"74d645f646c713d2",
"cb68f561b5023b31",
"8146f43fea5aec03"
],
"x": 34,
"y": 539,
"w": 1192,
"h": 502
},
{
"id": "b9ffa3fa5af46ec3",
"type": "group",
"z": "ebd5561c4f077718",
"name": "Weather Briefing",
"style": {
"label": true
},
"nodes": [
"5d7c63526234945e",
"7aaddacf84721c78",
"6b5d3e550ad76528"
],
"x": 34,
"y": 39,
"w": 752,
"h": 82
},
{
"id": "4329e464360d0afa",
"type": "group",
"z": "ebd5561c4f077718",
"name": "Lightning",
"style": {
"label": true,
"stroke": "#ff0000"
},
"nodes": [
"d7c2eec75c6063ea",
"75c4dc9367328035",
"abb24271518ddd9b",
"6f29823ba252aef8",
"b6e069ac0ebfe31a",
"6c529210810a63a8",
"b4b80e91a535923e",
"1180e4c40c3ec0fa",
"b64b61c5bfd91293",
"70f795fb061cbfef",
"7809c760322bf72a",
"8ffd3e28319fc173",
"be9ebf6d2f7e18d0",
"b2c0d6629b2603b7",
"c268e2512a503e2a",
"1e79cbc1d6e8f507",
"dbfb74297b6ecd61",
"81c14eac4de9dd9d",
"a586df67c15b0914",
"4738fd26d0e16bd4",
"84f3e5a7cf5cdfc7",
"50a2a473686b0445",
"33fcb96a4c2c2541",
"a4d27381bd614fd1",
"8a84615173fd7e97",
"f260e2410571356a",
"b497fe229c8f2eea",
"f47a0d107875d550"
],
"x": 34,
"y": 139,
"w": 1592,
"h": 422
},
{
"id": "395da9d5d5f7e232",
"type": "group",
"z": "d49b385d8b582b20",
"name": "Context Examples",
"style": {
"label": true
},
"nodes": [
"c80bec9a15b703f6",
"8687551e01cd2045",
"103b03c39c8d9cae",
"c043cba9f34ba574",
"e674c706437cc0f3",
"11f8fb75d4c4e6c0",
"1346e34e8c83b2dc",
"62d522a844321ef9",
"6d109daff443dade",
"4e1848c867860d5f",
"3102e176923a8fad"
],
"x": 34,
"y": 719,
"w": 732,
"h": 282,
"info": "https://stackoverflow.com/a/74399359"
},
{
"id": "c3dc29879117218b",
"type": "group",
"z": "d49b385d8b582b20",
"name": "Climate Tester",
"style": {
"label": true
},
"nodes": [
"5848c6edf2bd06fe",
"3bb9755d18f517d6",
"c52f61fa427a773c",
"d71d65c0e52926b1",
"84b00411dee5fc6a",
"8a4b246d2356d8f4",
"d275a12c1817925e",
"4d9e5c1bade281af",
"330eaf3afee1c405",
"c59db4f3f0112244",
"8846ee22051b92cc",
"4731a08756c9235f",
"62f2704dca41ea4b",
"93072f995377775b",
"34c4939c3dd1f7d1",
"71f5f2a1557b28ea",
"b233bf44f92d413d",
"a1020d4eaab8a8e5",
"7aa9383895c46e30",
"401d1612749a4d86",
"514057723d9662e0",
"1df32d98b498c875",
"192260163c49816a",
"79f3ceee718cd7cb",
"14181143d23aa423",
"f9e1aec6c25f6480",
"0693239363c59c3e",
"44b7eabdec8197a3"
],
"x": 34,
"y": 19,
"w": 752,
"h": 682
},
{
"id": "50e4d951ee7b3e54",
"type": "group",
"z": "873eb2575d6e9014",
"name": "Report System",
"style": {
"label": true
},
"nodes": [
"f803c6af3a30eb66",
"a6234b2047ba3116",
"427cc2991454bbf0",
"7674185d1e5ee489",
"9e43408e18883dfe",
"84c8fd3cc1ab7cf1",
"c66df253518a4507",
"2b6f06b27b6deb92",
"a64cee24cd3523c5",
"e2e2d2fb7277cde3",
"ea0bab7efe2d570d",
"f8330684e1ccac8d",
"d31d41f3e474e0c1",
"6d9c53b7dd7b0cf3",
"c5e85490ce1d4a57"
],
"x": 34,
"y": 19,
"w": 1452,
"h": 222
},
{
"id": "23b02b1256dfd302",
"type": "group",
"z": "ffa6a885ac41a5ed",
"name": "Mosquitto",
"style": {
"label": true
},
"nodes": [
"939abd584ee8580a",
"6b17d7fa4de2b620",
"e2a8c8b2638be79f",
"96baea4b0d08d151",
"8357b66291d6f498",
"76eb43f2c84142f8",
"1dc56852c1691e89",
"b2a69c7d24c170ad",
"0f107a6c4d46cdc8",
"79822e9d0a97457c",
"ef26acc3d75b5b93",
"d790797e62163c2b",
"463eb1286393993a",
"396cee5f3aa5255f",
"af22ad5de7f824ed",
"cb37ef0a4c6a0d4b",
"538a80f1ef807ce5",
"8bc88748bdc7fec8",
"ca36c535f62a938b",
"fe5a9d13c3acdf8a",
"704c78f0839b0cbf",
"a98df8034046bdc1",
"fe27369f5d336321",
"1812eb70af41b475",
"6e7294be1430b43a",
"60b562a91a724301",
"ed548a3f33ed2137",
"9df778270aff32c7",
"5f6468dc8b022b6b",
"5486cc70a2a83cd0",
"c95f5ac879cfef5d",
"ccebc1def6a944d9",
"a675ad54d1ec36fa",
"0723c20ffd541ca7",
"6596ad2f0c91a78c",
"bb4ca3d4e66d87a5"
],
"x": 734,
"y": 39,
"w": 512,
"h": 802
},
{
"id": "f16f28689b7ec2b4",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Stairwell",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"f18aab5a5bda9a84",
"293a957a5c4f79fa",
"96e7237a63089317",
"33ba5ffd653f09a1",
"0df82708f1ef261c",
"48c2ad199a4ab538",
"4e3d058c164d6a97",
"76423fc24fedb52c",
"48c5c102461f0981",
"b05b87a1e43f11f9",
"ef677459c795d246",
"1f1489a0514e233b"
],
"x": 14,
"y": 759,
"w": 792,
"h": 382
},
{
"id": "ba738e13229c781b",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Emma Bedroom",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"c3f2a4aa281295ce",
"3b698d0a4f2620bd",
"55c893b1d3009fed",
"b058c2262ac522ff",
"b542615d3dee41f6",
"fc25e2a837ec8229",
"440fc7142e7345d4",
"cef61cdb2808ce5a",
"0367216416de8b4d",
"03075516f3003707",
"2e356bc6f1ad80dc",
"c9d498c1e323b1e4",
"f7bd6d5fabdba0e0",
"515f7471cec7bce2",
"ca85b450d07da81c",
"40dae72402f8cdee",
"bb3469b3ec117aab"
],
"x": 14,
"y": 1159,
"w": 812,
"h": 502
},
{
"id": "0f7fdf39e4400032",
"type": "group",
"z": "eff21041cc941fef",
"name": "Living Room",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"87d449113f439710",
"29c0dbf6add54879",
"7305cfffd320c75a",
"f511cce02d6ad811",
"130c6ac167cd49f0",
"7c33144c3e356edf",
"bcbc098444744cbb",
"f31cabbf0dd66d75",
"c96c398bc26cfc26"
],
"x": 14,
"y": 659,
"w": 1132,
"h": 202
},
{
"id": "dcdfa098347020de",
"type": "group",
"z": "eff21041cc941fef",
"name": "Back Door",
"style": {
"label": true,
"stroke": "#92d04f",
"fill": "#addb7b"
},
"nodes": [
"74f9d2bf4a8c0b53",
"5e7a082800eeb73c",
"f0ef9a565f72dcae",
"1238a342e440e582"
],
"x": 774,
"y": 19,
"w": 812,
"h": 82
},
{
"id": "c4c2c79b692236a0",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Basement Shutdown",
"style": {
"label": true,
"stroke": "#0070c0",
"fill": "#3f93cf"
},
"nodes": [
"56c84e793b8b0d79",
"9751c5a6a1b98b7d",
"a4490fb4765e1c9c",
"0cfd7edd88cfa0de",
"4c7184cd35bf3f1f",
"4681a8b5fa2d942c",
"09dd0d2cf254619e",
"bbcf0451ac4c4cd4",
"f052c9629cad7a5f",
"80c5f8a40169fcb7",
"a9bbf53b9584976a",
"cc0407d29b656ca6",
"fc1ca3e2f921b01e",
"18cd2aed123cdaa8",
"8851dbeb9b28003a",
"06b3f795ae9e14e6",
"15c84d12d17ac254",
"b947106d8f7b72ed",
"d575b0381d31edaa"
],
"x": 94,
"y": 1179,
"w": 1492,
"h": 382
},
{
"id": "553ecd620357c03d",
"type": "group",
"z": "5c4ac37140a54ac9",
"name": "Kallen Activity Commands Flow",
"style": {
"label": true
},
"nodes": [
"8c4d01db6f6ef33e",
"20ede2b52515bc63",
"88c56b0964f9a6db",
"38e168a79848fa19",
"86cd67e28114a585",
"5926b0004a47dfd1",
"50982205a91e63c5",
"254ffc8e8bd1d414",
"c43b69d84deb44a4",
"65589264d77f668d",
"6167d4da61990bfb",
"2aa8397f85a8ceed",
"9f1c60a822a2b550",
"dff1ff1e18a1bc74",
"9e3c9006ff125d9b",
"efd47cbc26ed2810",
"75e1b9f265ecb4e5",
"c2212b77414c61f3",
"1383f8e6ebf8ad88",
"7d53b4bd4c7ea874",
"4726a2605a1f56cc",
"506e7e645cf06383",
"716d4f60c2af0f2e"
],
"x": 54,
"y": 479,
"w": 1192,
"h": 262
},
{
"id": "ab4dbcc968a1d346",
"type": "group",
"z": "eff21041cc941fef",
"name": "Mud Room",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"de9fe68a439b4c41",
"7c4cc52be117251f",
"a7cd304d11f25e60",
"ddae3391e8b78cb8",
"0c70e666ebfcd6c1",
"67d04dc394a23636",
"d4c7136ad434c2b5",
"95fe501e85a5f65b",
"5d9a85d3534d83e6",
"fa7c83f1dece9741"
],
"x": 14,
"y": 1159,
"w": 792,
"h": 322
},
{
"id": "5c1df7492351b925",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Kallen Bedroom",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"f3824e4c7e202605",
"4954c509d4d697e2",
"9a8f53db7d3ed3b7",
"bbe9fd4eff4e6a04",
"f6aca47ad4719dab",
"1a63ea711d6658b2",
"0b5424aadc3479f7",
"5524e8ba9b5545be"
],
"x": 874,
"y": 759,
"w": 612,
"h": 262
},
{
"id": "505e378279011759",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Master Bedroom",
"style": {
"label": true,
"stroke": "#001f60",
"fill": "#3f5787"
},
"nodes": [
"e270c73896a1a50c",
"3063e6a5b5c3f677",
"31686303c43971c7",
"f14572686bbbbf9e",
"602869aebc96184c",
"cfb6cf1f5f583447",
"4a431478798a51c8",
"81129efa6676b58e"
],
"x": 874,
"y": 1039,
"w": 612,
"h": 262
},
{
"id": "d70533ec9ef234f6",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Do Not Enter",
"style": {
"label": true,
"stroke": "#ff0000",
"fill": "#ff3f3f"
},
"nodes": [
"b62ba31a1b35ef47",
"e8b5f4ace78d485a",
"d7b73ee4a2387bfa",
"6e5bbaefb1d2c14e",
"117e6e67bd4c2794",
"efa4a1761da0b38d",
"6d1291b96a8c9e83",
"b8648d760ccc1aa2",
"e8097cd64b17370a",
"9d5f6c64408c0b6a",
"21496cb5b59bf2fb",
"be40ebfb2514fdb2",
"724968ddc9702720",
"195c2b19593434e1",
"e75fda5ea26d23e5"
],
"x": 94,
"y": 519,
"w": 1412,
"h": 302
},
{
"id": "1f3d367ed3e35f1f",
"type": "group",
"z": "ce79e27ec84983a9",
"name": "Doorbell Battery Saver",
"style": {
"label": true
},
"nodes": [
"85f64d70ea1ad38b",
"3762233dfe00d338",
"0c394f2de9bd9917",
"eb4303c234c0f911",
"5173aa5c7adb827a",
"b36a4f453c2a06b2",
"977f5fdca9aaa918",
"42a6971dbcdf2dd7",
"160249109f0b494a",
"090187e752453a53"
],
"x": 74,
"y": 59,
"w": 1292,
"h": 162
},
{
"id": "d782e62a03a086e0",
"type": "group",
"z": "ebd5561c4f077718",
"name": "Defiance Weather Alerts",
"style": {
"label": true
},
"nodes": [
"8f8450555dd6ac73",
"c8a8f9eb6f370ae2",
"ad598f14adf7a284",
"895863cc6c4cc732",
"724bd8b20f6442fd",
"26c646de6e0b35d7",
"b3e4269945739cfd",
"90a129b1d1a3f1c0",
"b004375f406eccef",
"86435078e9067a09",
"a2af8db4d82d572c",
"9958da4d6712625b"
],
"x": 34,
"y": 579,
"w": 692,
"h": 262
},
{
"id": "d96ff91f5f860dcc",
"type": "group",
"z": "ebd5561c4f077718",
"name": "National Weather Alerts",
"style": {
"label": true
},
"nodes": [
"ca1f406359324108",
"9825ebb82719c364",
"10ca3d9808f3da42",
"6e65ea4c68e8520c"
],
"x": 34,
"y": 859,
"w": 732,
"h": 142
},
{
"id": "3e78b849c3a85b84",
"type": "group",
"z": "5c4ac37140a54ac9",
"name": "Going Upstairs",
"style": {
"label": true
},
"nodes": [
"80761160776018a1",
"c3b3c90a43c4481a",
"12ad9b1c6c0e05bd",
"28d9251be3529bfe",
"2b2b73eed26a4ac6",
"8d992470168b48db",
"27862f1fd0313891",
"c7302971bce3d542",
"96cb27c48ddd3087",
"adb36e61e39c7fa9",
"8c4ddac65fd3b245",
"56a4fbb75463258c",
"881f3f534e5cc523",
"b077b050fad45521",
"b1f93c10edc4ff47"
],
"x": 54,
"y": 19,
"w": 972,
"h": 442
},
{
"id": "fc9cdd0818afd119",
"type": "group",
"z": "3e4ba157b540d183",
"name": "User ID List",
"style": {
"label": true
},
"nodes": [
"430d9054095580f1",
"7b2670a81b8d3967"
],
"x": 34,
"y": 1239,
"w": 392,
"h": 82
},
{
"id": "c098aadcd6f83f58",
"type": "group",
"z": "d49b385d8b582b20",
"name": "Context Tester",
"style": {
"label": true
},
"nodes": [
"1a2b9228fd8343b7",
"f614d201285aac68",
"9e59e83b39d1ce29"
],
"x": 794,
"y": 319,
"w": 632,
"h": 82
},
{
"id": "8bee7892a01cf63b",
"type": "group",
"z": "d49b385d8b582b20",
"name": "History Tester",
"style": {
"label": true
},
"nodes": [
"d812ee2f617dd583",
"d417bebd83c3e0fe",
"a89d872a45eae06c",
"d8facf95084f1638"
],
"x": 794,
"y": 419,
"w": 792,
"h": 82
},
{
"id": "5802ea32c1de36e8",
"type": "group",
"z": "72f99805df043603",
"name": "Emma Bedroom",
"style": {
"label": true,
"stroke": "#6f2fa0",
"fill": "#9363b7"
},
"nodes": [
"e0ccc1c73ecf40cb",
"c0b160cbf7cb26d9",
"2370770ce10c8a17",
"69a01541c0c04367",
"4a4335e390443134",
"be5db4b6e0dc6207",
"a2635913609af931",
"3421222c0667a9ef",
"c9d1ed9d0ea401e6",
"34d7881576b29949",
"1e2abb7eff658e81",
"f5d407ee3f07dee6",
"b4f3d9fd20c0637e",
"ccb3a655b7d6836b",
"7561647f2cdf58d3",
"8c5fb72719e1917d",
"fc5cad0242d957aa",
"33d2a06ed0659a13",
"61f25466213cb85c",
"f6755ee93883b34d",
"7631b8823839f4b1",
"884ffbd2493411f9",
"15b160d6bfe30b15",
"03c668f84022cc23",
"a273dadf7a256af1",
"8bb8dc720af76714",
"bb9595faa1592fd9",
"ddef9ad0ac0a98a0",
"71b1c6e934b85637",
"334a79e6f5f3a16a",
"2718f2695ff412fa",
"7d50b11bbf5de8fd",
"53b440a31d30df1b",
"f1f2ac113fe2b639",
"b96ad84b569ac360",
"894e510fd44b01e0",
"eee837a3c93b3abd",
"2a02683008423af4",
"057eda6b0cd976d9",
"6f9810d3986b67d9",
"15e2eb94a67c7024",
"77082c90f1eb9c32",
"88037340df0708d0"
],
"x": 14,
"y": 1319,
"w": 1092,
"h": 742
},
{
"id": "a09584861c2fe558",
"type": "group",
"z": "72f99805df043603",
"name": "Master Bedroom Climate Debugging",
"style": {
"stroke": "#ff0000",
"fill": "#3f93cf",
"label": true
},
"nodes": [
"ffe28978275ac1a4",
"e2c62d1cba780500",
"2d79ecea5a6f4fa8",
"7bd9e989743a6aa2",
"3257d2fe36755d37",
"74783fb85da3edbe",
"002858f9b16ed975",
"97f433c699d1f83e",
"1f2b0cb7e79e145a",
"62b761bce85aecb7"
],
"x": 1374,
"y": 79,
"w": 352,
"h": 622
},
{
"id": "bf0e3e8c2f5a5474",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Tina",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"49dbd6d6cba1b010",
"a0c7649e26e66ddb",
"898659d514aa58fd",
"35d7371023527600",
"9ae7e308f889137d",
"edaa6ff605ba6fa7",
"bcdf2e5f1249631d",
"7992545819db1a42",
"ec497068c3a61d02",
"10228956c46b8d7a",
"2851173db6835eda",
"82c0fb65066f3b67",
"7fbab2c7cb7ecc92",
"5e72a180d8f0232d",
"9d03fda88310da78",
"8a22032494f84cae",
"8c910479678a8f5e"
],
"x": 74,
"y": 399,
"w": 1192,
"h": 422
},
{
"id": "7821289ad49774c9",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Tony",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"134433d6e21dab5b",
"77857e77d43a9d2e",
"379edcf9fe985ebe",
"e6bdfba61c73d081",
"7169f007c32ccc46",
"41aa4436b55474b2",
"bf504c30194524b9",
"0a039e097233b977",
"8c7c1cd31a824cd5",
"24a89088d5503778",
"f54ba77dfe1e7ba4"
],
"x": 74,
"y": 59,
"w": 652,
"h": 322
},
{
"id": "6a0fc544a641af5f",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Outdoor",
"style": {
"stroke": "#92d04f",
"fill": "#addb7b",
"label": true
},
"nodes": [
"26f15fc8d75a4020",
"47aa56df01f697fc",
"c46dfcaa9a2798f0",
"05547a934bbcab4d",
"ff44de8d65439a5f",
"5f8b61ddc9963e99",
"0ba46659c49cf39a",
"025e65a78727f99e",
"788f7cfdfa2fdef9"
],
"x": 744,
"y": 59,
"w": 672,
"h": 282
},
{
"id": "6c0f29670fcc9493",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Kallen",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"cd4d8dd6b1d34f49",
"5193627a30d1b32d",
"fb1afc4c2078ca29",
"43048b96595e3e97",
"8e081e76e5f19ead",
"156d50efeaeb681c",
"8a450e797b413418",
"8584a491587be9a2",
"547753c8de135e69"
],
"x": 74,
"y": 839,
"w": 872,
"h": 262
},
{
"id": "e74c2fa5c53fd805",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Parents",
"style": {
"stroke": "#001f60",
"fill": "#3f5787",
"label": true
},
"nodes": [
"351ac66c934832eb",
"df53af0726555079",
"331ed2d217025fd1",
"0eaa398b977e03b5",
"63dc161e193d33c5",
"84a56bf51e79fd4d",
"8811ce1d8dacd3b1"
],
"x": 74,
"y": 1119,
"w": 712,
"h": 202
},
{
"id": "205da12d712d058b",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Nerds",
"style": {
"stroke": "#001f60",
"fill": "#3f5787",
"label": true
},
"nodes": [
"663b5401ea953d2d",
"802ff36b76e55809",
"a999c33047fc3b61",
"84a2692b31e7d7d8",
"bf5f6c5af1c02315",
"dafcce5a61b19f8b",
"4e97de53400335b9"
],
"x": 74,
"y": 1339,
"w": 712,
"h": 202
},
{
"id": "c19f180ec1dc0bcf",
"type": "group",
"z": "3abb5ae57afb4761",
"name": "Family",
"style": {
"stroke": "#001f60",
"fill": "#3f5787",
"label": true
},
"nodes": [
"028e16d90ac7433d",
"d5a9248680297b56",
"b8ef333da370f91e",
"1ac137ebc9f53e3c",
"66b7ec9a7e332cca",
"bebba6e7a61461b8",
"96ebe81b6e20112e"
],
"x": 74,
"y": 1559,
"w": 712,
"h": 202
},
{
"id": "98e38052d1cc2f9b",
"type": "group",
"z": "eff21041cc941fef",
"name": "Room Scenes",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"d95d9964546768a5",
"bdab41af28f2c7cd",
"7c224927d50a5f97",
"e689231430e9c829",
"d790134891fedfcc",
"5a81041c4a1390b8",
"b19f4a996fd4c2ee",
"85e820743550308b"
],
"x": 14,
"y": 19,
"w": 742,
"h": 322
},
{
"id": "fd15bf62ba5e5171",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Room Scenes",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"879ee8903841b8f0",
"bc2426cfcd5afbe8",
"a5498446c1edffa9",
"f28e7fd88f75041e",
"e1123236ee16fdaf",
"a17d58585048335d",
"fba69dfc80829db7"
],
"x": 14,
"y": 19,
"w": 632,
"h": 322
},
{
"id": "c1e37f193ee65d73",
"type": "group",
"z": "5e238cbbe6d612c9",
"name": "Auto Shower Mode",
"style": {
"stroke": "#ffC000",
"fill": "#ffcf3f",
"label": true
},
"nodes": [
"b26bc471bcac2653",
"b51f19fa5b3d1587",
"646ac99f62432e22"
],
"x": 674,
"y": 19,
"w": 672,
"h": 82
},
{
"id": "a60d1c8190059645",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Room Scenes",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"07049ae77b6751c6",
"31c254f61982f19d"
],
"x": 14,
"y": 19,
"w": 512,
"h": 82
},
{
"id": "d00eb21154ac4160",
"type": "group",
"z": "47f17992fab9b4f5",
"name": "Furnace Room Auto Off",
"style": {
"stroke": "#ffC000",
"fill": "#ffcf3f",
"label": true
},
"nodes": [
"dd3608c864d7007b",
"5e31d6aacad206b8",
"18599ab162ab225b",
"e79ecc6c79946cc4",
"ab01d3d95c7ea717",
"8fa363e9e0c1b165"
],
"x": 634,
"y": 19,
"w": 792,
"h": 142
},
{
"id": "628bc6d9078cb924",
"type": "group",
"z": "b5717a86ce55bc29",
"name": "Porch Scenes",
"style": {
"stroke": "#6f2fa0",
"fill": "#9363b7",
"label": true
},
"nodes": [
"af64b56e28c93907",
"3747d0c21057f3a6"
],
"x": 54,
"y": 19,
"w": 472,
"h": 82
},
{
"id": "277dd697dbcfe9c7",
"type": "group",
"z": "b5717a86ce55bc29",
"name": "Storm Mode",
"style": {
"stroke": "#ff0000",
"fill": "#ff3f3f",
"label": true
},
"nodes": [
"d2709b4d48275a22",
"ef4722474ddd6df7",
"994d4b415cfc1726",
"68701ec04bbaacf0",
"2d4e34f55fca3d30",
"742fb59053708930",
"6d9c29e9ac683246",
"d6ef529ccde504ef",
"1bc2077d7cfb57ed",
"6073a1ffd782cbde",
"616e794707796e49",
"b6fa25d3e17bf7ac"
],
"x": 54,
"y": 419,
"w": 1272,
"h": 262
},
{
"id": "af295df6d8fdd3ad",
"type": "group",
"z": "72f99805df043603",
"name": "Emma Bedroom Climate Debugging",
"style": {
"stroke": "#ff0000",
"fill": "#3f93cf",
"label": true
},
"nodes": [
"7472fd892bcfc621",
"975328c94dcd31e7",
"22ddbddb684f7163",
"c40516c637bc1a7e",
"7593f77568c03db2",
"30679e01160e2e2e"
],
"x": 1134,
"y": 1319,
"w": 332,
"h": 382
},
{
"id": "47549405aaedc6f1",
"type": "group",
"z": "ebd5561c4f077718",
"name": "Forecast Entity Testing",
"style": {
"label": true
},
"nodes": [
"de16ad92780444f2",
"2d06a77584e4e574",
"9e7ed6a540af8244",
"ff5f40842aabee0c",
"f8902210998462c9",
"a6ab36701f1cf2b1",
"f9a0ba239938c0d5"
],
"x": 794,
"y": 579,
"w": 812,
"h": 262
},
{
"id": "f4057835848d0904",
"type": "group",
"z": "9824adcf61e30734",
"name": "Goodnight",
"style": {
"label": true
},
"nodes": [
"ba97906b7b81342c",
"d9e39b8ebb86c941",
"09c7a61f7a4c4d05",
"280e2a7895ca63fb",
"60ce44747cf3e507",
"50e351d1ee6108b3",
"33773b3aaa551b79",
"f30486c8e11db0e4",
"9bd4665845af0545",
"20b3699a56b0e901",
"f3df71ec460b7609",
"775777f1c01e424c",
"334c28e08be1db12",
"de09ef54cbab864a",
"5c919106ebd7c9d4",
"75072695f27adae7"
],
"x": 54,
"y": 239,
"w": 1092,
"h": 322
},
{
"id": "7d1c0a1099be4427",
"type": "group",
"z": "9824adcf61e30734",
"name": "Good Morning",
"style": {
"label": true
},
"nodes": [
"105271e0816c6a52",
"2854170262757e84",
"5c9c73b7adb72896",
"c18d27a9438bfa08",
"ef0efdc23805d872",
"bad6373b442c58a1",
"54b8bca62d27e659",
"708843ea29ee6626",
"bb77b36dd4d9cc96",
"2fb85204eb56f86b",
"3778a9f4cb80ce0b"
],
"x": 54,
"y": 19,
"w": 1072,
"h": 202
},
{
"id": "f5eea6eac47f79a8",
"type": "group",
"z": "ebd5561c4f077718",
"name": "Station Pressure to SLP",
"style": {
"label": true
},
"nodes": [
"e8dbc16027e1addb",
"350e11750f05c353",
"7da31d8bd0d544bd"
],
"x": 794,
"y": 859,
"w": 712,
"h": 82
},
{
"id": "ac8b0a46f1caa685",
"type": "group",
"z": "d49b385d8b582b20",
"name": "Cron Plus Tester",
"style": {
"label": true
},
"nodes": [
"ac3afbb7.56f7a8",
"65892a57.612d44",
"e55fda59.f37f18",
"8a452815.9ceb68",
"e60daf12.48c83",
"16c930f5.ec3a9f",
"ad104abb.fc4a28",
"9126a056.6de91",
"e8abe66.6a0aa18",
"9e8a3202.ae3d9",
"276fbb6f.b78e94",
"540f9bdc.808cf4",
"f7509f08.69bb9",
"e057de86.30bfa",
"b247f14a.cf2f",
"6ea9b27a.04bf6c",
"4a1dc32e.9dbf1c",
"6dde0693.66ed08",
"27e00c01.1fd474",
"221cb0d1.2321f",
"482be49c.66898c",
"3c39c8ac.e11a08",
"7945501b.3547",
"7ad3fa7f.e3acd4",
"5f323eb9.e9f7d",
"48b74cdb.647ea4",
"94553308.0c403",
"2db145e3.78f78a",
"9ac1b61.86b6d48",
"81b4094b.d0d778",
"b3512276.df97c",
"3696700bebc8823a",
"ed094c20ad524768",
"cafa8a6b489484b7",
"2f01ee1169769867",
"4d4d04563f14bf1e"
],
"x": 794,
"y": 519,
"w": 872,
"h": 1102
},
{
"id": "fba69dfc80829db7",
"type": "junction",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"x": 320,
"y": 60,
"wires": [
[
"a17d58585048335d"
]
]
},
{
"id": "34e2055344eea8fe",
"type": "junction",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"x": 1080,
"y": 520,
"wires": [
[
"5e00ecbccbe51462"
]
]
},
{
"id": "6f4235c9d4f6a6ea",
"type": "junction",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"x": 340,
"y": 560,
"wires": [
[]
]
},
{
"id": "7d50b11bbf5de8fd",
"type": "junction",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"x": 400,
"y": 1780,
"wires": [
[]
]
},
{
"id": "9e87348d.9c1c48",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": false,
"heartbeat": false,
"heartbeatInterval": "",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
},
{
"id": "fd29421fc00140a8",
"type": "mqtt-broker",
"name": "",
"broker": "192.168.1.251",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "be975ce229701797",
"type": "alexa-remote-account",
"name": "",
"authMethod": "proxy",
"proxyOwnIp": "192.168.1.26",
"proxyPort": "3456",
"cookieFile": "/config/node-red/alexa_auth",
"refreshInterval": "3",
"alexaServiceHost": "pitangui.amazon.com",
"pushDispatchHost": "",
"amazonPage": "amazon.com",
"acceptLanguage": "en-US",
"onKeywordInLanguage": "on",
"userAgent": "",
"usePushConnection": "on",
"autoInit": "on",
"autoQueryActivityOnTrigger": "on"
},
{
"id": "f14ef3df2209e9a7",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Send Alexa Message",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Send Alexa Message"
},
{
"property": "icon",
"value": "mdi:bullhorn"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "ad5b1d9f1ea8fea1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Good Morning",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Good Morning"
},
{
"property": "icon",
"value": "mdi:weather-sunset-up"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "a8da4d03a2922c42",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Weather Briefing",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Weather Briefing"
},
{
"property": "icon",
"value": "mdi:weather-cloudy"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "30f1658baee9378e",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Goodnight",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Goodnight"
},
{
"property": "icon",
"value": "mdi:weather-night"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "04976a7418728aa3",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Restart AppDaemon",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Restart AppDaemon"
},
{
"property": "icon",
"value": "mdi:restart"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "457914a2c9dc72c1",
"type": "google-home-conf",
"username": "tm24fan8"
},
{
"id": "fd929ec3bfbeef1a",
"type": "discord-token",
"name": "Nerd Overlord"
},
{
"id": "8860321096392e94",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Weather Briefing Google",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Weather Briefing Google"
},
{
"property": "icon",
"value": "mdi:weather-cloudy"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "998d8d67ec377dd3",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Daily Briefing",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Daily Briefing"
},
{
"property": "icon",
"value": "mdi:weather-sunset-up"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "9c84afc610ced7b6",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Daily Briefing Google",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Daily Briefing Google"
},
{
"property": "icon",
"value": "mdi:weather-sunset-up"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "738e7f8f2ac71049",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Sunset Lights Trigger",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Sunset Lights Trigger"
},
{
"property": "icon",
"value": "mdi:lightbulb-alert"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "be9ed28696adcdb0",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Master Bedroom Night Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Night Mode"
},
{
"property": "icon",
"value": "mdi:lightbulb-night"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "59cb8692ed7accd1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Master Bedroom Day Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Day Mode"
},
{
"property": "icon",
"value": "mdi:sun"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "9c63750f16f845ea",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Master Bedroom Bedtime Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Bedtime Mode"
},
{
"property": "icon",
"value": "mdi:bed"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "675dd216a61c575b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Send Report",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Send Report"
},
{
"property": "icon",
"value": "mdi:bug"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "fbc65f8185932b5f",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Kallen Timer Start",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Kallen Timer Start"
},
{
"property": "icon",
"value": "mdi:play"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "d3f8c4466cc1deeb",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Master Bedroom Fan Only",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Fan Only"
},
{
"property": "icon",
"value": "mdi:fan"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "d9da4bd707013bc5",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Kallen School Status",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Kallen School Status"
},
{
"property": "icon",
"value": "mdi:bus"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "2c222901ee192ba1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Kallen School Status Google",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Kallen School Status Google"
},
{
"property": "icon",
"value": "mdi:bus"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "60eb53fb94cd64e4",
"type": "lifx-config",
"token": "c9c9ac0dbbfa906c8a5c6ea51af2857ed4f9631fa41053e67268eaf0b897f51d"
},
{
"id": "f040a57e80fda8ee",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"name": "Send Text Notification",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Send Text Notification"
},
{
"property": "icon",
"value": "mdi:message-alert"
},
{
"property": "device_class",
"value": ""
}
]
},
{
"id": "0df0d4b823c241ca",
"type": "ical-config",
"url": "webcal://p72-caldav.icloud.com/published/2/ODM5MDk5NTE5ODM5MDk5NR0HVUW-Vl-m45F7V86TDotlk2-IoVPJ7u9SJ4CgaxkUnwXfBv2X3Td4TIRw64EwIf2-usGEsd6zG21yi63A5PY",
"caldav": "",
"caltype": "ical",
"name": "Family Calendar",
"replacedates": false,
"usecache": false,
"username": "",
"password": "",
"calendar": "",
"pastWeeks": "0",
"futureWeeks": "4"
},
{
"id": "527f99f7a7aa36c2",
"type": "ha-device-config",
"name": "Tina Work Tomorrow",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "781adad6153d9661",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "527f99f7a7aa36c2",
"name": "Tina Work Tomorrow",
"version": "6",
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Tina Work Tomorrow"
},
{
"property": "icon",
"value": "mdi:calendar"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false
},
{
"id": "415bf4eba63b9a50",
"type": "ha-device-config",
"name": "Cleanup",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "23e5e32354cf867a",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Basement On Manual",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Basement On Manual"
},
{
"property": "icon",
"value": "hue:room-stairs"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "e27ae85e2a296e7c",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Early Night Mode",
"version": "6",
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Early Night Mode"
},
{
"property": "icon",
"value": "mdi:lightbulb-night-outline"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "503ba5fd53d97d51",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Kallen Activities",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Kallen Activities"
},
{
"property": "icon",
"value": "mdi:timer"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "a26fa856149e18bd",
"type": "ha-device-config",
"name": "Last Alexa Sensors",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "4118a859da3ae01f",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "a26fa856149e18bd",
"name": "Last Alexa Name",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Last Alexa Name"
},
{
"property": "icon",
"value": "mdi:volume-high"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "790a5433342e7eb5",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "a26fa856149e18bd",
"name": "Last Alexa Serial",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Last Alexa Serial"
},
{
"property": "icon",
"value": "mdi:volume-high"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "4d3001dabc174efe",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "a26fa856149e18bd",
"name": "Last Alexa Entity ID",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Last Alexa Entity ID"
},
{
"property": "icon",
"value": "mdi:volume-high"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "d7208904f97a76d6",
"type": "ha-device-config",
"name": "Tina Work",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "3577b1d6ba521c18",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "d7208904f97a76d6",
"name": "Tina Work Start Zone",
"version": "6",
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Tina Work Start Zone"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "e5f345a03a1ef184",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "d7208904f97a76d6",
"name": "Tina Work End Zone",
"version": "6",
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Tina Work End Zone"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "81cb9d95d14a3e5a",
"type": "add-todoist-api-token",
"name": "Tony"
},
{
"id": "1f10335891b41077",
"type": "ha-device-config",
"name": "Nerdhome Sports",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "95180a63dc83b944",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "1f10335891b41077",
"name": "Active Sporting Event",
"version": "6",
"entityType": "select",
"haConfig": [
{
"property": "name",
"value": "Active Sporting Event"
},
{
"property": "icon",
"value": "mdi:baseball-bat"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "options",
"value": [
"Michigan Wolverines",
"Ohio State Buckeyes",
"Toledo Rockets",
"Minnesota Vikings",
"San Francisco 49ers",
"Cleveland Guardians",
"Minnesota Twins",
"Los Angeles Dodgers"
]
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "dc557449c40eba5e",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "1f10335891b41077",
"name": "Watching Sports",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Watching Sports"
},
{
"property": "icon",
"value": "mdi:baseball-bat"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "c7a23a2b967375ec",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "1f10335891b41077",
"name": "Team Score",
"version": "6",
"entityType": "number",
"haConfig": [
{
"property": "name",
"value": "Team Score"
},
{
"property": "icon",
"value": "mdi:counter"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "points"
},
{
"property": "min_value",
"value": 0
},
{
"property": "max_value",
"value": 150
},
{
"property": "step_value",
"value": 1
},
{
"property": "mode",
"value": "box"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "f64cc18b786d7352",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "1f10335891b41077",
"name": "Opponent Score",
"version": "6",
"entityType": "number",
"haConfig": [
{
"property": "name",
"value": "Opponent Score"
},
{
"property": "icon",
"value": "mdi:counter"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "points"
},
{
"property": "min_value",
"value": 0
},
{
"property": "max_value",
"value": 150
},
{
"property": "step_value",
"value": 1
},
{
"property": "mode",
"value": "box"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "77c0d6f8dd47a65b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Master Bedroom Climate Reset",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Climate Reset"
},
{
"property": "icon",
"value": "mdi:backup-restore"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "39198b07403764b1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "1f10335891b41077",
"name": "Sports Room",
"version": "6",
"entityType": "select",
"haConfig": [
{
"property": "name",
"value": "Sports Room"
},
{
"property": "icon",
"value": "mdi:baseball-bat"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "options",
"value": [
"Living Room",
"Basement Studio",
"Both"
]
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "aebd1e9ea95e45da",
"type": "ha-device-config",
"name": "Laundry Tracking",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "5627513f9469cbb8",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "aebd1e9ea95e45da",
"name": "Washer Start",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Washer Start"
},
{
"property": "icon",
"value": "mdi:washing-machine"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "d2d7710df0394f16",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "aebd1e9ea95e45da",
"name": "Dryer Start",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Dryer Start"
},
{
"property": "icon",
"value": "mdi:tumble-dryer"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "52dccff6d2c39667",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "aebd1e9ea95e45da",
"name": "Washer Cancel",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Washer Cancel"
},
{
"property": "icon",
"value": "mdi:washing-machine-off"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "9da998d5f74df33c",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "aebd1e9ea95e45da",
"name": "Dryer Cancel",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Dryer Cancel"
},
{
"property": "icon",
"value": "mdi:tumble-dryer-off"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "7d2b67c31769ed69",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Doorbell Rings",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Node Red Doorbell Alert"
},
{
"property": "icon",
"value": "mdi:doorbell-video"
}
],
"resend": false
},
{
"id": "8e399b2a287a0905",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Master Bedroom Cooling",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Cooling Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "314752dbc6fd170d",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Master Bedroom Fan",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Fan Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "d7261338e6b907f1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Master Bedroom Wakeup",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Wakeup Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "d5784e5baa80a105",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Kallen Bedtime",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Kallen Bedtime Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "9e1418c3e9595312",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Kallen Wakeup",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Kallen Wakeup Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "308fce46bd959bce",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Kallen Fan Time",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Kallen Fan Schedule"
},
{
"property": "icon",
"value": ""
}
],
"resend": false
},
{
"id": "7cc6440f2cdd8a6b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Lightning Warning",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Node Red Lightning Warning"
},
{
"property": "icon",
"value": "mdi:lightning-bolt"
}
],
"resend": false
},
{
"id": "77ba0ad52b2a9e2e",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "exposed as for Overwolf Events Dump",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Overwolf Events Dump"
},
{
"property": "icon",
"value": "mdi:test-tube"
}
],
"resend": false
},
{
"id": "21461835f9233213",
"type": "ha-device-config",
"name": "Mosquitto Stats",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "b78174a1b561ea3f",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Received 1min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Received 1min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "acbe15cbb8457f35",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Received 5min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Received 5min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "e023cc05d1c0cecb",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Received 15min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Received 15min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "7f5c52481ee5041b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Sent 1min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Sent 1min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "b1afb202ae5b94cf",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Sent 5min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Sent 5min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "608fb2f833106a54",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Sent 15min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Sent 15min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "3a3de00eeef75917",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Dropped 1min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Dropped 1min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "01b4bc2b7f492cac",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Dropped 5min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Dropped 5min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "58b262f448b7831a",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Dropped 15min",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Dropped 15min"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "63b391b64c920d72",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Uptime",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Uptime"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "seconds"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "06c585be926ee13b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Messages Received",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Messages Received"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "20642905379cffe9",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Messages Sent",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Messages Sent"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "3e54ec9fa6f987bc",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "21461835f9233213",
"name": "Mosquitto Messages Stored",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Mosquitto Messages Stored"
},
{
"property": "icon",
"value": "mdi:database"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "messages"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": true,
"debugEnabled": false
},
{
"id": "2bdf556c5a30e5d5",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Downstairs Bathroom Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Downstairs Bathroom Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "e86f48a9dd99dd2b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Stairwell Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Stairwell Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "f3f1bf31d66d2f88",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Emma Bedroom Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "4a9187b8b68e4181",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Living Room Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Living Room Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "8a6ada44f455b396",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Going Upstairs",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Going Upstairs"
},
{
"property": "icon",
"value": "hue:room-stairs"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "c5511d32d6044b83",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Mud Room Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Mud Room Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "5053909a498e0d02",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Kallen Bedroom Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Kallen Bedroom Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "9a5af08b3c421d41",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Master Bedroom Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Master Bedroom Motion Lighting"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "b721c7240c08272f",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Upstairs Bathroom Motion Lighting",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Upstairs Bathroom Motion Lighting"
},
{
"property": "icon",
"value": "mdi:motion-sensor"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "48a08ecc20e474e9",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Auto Shower Mode",
"version": "6",
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Auto Shower Mode"
},
{
"property": "icon",
"value": "mdi:shower"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "a11aaf0288452997",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "415bf4eba63b9a50",
"name": "Cleanup",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Cleanup"
},
{
"property": "icon",
"value": "mdi:broom"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false
},
{
"id": "61d19879e4bd1c55",
"type": "ha-device-config",
"name": "Defiance Weather Alerts",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "d8ea9407aa2cf6a5",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "61d19879e4bd1c55",
"name": "Severe Thunderstorm Warning",
"version": 6,
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Severe Thunderstorm Warning"
},
{
"property": "icon",
"value": "mdi:weather-lightning"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": "safety"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "4eaaca1b829b7144",
"type": "ha-device-config",
"name": "National Weather Alerts",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "3983b0de296263e9",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "4eaaca1b829b7144",
"name": "National Severe Thunderstorm Warnings",
"version": 6,
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "National Severe Thunderstorm Warnings"
},
{
"property": "icon",
"value": "mdi:weather-lightning"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "warnings"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "450c0778c403dffc",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "4eaaca1b829b7144",
"name": "National Tornado Warnings",
"version": 6,
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "National Tornado Warnings"
},
{
"property": "icon",
"value": "mdi:weather-tornado"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "warnings"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "294b242ba5cfb3fb",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "61d19879e4bd1c55",
"name": "Tornado Warning",
"version": 6,
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Tornado Warning"
},
{
"property": "icon",
"value": "mdi:weather-tornado"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": "safety"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "920ee00b5ff0ba8b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "61d19879e4bd1c55",
"name": "Tornado Watch",
"version": 6,
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Tornado Watch"
},
{
"property": "icon",
"value": "mdi:weather-tornado"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": "safety"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "e7ae774638e7cc11",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "61d19879e4bd1c55",
"name": "Severe Thunderstorm Watch",
"version": 6,
"entityType": "binary_sensor",
"haConfig": [
{
"property": "name",
"value": "Severe Thunderstorm Watch"
},
{
"property": "icon",
"value": "mdi:weather-lightning"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "9643a7993e266372",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Emma Door Alert",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Emma Door Alert"
},
{
"property": "icon",
"value": "mdi:door"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "7d7c641acaff9284",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Emma Door Alert Cancel",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Door Alert Cancel"
},
{
"property": "icon",
"value": "mdi:cancel"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "47b0f8d963c82cce",
"type": "ha-device-config",
"name": "Emma Bedroom Climate",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "6bbeae1a731c6fa2",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Bedtime Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Bedtime Mode"
},
{
"property": "icon",
"value": "mdi:bed"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "a7edd9c339d922b1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Cooling Schedule",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Cooling Schedule"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "a41edb9d72f72766",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Wakeup",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Wakeup Schedule"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "774a5097399e1169",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Night Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Night Mode"
},
{
"property": "icon",
"value": "mdi:lightbulb-night"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "46dadc28a60d6dd8",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Day Mode",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Day Mode"
},
{
"property": "icon",
"value": "mdi:sun"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "41b47b5dcb51a9c7",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Climate Reset",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Climate Reset"
},
{
"property": "icon",
"value": "mdi:backup-restore"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "0295918c27c0b70b",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Fan Only",
"version": 6,
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Fan Only"
},
{
"property": "icon",
"value": "mdi:fan"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "3ce4b28fb7c060b0",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "47b0f8d963c82cce",
"name": "Emma Bedroom Climate Watchdog",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Emma Bedroom Climate Watchdog"
},
{
"property": "icon",
"value": "mdi:lock-check"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "8371db473f46baf2",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Front Porch Storm Mode",
"version": 6,
"entityType": "switch",
"haConfig": [
{
"property": "name",
"value": "Front Porch Storm Mode"
},
{
"property": "icon",
"value": "mdi:lightning-bolt"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "8f61788e0c4471e1",
"type": "ha-entity-config",
"server": "9e87348d.9c1c48",
"deviceConfig": "",
"name": "Home Tempest Local SLP",
"version": 6,
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "Home Tempest Local SLP"
},
{
"property": "icon",
"value": "mdi:gauge"
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": "atmospheric_pressure"
},
{
"property": "unit_of_measurement",
"value": "inHg"
},
{
"property": "state_class",
"value": "measurement"
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "afead614fabc01bb",
"type": "function",
"z": "a42343e035e3313c",
"name": "",
"func": "const alexa = global.get('lastAlexaSerial')\nlet statusMsg = {\n \"payload\": alexa\n}\n\nmsg.where = alexa\n\nreturn[msg,statusMsg]",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 80,
"wires": [
[],
[]
]
},
{
"id": "1102574d15bdad4c",
"type": "delay",
"z": "a42343e035e3313c",
"name": "",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 180,
"y": 80,
"wires": [
[
"afead614fabc01bb"
]
]
},
{
"id": "388878f6056fa3e4",
"type": "function",
"z": "4107976aa434eb03",
"name": "Conversions",
"func": "msg.data.main.temp = ((msg.data.main.temp - 273.15) * 1.8) + 32\nmsg.data.main.feels_like = ((msg.data.main.feels_like - 273.15) * 1.8) + 32\nmsg.data.main.temp_min = ((msg.data.main.temp_min - 273.15) * 1.8) + 32\nmsg.data.main.temp_max = ((msg.data.main.temp_max - 273.15) * 1.8) + 32\nmsg.data.main.pressure = msg.data.main.pressure * 0.029529983071445\nmsg.data.wind.speed = msg.data.wind.speed * 2.237\nmsg.data.wind.gust = msg.data.wind.gust * 2.237\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 190,
"y": 80,
"wires": [
[
"80ce4b42b82e3c78"
]
]
},
{
"id": "80ce4b42b82e3c78",
"type": "function",
"z": "4107976aa434eb03",
"name": "Rounding",
"func": "const temp = msg.data.main.temp\nconst feels_like = msg.data.main.feels_like\nconst temp_min = msg.data.main.temp_min\nconst temp_max = msg.data.main.temp_max\nconst pressure = msg.data.main.pressure\nconst windspeed = msg.data.wind.speed\nconst windgust = msg.data.wind.gust\n\nmsg.data.main.temp = +temp.toFixed(1)\nmsg.data.main.feels_like = +feels_like.toFixed(1)\nmsg.data.main.temp_min = +temp_min.toFixed(1)\nmsg.data.main.temp_max = +temp_max.toFixed(1)\nmsg.data.main.pressure = +pressure.toFixed(2)\nmsg.data.wind.speed = +windspeed.toFixed(2)\nmsg.data.wind.gust = +windgust.toFixed(2)\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 80,
"wires": [
[]
]
},
{
"id": "98bf66889d4287db",
"type": "api-call-service",
"z": "6429099c4571dd6b",
"name": "Speech Engine",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.speech_engine",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": topic,\t \"message\": payload,\t \"voice\": voice,\t \"type\": type\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "speech_engine",
"x": 420,
"y": 160,
"wires": [
[]
]
},
{
"id": "cee17a2c2fbb48ee",
"type": "function",
"z": "6429099c4571dd6b",
"name": "Processing",
"func": "const livingRoom = [\"Living Room\", \"Living Room Echo Dot\"]\nconst basementAlexa = [\"Basement\", \"Basement Echo Dot\"]\nconst basementGoogle = [\"Basement Google\", \"basement_google\"]\nconst kallenBedroom = [\"Kallen Bedroom\", \"Kallen Bedroom Speaker\"]\nconst emmaBedroom = [\"Emma Bedroom\", \"Emma Bedroom Speaker\"]\nconst kidsBedrooms = [\"Kids Bedrooms\"]\nconst allBedrooms = [\"All Bedrooms\"]\nconst masterBedroom = [\"Master Bedroom\", \"Master Bedroom Echo Dot\"]\nconst commonAreas = [\"Common Areas\"]\nconst alexaEverywhere = [\"alexa_everywhere\", \"Alexa Everywhere\"]\nconst room = msg.topic\nconst voice = msg.voice || global.get(\"jarvis_voice\", \"diskCon\")\nconst type = msg.type || \"normal\"\n\nif (livingRoom.includes(room)) {\n msg.topic = \"living_room\"\n} else if (basementAlexa.includes(room)) {\n msg.topic = \"basement\"\n} else if (basementGoogle.includes(room)) {\n msg.topic = \"basement_google\"\n} else if (kallenBedroom.includes(room)) {\n msg.topic = \"kallen_bedroom\"\n} else if (emmaBedroom.includes(room)) {\n msg.topic = \"emma_bedroom\"\n} else if (kidsBedrooms.includes(room)) {\n msg.topic = \"kids_bedrooms\"\n} else if (allBedrooms.includes(room)) {\n msg.topic = \"all_bedrooms\"\n} else if (masterBedroom.includes(room)) {\n msg.topic = \"master_bedroom\"\n} else if (commonAreas.includes(room)) {\n msg.topic = \"common\"\n} else if (alexaEverywhere.includes(room)) {\n msg.topic = \"alexa_everywhere\"\n} else if (room === \"Everywhere\") {\n msg.topic = \"everywhere\"\n}\n\nmsg.voice = voice\nmsg.type = type\n\nlet statusMsg = {\n \"status\": {\n \"fill\": \"green\",\n \"shape\": \"dot\",\n \"text\": `${msg.voice} speaking in ${room}`\n }\n}\n\nnode.send([msg,statusMsg])",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 160,
"wires": [
[
"98bf66889d4287db"
],
[]
]
},
{
"id": "cee2f20718ddb03a",
"type": "function",
"z": "a062d9e6d44506dc",
"name": "Format",
"func": "const tpc = msg.topic\nconst pld = msg.payload\nlet dest = tpc.replaceAll(\"_\",\" \")\nlet scene = pld.replaceAll(\"_\",\" \")\n\nmsg.topic = dest\nmsg.payload = scene\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 160,
"y": 40,
"wires": [
[
"78a60e2da212f6aa"
]
]
},
{
"id": "78a60e2da212f6aa",
"type": "api-call-service",
"z": "a062d9e6d44506dc",
"name": "Hue Activate Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "hue.hue_activate_scene",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"group_name\": topic,\t \"scene_name\": payload,\t \"dynamic\": \"true\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "hue",
"service": "hue_activate_scene",
"x": 370,
"y": 40,
"wires": [
[]
]
},
{
"id": "0515d266dc983793",
"type": "api-call-service",
"z": "582b8363c9f33bf8",
"name": "Record Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.{{topic}}_selected_scene"
],
"labelId": [],
"data": "{\t \"value\": payload\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 340,
"y": 40,
"wires": [
[
"2fc6ea08f8f366b6"
]
]
},
{
"id": "2fc6ea08f8f366b6",
"type": "api-call-service",
"z": "582b8363c9f33bf8",
"name": "Reset Dropdown",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_first",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.{{topic}}_scenes"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_first",
"x": 550,
"y": 40,
"wires": [
[]
]
},
{
"id": "f1c11209a9226be9",
"type": "function",
"z": "582b8363c9f33bf8",
"name": "",
"func": "const pld = msg.payload\nconst tpc = msg.topic\nlet scene = pld.replaceAll(\"_\",\" \")\n\nglobal.set(`activeScene.${tpc}`, scene, \"diskCon\")\n\nmsg.payload = scene\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 160,
"y": 40,
"wires": [
[
"0515d266dc983793"
]
]
},
{
"id": "694ce0e1.4bee58",
"type": "function",
"z": "7cc13ada.b6712c",
"name": "is in range?",
"func": "const schedule = flow.get(\"schedule\");\nlet start = env.get(\"start\");\nlet stop = env.get(\"stop\");\nlet days = env.get(\"days\");\nif(schedule !== undefined){\n start = schedule.start;\n stop = schedule.stop;\n days = schedule.days;\n}\nconst time = new Date();\nlet day = time.getDay();\nif(day === 0) day = 7;\nlet hour = String(time.getHours());\nlet minute = String(time.getMinutes());\nif(hour.length == 1) hour = \"0\" + hour;\nif(minute.length == 1) minute = \"0\" + minute;\nconst hmtime = hour + \":\" + minute;\nif(days.includes(day)){\n if(start == stop){\n return [msg, null];\n } else if(start > stop){\n if(hmtime >= start || hmtime < stop){\n return [msg, null];\n } else {\n return [null, msg];\n }\n } else if(hmtime >= start && hmtime < stop){\n return [msg, null];\n } else {\n return [null, msg];\n }\n} else {\n return null;\n}",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 100,
"wires": [
[],
[]
]
},
{
"id": "94dc9c00.0f576",
"type": "inject",
"z": "7cc13ada.b6712c",
"name": "",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 170,
"y": 200,
"wires": [
[
"1bc56c04.ca0a3c"
]
]
},
{
"id": "1bc56c04.ca0a3c",
"type": "function",
"z": "7cc13ada.b6712c",
"name": "display rule",
"func": "const schedule = flow.get(\"schedule\");\nif(typeof schedule == \"object\"){\n const start = schedule.start;\n const stop = schedule.stop;\n const days = String(schedule.days).replace(/1/g,\"Mo\").replace(/2/g,\"Tu\").replace(/3/g,\"We\").replace(/4/g,\"Th\").replace(/5/g,\"Fr\").replace(/6/g,\"Sa\").replace(/7/g,\"Su\");\n msg.payload = \"override: \" + start + \"-\" + stop + \"/\" + days;\n} else {\n const start = env.get(\"start\");\n const stop = env.get(\"stop\");\n const days = String(env.get(\"days\")).replace(/1/g,\"Mo\").replace(/2/g,\"Tu\").replace(/3/g,\"We\").replace(/4/g,\"Th\").replace(/5/g,\"Fr\").replace(/6/g,\"Sa\").replace(/7/g,\"Su\");\n const override = false;\n msg.payload = start + \"-\" + stop + \"/\" + days;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 200,
"wires": [
[]
]
},
{
"id": "da7f7d3f.da5af",
"type": "function",
"z": "7cc13ada.b6712c",
"name": "check for override",
"func": "if(msg.topic == \"override\"){\n flow.set(\"schedule\",msg.payload);\n return [null, msg];\n} else if (msg.payload == \"reset\"){\n let reset;\n flow.set(\"schedule\",reset);\n return [null, msg];\n} else {\n return [msg, null];\n}",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 250,
"y": 100,
"wires": [
[
"694ce0e1.4bee58"
],
[
"1bc56c04.ca0a3c"
]
]
},
{
"id": "942a915b6599fb27",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.{{topic}}_{{payload}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 930,
"y": 460,
"wires": [
[]
]
},
{
"id": "a89c7e8905a07998",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Reset",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.{{topic}}_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 550,
"y": 360,
"wires": [
[]
]
},
{
"id": "8c4d4fe614a52d4f",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Apply Adaptive Lighting",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "adaptive_lighting.apply",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"entity_id\": adaptive,\t \"adapt_brightness\" : brightness,\t \"adapt_color\" : color\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "adaptive_lighting",
"service": "apply",
"x": 1530,
"y": 280,
"wires": [
[]
]
},
{
"id": "c19b4dccc5d6a9af",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Nightlight Set",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_{{nightlight}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_sleep_mode_{{topic}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_{{nightlight}}",
"x": 750,
"y": 460,
"wires": [
[
"942a915b6599fb27"
]
]
},
{
"id": "3a4f567b17b2214e",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Nightlight Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_sleep_mode_{{topic}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 930,
"y": 280,
"wires": [
[
"f41c0229b9fdcea4"
]
]
},
{
"id": "f41c0229b9fdcea4",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Turn Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.{{topic}}_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1120,
"y": 280,
"wires": [
[
"970f719de254a1e7"
]
]
},
{
"id": "970f719de254a1e7",
"type": "delay",
"z": "a4ee891237e460a2",
"name": "",
"pauseType": "delay",
"timeout": "500",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1310,
"y": 280,
"wires": [
[
"8c4d4fe614a52d4f"
]
]
},
{
"id": "97400c5ff0842570",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Adaptive Lighting On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"{{adaptive}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_on",
"x": 600,
"y": 160,
"wires": [
[]
]
},
{
"id": "dc0972a3964e6513",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Adaptive Lighting Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"{{adaptive}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 600,
"y": 520,
"wires": [
[]
]
},
{
"id": "defe84d113029e8e",
"type": "subflow:a062d9e6d44506dc",
"z": "a4ee891237e460a2",
"name": "",
"x": 980,
"y": 400,
"wires": [
[]
]
},
{
"id": "72c0b7fda242bb67",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Dynamic Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.{{topic}}_dynamic_scenes"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 750,
"y": 220,
"wires": [
[
"3a4f567b17b2214e"
]
]
},
{
"id": "a81fd188d89faa25",
"type": "subflow:582b8363c9f33bf8",
"z": "a4ee891237e460a2",
"name": "",
"x": 570,
"y": 580,
"wires": []
},
{
"id": "de5a484b79c5d0e4",
"type": "subflow:582b8363c9f33bf8",
"z": "a4ee891237e460a2",
"name": "",
"x": 570,
"y": 100,
"wires": []
},
{
"id": "60924f02885cc3c8",
"type": "api-call-service",
"z": "a4ee891237e460a2",
"name": "Notify TV",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tv_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": dest,\t \"title\": topic,\t \"message\": payload,\t \"data\": {\t \"fontsize\": \"large\",\t \"duration\": 3,\t \"transparency\": \"25%\",\t \"color\": \"red\"\t }\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tv_notify",
"x": 920,
"y": 340,
"wires": [
[]
]
},
{
"id": "ca51f6e6bd51fb55",
"type": "function",
"z": "a4ee891237e460a2",
"name": "Routing",
"func": "const str = msg.payload\nconst newPayload = str.replaceAll(\" \",\"_\")\nconst topic = msg.topic\n\nmsg.payload = newPayload\nmsg.adaptive = \"switch.adaptive_lighting_\" + topic\n\nif (newPayload === 'Select') {\n return null\n} else if (newPayload === 'Adaptive') {\n return[msg,null,null]\n} else if (newPayload === 'Reset') {\n return[null,msg,null]\n} else {\n return[null,null,msg]\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 360,
"wires": [
[
"de5a484b79c5d0e4",
"9af9a2966a477b33",
"97400c5ff0842570"
],
[
"a89c7e8905a07998"
],
[
"a81fd188d89faa25",
"dc0972a3964e6513",
"4ab49b8485f1886f"
]
],
"outputLabels": [
"Adaptive",
"Reset",
"Otherwise"
],
"icon": "node-red/switch.svg"
},
{
"id": "9af9a2966a477b33",
"type": "function",
"z": "a4ee891237e460a2",
"name": "Routing",
"func": "const str = msg.payload\nconst scene = str.replaceAll(\"_\", \" \")\nconst dynamicRooms = global.get(\"dynamicRooms\", \"diskCon\")\nconst tvRooms = global.get(\"tvRooms\", \"diskCon\")\nconst room = msg.topic\n\nlet notify = {\n \"dest\": room,\n \"topic\": \"Lights Changed\",\n \"payload\": `Lights changed to a new scene: ${scene}`\n}\n\nlet statusMsg = {\n \"status\": {\n \"fill\": \"green\",\n \"shape\": \"dot\",\n \"text\": `Lights changed to a new scene: ${scene}`\n }\n}\n\nif (dynamicRooms.includes(room)) {\n node.send([msg,null,null,null])\n} else {\n node.send([null,msg,null,null])\n}\n\nif (tvRooms.includes(room)) {\n node.send([null,null,notify,null])\n}\n\nnode.send([null,null,null,statusMsg])",
"outputs": 4,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 280,
"wires": [
[
"72c0b7fda242bb67"
],
[
"3a4f567b17b2214e"
],
[
"60924f02885cc3c8"
],
[]
],
"outputLabels": [
"Dynamic",
"Else",
"",
""
]
},
{
"id": "4ab49b8485f1886f",
"type": "function",
"z": "a4ee891237e460a2",
"name": "Routing",
"func": "const str = msg.payload\nconst scene = str.replaceAll(\"_\", \" \")\nconst states = global.get('homeassistant.homeAssistant.states')\nconst dynamicRooms = global.get(\"dynamicRooms\", \"diskCon\")\nconst tvRooms = global.get(\"tvRooms\", \"diskCon\")\nconst room = msg.topic\n\nlet notify = {\n \"dest\": room,\n \"topic\": \"Lights Changed\",\n \"payload\": `Lights changed to a new scene: ${scene}`\n}\n\nlet statusMsg = {\n \"status\": {\n \"fill\": \"green\",\n \"shape\": \"dot\",\n \"text\": `Lights changed to a new scene: ${scene}`\n }\n}\n\nif (scene.includes(\"Nightlight\")) {\n msg.nightlight = \"on\"\n} else {\n msg.nightlight = \"off\"\n}\n\nif (dynamicRooms.includes(room)) {\n let inputBoolean = \"input_boolean.\" + room + \"_dynamic_scenes\"\n let boolState = states[inputBoolean].state\n if (boolState === 'on') {\n node.send([msg,null,null,null])\n } else {\n node.send([null,msg,null,null])\n }\n} else {\n node.send([null,msg,null,null])\n}\n\nif (tvRooms.includes(room)) {\n node.send([null,null,notify,null])\n}\n\nnode.send([null,null,null,statusMsg])",
"outputs": 4,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 440,
"wires": [
[
"defe84d113029e8e"
],
[
"c19b4dccc5d6a9af"
],
[
"60924f02885cc3c8"
],
[]
],
"outputLabels": [
"Dynamic",
"Non-Dynamic",
"Notify",
""
]
},
{
"id": "6088f5b9f13e0e36",
"type": "delay",
"z": "05a2d9f89e72481f",
"name": "",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 200,
"y": 80,
"wires": [
[
"8e803251d3e3c3ae"
]
]
},
{
"id": "8e803251d3e3c3ae",
"type": "function",
"z": "05a2d9f89e72481f",
"name": "",
"func": "const alexa = global.get('lastAlexaName')\nlet statusMsg = {\n \"payload\": alexa\n}\n\nif (alexa === \"Basement Echo Dot\") {\n msg.who = \"basement\"\n} else if (alexa === \"Living Room Echo Dot\") {\n msg.who = \"living_room\"\n} else if (alexa === \"Master Bedroom Echo Dot\") {\n msg.who = \"master_bedroom\"\n}\n\nreturn[msg,statusMsg]",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 80,
"wires": [
[],
[]
]
},
{
"id": "54f4bebfc9414dbd",
"type": "lifx-list-scenes",
"z": "3aa2aec226246753",
"name": "",
"api": "60eb53fb94cd64e4",
"x": 210,
"y": 140,
"wires": [
[
"96da394eceab9244"
]
]
},
{
"id": "8b4af77e07c66df9",
"type": "lifx-list-lights",
"z": "3aa2aec226246753",
"name": "",
"api": "60eb53fb94cd64e4",
"selector": "",
"x": 200,
"y": 80,
"wires": [
[
"817c0a6afb11477b"
]
]
},
{
"id": "817c0a6afb11477b",
"type": "debug",
"z": "3aa2aec226246753",
"name": "lights",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 80,
"wires": []
},
{
"id": "96da394eceab9244",
"type": "debug",
"z": "3aa2aec226246753",
"name": "scenes",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 380,
"y": 140,
"wires": []
},
{
"id": "8ad119b6c6e11ddd",
"type": "function",
"z": "85c4f81ca9628aea",
"name": "Format",
"func": "const str = msg.payload\nlet scene = str.replaceAll(\"_\",\" \")\nlet topic = msg.topic\n\nlet statusMsg = {\n \"status\": {\n \"fill\": \"green\",\n \"shape\": \"dot\",\n \"text\": `Lights changed to a new scene: ${scene}`\n }\n}\n\nif (scene === 'Reset' || scene === 'Select') {\n return null\n} else {\n node.send(statusMsg)\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 840,
"y": 340,
"wires": [
[]
]
},
{
"id": "78a73c2d816658d8",
"type": "subflow:582b8363c9f33bf8",
"z": "85c4f81ca9628aea",
"name": "",
"x": 710,
"y": 420,
"wires": []
},
{
"id": "9cd0aa12d56438c6",
"type": "function",
"z": "85c4f81ca9628aea",
"name": "Routing",
"func": "const str = msg.payload\nconst newPayload = str.replaceAll(\" \",\"_\")\n\nmsg.payload = newPayload\n\nif (newPayload != 'Select' && newPayload != 'Reset') {\n return msg;\n} else {\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 340,
"wires": [
[
"78a73c2d816658d8",
"138fc130a014b26e"
]
],
"outputLabels": [
"Adaptive"
]
},
{
"id": "138fc130a014b26e",
"type": "api-call-service",
"z": "85c4f81ca9628aea",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"script.{{payload}}_in_{{topic}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "turn_on",
"x": 670,
"y": 340,
"wires": [
[
"8ad119b6c6e11ddd"
]
]
},
{
"id": "b05ef328b90665d5",
"type": "delay",
"z": "b88bb63bb13eeb27",
"name": "",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 200,
"y": 80,
"wires": [
[
"c2a8a3f1f00bc4b7"
]
]
},
{
"id": "c2a8a3f1f00bc4b7",
"type": "function",
"z": "b88bb63bb13eeb27",
"name": "",
"func": "const alexa = global.get('lastAlexaEntityId')\nlet statusMsg = {\n \"payload\": alexa\n}\n\nmsg.who = alexa\n\nreturn[msg,statusMsg]",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 80,
"wires": [
[],
[]
]
},
{
"id": "d509e18fa07ab430",
"type": "color-convert",
"z": "17510314e84badd9",
"input": "hex",
"output": "rgb",
"outputType": "array",
"scaleInput": false,
"x": 350,
"y": 80,
"wires": [
[
"e0b30104939cf28d"
]
]
},
{
"id": "664a1a92c5c5546e",
"type": "split",
"z": "17510314e84badd9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 190,
"y": 80,
"wires": [
[
"d509e18fa07ab430"
]
]
},
{
"id": "e0b30104939cf28d",
"type": "join",
"z": "17510314e84badd9",
"name": "",
"mode": "auto",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 510,
"y": 80,
"wires": [
[
"52dd35473d9e536f"
]
]
},
{
"id": "52dd35473d9e536f",
"type": "function",
"z": "17510314e84badd9",
"name": "Set Contexts",
"func": "const topic = msg.topic\nconst payload = msg.payload\n\nif (topic === 'teamColors') {\n flow.set(\"$parent.teamColors\", payload, \"diskCon\")\n} else if (topic === 'oppColors') {\n flow.set(\"$parent.oppColors\", payload, \"diskCon\")\n}",
"outputs": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 690,
"y": 80,
"wires": []
},
{
"id": "8b3c203e7e901a8c",
"type": "moment",
"z": "384eaf2f63dcb5db",
"name": "",
"topic": "",
"input": "timestamp",
"inputType": "msg",
"inTz": "America/New_York",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "YYYY-MM-DD HH:mm:00",
"locale": "en_us",
"output": "datetime",
"outputType": "msg",
"outTz": "America/New_York",
"x": 240,
"y": 80,
"wires": [
[]
]
},
{
"id": "b2d071ca42e4a3c6",
"type": "function",
"z": "9766d47584651edb",
"name": "Convert to seconds",
"func": "let duration = msg.duration\nlet seconds = duration * 60\n\nlet statusMsg = {\n \"payload\": seconds + \"s\"\n}\n\nmsg.duration = seconds\n\nnode.status({ fill: \"green\", shape: \"dot\", text: msg.duration + \"s\"});\n\nreturn[msg,statusMsg]",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 80,
"wires": [
[],
[]
],
"outputLabels": [
"Output",
"Status"
],
"icon": "font-awesome/fa-clock-o"
},
{
"id": "11aabd786c07244f",
"type": "function",
"z": "ea629141206d5343",
"name": "user conversion",
"func": "// Get the user ID list from global context\nconst users = global.get(\"userIDList\", \"diskCon\") || {}\n\n// Initialize variables\nlet userTrigger = \"none\"\nlet statusTxt = \"\"\n\n// Extract user ID from the message\nif (msg.payload?.context?.user_id) {\n userTrigger = msg.payload.context.user_id\n} else if (msg.data?.context?.user_id) {\n userTrigger = msg.data.context.user_id\n}\n\n// Validate userTrigger and set status message\nif (userTrigger === \"none\" || !users[userTrigger]) {\n statusTxt = \"User not found\"\n node.error(`User ID '${userTrigger}' not found in user list.`)\n return null // Stop execution if user is not found\n} else {\n const user = users[userTrigger]\n statusTxt = `User: ${user.firstName}`\n msg.user = { ...user } // Avoid mutating the original msg\n}\n\n// Create the status message\nconst statusMsg = {\n status: {\n fill: \"green\",\n shape: \"dot\",\n text: `${statusTxt} at ${new Date().toLocaleString()}`\n }\n}\n\n// Send the message and status message to the output nodes\nnode.send([msg, statusMsg])",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 220,
"y": 80,
"wires": [
[],
[]
],
"icon": "font-awesome/fa-user"
},
{
"id": "7fc67fc156c0f4be",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.kallen_timer"
],
"labelId": [],
"data": "{ \"duration\": {{duration}}}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 790,
"y": 200,
"wires": [
[]
]
},
{
"id": "34dcb204b421710d",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Resume Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.kallen_timer"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 580,
"y": 440,
"wires": [
[
"e69ad4771494c458",
"93a52960301bb3a3"
]
]
},
{
"id": "923538ef97772f0c",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"kallen\",\t \"message\": payload,\t \"title\": topic,\t \"type\": \"normal\",\t \"tag\": \"kallen-timer-finished\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 950,
"y": 660,
"wires": [
[]
]
},
{
"id": "a3e3dc438a7b95fc",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Finished Message",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "You are done with activity for today!",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "activity Timer Complete",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 570,
"y": 660,
"wires": [
[
"08a22fa71fce5e91"
]
]
},
{
"id": "797d3e7cc53d773f",
"type": "ha-button",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Start Button",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "fbc65f8185932b5f",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "button",
"valueType": "str"
}
],
"x": 130,
"y": 300,
"wires": [
[
"1a0adfa82fff507a"
]
]
},
{
"id": "fe1ba086baf93ec0",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Reset Slider",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_number.kallen_activity_duration"
],
"labelId": [],
"data": "{\t \"value\":30\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_number",
"service": "set_value",
"x": 350,
"y": 820,
"wires": [
[]
]
},
{
"id": "50056b099a24a824",
"type": "subflow:6429099c4571dd6b",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "",
"x": 640,
"y": 600,
"wires": [
[]
]
},
{
"id": "d8e2d16e313b938a",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Task ID",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"id\":\"5631572291\"}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 575,
"y": 720,
"wires": [
[
"283661388275a459"
]
],
"l": false
},
{
"id": "e69ad4771494c458",
"type": "api-current-state",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Get Room",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_select.kallen_activity_room",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 770,
"y": 440,
"wires": [
[
"fdf9b6820eb7289a"
]
]
},
{
"id": "fdf9b6820eb7289a",
"type": "switch",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Routing",
"property": "room",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Kallen Bedroom",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 885,
"y": 440,
"wires": [
[
"24abb932c4cd0b1f"
],
[]
],
"l": false
},
{
"id": "5c44fd504453ae63",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Turn on K's bedroom lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [
"kallen_bedroom"
],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1440,
"y": 400,
"wires": [
[
"dd0be4a0dd77e1db"
]
]
},
{
"id": "908543f7b78f7beb",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Turn on K's bedroom lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [
"kallen_bedroom"
],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 980,
"y": 80,
"wires": [
[
"d6728df5d1fdf67e"
]
]
},
{
"id": "dd0be4a0dd77e1db",
"type": "delay",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1605,
"y": 400,
"wires": [
[
"6b086807971b2618"
]
],
"l": false
},
{
"id": "d6728df5d1fdf67e",
"type": "delay",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1155,
"y": 80,
"wires": [
[
"ae7073e78053da5d"
]
],
"l": false
},
{
"id": "ae7073e78053da5d",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Set to Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_bedroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1300,
"y": 80,
"wires": [
[]
]
},
{
"id": "6b086807971b2618",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Set to Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_bedroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1740,
"y": 400,
"wires": [
[]
]
},
{
"id": "6736626753b33834",
"type": "api-current-state",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Check lights",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.kallen_bedroom_lights",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "lights",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1210,
"y": 440,
"wires": [
[
"5c44fd504453ae63"
],
[]
],
"outputLabels": [
"off",
"on"
]
},
{
"id": "b0c92a72557d0ac6",
"type": "switch",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "",
"property": "activity",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Reading",
"vt": "str"
},
{
"t": "eq",
"v": "Writing",
"vt": "str"
},
{
"t": "eq",
"v": "Trombone Practice",
"vt": "str"
},
{
"t": "eq",
"v": "Studying",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 495,
"y": 820,
"wires": [
[
"d8e2d16e313b938a"
],
[
"408795055634e897"
],
[
"d580c539c554a4c1"
],
[
"f0cc7b3b9622312a"
]
],
"l": false
},
{
"id": "408795055634e897",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Task ID",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"id\":\"5631620966\"}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 575,
"y": 780,
"wires": [
[
"283661388275a459"
]
],
"l": false
},
{
"id": "0a441953c41a18ae",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Formatting",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
},
{
"t": "set",
"p": "voice",
"pt": "msg",
"to": "Joanna",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 495,
"y": 600,
"wires": [
[
"50056b099a24a824"
]
],
"l": false
},
{
"id": "08a22fa71fce5e91",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Set Activity",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
},
{
"t": "change",
"p": "topic",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 770,
"y": 660,
"wires": [
[
"923538ef97772f0c"
]
]
},
{
"id": "736d7433005436b3",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "activity timer has been started in room for duration minutes",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "room",
"fromt": "str",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "duration",
"fromt": "str",
"to": "duration",
"tot": "msg"
},
{
"t": "set",
"p": "voice",
"pt": "msg",
"to": "Joanna",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 735,
"y": 260,
"wires": [
[
"0aa29248b560c45d"
]
],
"l": false
},
{
"id": "0aa29248b560c45d",
"type": "subflow:6429099c4571dd6b",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"x": 860,
"y": 260,
"wires": [
[]
]
},
{
"id": "b8ca8a1a2655570b",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Rounding",
"func": "const readout = msg.duration\n\nmsg.duration = +readout.toFixed(0)\n\nnode.status({fill:\"green\",shape:\"dot\",text:msg.duration + \"m\"})\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 675,
"y": 260,
"wires": [
[
"736d7433005436b3"
]
],
"l": false
},
{
"id": "24abb932c4cd0b1f",
"type": "api-current-state",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Control Lights?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_timer_control_lights",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "lights",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1020,
"y": 440,
"wires": [
[
"6736626753b33834"
],
[]
],
"outputLabels": [
"on",
"off"
]
},
{
"id": "c0521b53f7efeb17",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "activity timer has been paused in room with remainingmin minutes and remainingsec seconds left",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "room",
"fromt": "str",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "remainingmin",
"fromt": "str",
"to": "remainingmin",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "remainingsec",
"fromt": "str",
"to": "remainingsec",
"tot": "msg"
},
{
"t": "set",
"p": "voice",
"pt": "msg",
"to": "Joanna",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 885,
"y": 360,
"wires": [
[
"95d5ac486b4f9ee0"
]
],
"l": false
},
{
"id": "95d5ac486b4f9ee0",
"type": "subflow:6429099c4571dd6b",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"x": 1020,
"y": 360,
"wires": [
[]
]
},
{
"id": "49767cbfa622a734",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "activity timer has been resumed in room with remainingmin minutes and remainingsec seconds remaining",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "activity",
"fromt": "str",
"to": "activity",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "room",
"fromt": "str",
"to": "room",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "remainingmin",
"fromt": "str",
"to": "remainingmin",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "remainingsec",
"fromt": "str",
"to": "remainingsec",
"tot": "msg"
},
{
"t": "set",
"p": "voice",
"pt": "msg",
"to": "Joanna",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 885,
"y": 500,
"wires": [
[
"04113ab4977bf725"
]
],
"l": false
},
{
"id": "04113ab4977bf725",
"type": "subflow:6429099c4571dd6b",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"x": 1020,
"y": 500,
"wires": [
[]
]
},
{
"id": "d580c539c554a4c1",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Task ID",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"id\":\"6222268062\"}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 575,
"y": 840,
"wires": [
[
"283661388275a459"
]
],
"l": false
},
{
"id": "f0cc7b3b9622312a",
"type": "change",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Task ID",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"id\":\"6351557015\"}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 575,
"y": 900,
"wires": [
[
"283661388275a459"
]
],
"l": false
},
{
"id": "206e512c5268020f",
"type": "server-events",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.kallen_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 140,
"y": 600,
"wires": [
[
"fe1ba086baf93ec0",
"4da18a3f1e0298db"
]
]
},
{
"id": "93a52960301bb3a3",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Announce",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst room = states['input_select.kallen_activity_room'].state\nconst activity = states['input_select.kallen_activities'].state\nconst minutes = states['sensor.kallen_timer_remaining_minutes'].state\nconst seconds = states['sensor.kallen_timer_remaining_seconds'].state\n\nmsg.room = room\nmsg.activity = activity\nmsg.remainingmin = minutes\nmsg.remainingsec = seconds\n\nnode.status({ fill: \"green\", shape: \"dot\", text: \"Sent\" })\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 760,
"y": 500,
"wires": [
[
"49767cbfa622a734"
]
],
"icon": "font-awesome/fa-volume-up"
},
{
"id": "0e39331337b021bb",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Start",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst room = states['input_select.kallen_activity_room'].state\nconst activity = states['input_select.kallen_activities'].state\nconst controlLights = states['input_boolean.kallen_timer_control_lights'].state\nconst duration = states['input_number.kallen_activity_duration'].state\nconst fixDuration = parseFloat(duration)\n\nmsg.room = room\nmsg.activity = activity\nmsg.lights = controlLights\nmsg.duration = fixDuration\n\nnode.status({fill:\"green\",shape:\"dot\",text:room})\n\nif (room === 'Basement') {\n return[msg,null,null]\n} else if (room === 'Kallen Bedroom') {\n return [null,msg,null]\n} else {\n return[null,null,msg]\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 160,
"wires": [
[
"b8ca8a1a2655570b",
"49dbe17ff03ed572",
"9612270d4cdfbf07"
],
[
"b8ca8a1a2655570b",
"49dbe17ff03ed572",
"9612270d4cdfbf07"
],
[
"b8ca8a1a2655570b",
"49dbe17ff03ed572",
"9612270d4cdfbf07"
]
],
"outputLabels": [
"Basement",
"Kallen Bedroom",
"Otherwise"
],
"icon": "font-awesome/fa-hourglass-start"
},
{
"id": "82172c8ab1a9c8e2",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Announce",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst room = states['input_select.kallen_activity_room'].state\nconst activity = states['input_select.kallen_activities'].state\nconst minutes = states['sensor.kallen_timer_remaining_minutes'].state\nconst seconds = states['sensor.kallen_timer_remaining_seconds'].state\n\nmsg.room = room\nmsg.activity = activity\nmsg.remainingmin = minutes\nmsg.remainingsec = seconds\n\nnode.status({fill:\"green\",shape:\"dot\",text:\"Sent\"})\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 360,
"wires": [
[
"afeb1d238a623c3d"
]
],
"icon": "font-awesome/fa-volume-up"
},
{
"id": "afeb1d238a623c3d",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.pause",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.kallen_timer"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "pause",
"x": 790,
"y": 360,
"wires": [
[
"c0521b53f7efeb17"
]
]
},
{
"id": "4da18a3f1e0298db",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "Announce",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst room = states['input_select.kallen_activity_room'].state\nconst activity = states['input_select.kallen_activities'].state\n\nmsg.topic = room\nmsg.activity = activity\nmsg.payload = 'activity timer completed, good job!'\n\nnode.status({ fill: \"green\", shape: \"dot\", text: \"Sent\" })\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 600,
"wires": [
[
"a3e3dc438a7b95fc",
"b0c92a72557d0ac6",
"0a441953c41a18ae"
]
],
"icon": "font-awesome/fa-volume-up"
},
{
"id": "49dbe17ff03ed572",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Lights?",
"func": "if (msg.lights === 'on') {\n if (msg.room === 'Kallen Bedroom') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Lights Controlled\"})\n return[msg,null]\n } else if (msg.room === 'Living Room') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Lights Controlled\"})\n return[null,msg]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:`N/A in ${msg.room}`})\n return null\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 120,
"wires": [
[
"908543f7b78f7beb"
],
[
"259da5d2e5a07c83"
]
],
"outputLabels": [
"Kallen Bedroom",
"Living Room"
],
"icon": "node-red-contrib-huemagic/hue-light.svg"
},
{
"id": "259da5d2e5a07c83",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"name": "Turn on Living Room lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 980,
"y": 140,
"wires": [
[
"cd6fc2c497e8d571"
]
]
},
{
"id": "cd6fc2c497e8d571",
"type": "delay",
"z": "4a8821853d4dd1ad",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1155,
"y": 140,
"wires": [
[
"d6594de2b4194b54"
]
],
"l": false
},
{
"id": "d6594de2b4194b54",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"name": "Set to Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.living_room_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1300,
"y": 140,
"wires": [
[]
]
},
{
"id": "283661388275a459",
"type": "todoist-task-complete",
"z": "4a8821853d4dd1ad",
"g": "1ca205a84922c8c2",
"name": "",
"token": "81cb9d95d14a3e5a",
"x": 740,
"y": 820,
"wires": [
[]
]
},
{
"id": "9612270d4cdfbf07",
"type": "subflow:9766d47584651edb",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "",
"x": 675,
"y": 200,
"wires": [
[
"7fc67fc156c0f4be"
]
],
"l": false
},
{
"id": "1a0adfa82fff507a",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst timer = states['timer.kallen_timer'].state\n\n// Basic replacement for current entry flow\n\nif (timer === 'idle') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Start\"})\n node.send([msg,null,null])\n} else if (timer === 'active') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Pause\"})\n node.send([null,msg,null])\n} else if (timer === 'paused') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Resume\"})\n node.send([null,null,msg])\n}",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 300,
"wires": [
[
"0e39331337b021bb"
],
[
"82172c8ab1a9c8e2"
],
[
"34dcb204b421710d"
]
],
"outputLabels": [
"idle",
"active",
"paused"
]
},
{
"id": "27ae9c023ee2d1f6",
"type": "server-state-changed",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Duration Change",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_number.kallen_activity_duration"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
}
],
"x": 140,
"y": 80,
"wires": [
[
"88d088ea70f0030a"
]
]
},
{
"id": "88d088ea70f0030a",
"type": "function",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Timer Math",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst oldState = msg.data.old_state.state\nconst newState = msg.data.new_state.state\nconst entity_id = msg.data.entity_id\nconst subtract = newState - oldState\nconst multiply = subtract * 60\nconst diff = parseInt(multiply)\nconst running = states[\"timer.kallen_timer\"].state\n\nlet changeMsg = {\n \"timer\": \"timer.kallen_timer\",\n \"change\": diff\n}\n\nif (running === 'active') {\n node.send(changeMsg)\n node.status({fill:\"green\",shape:\"dot\",text:\"Timer Changed\"})\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"})\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 80,
"wires": [
[
"86c7f29776a59797"
]
]
},
{
"id": "86c7f29776a59797",
"type": "api-call-service",
"z": "4a8821853d4dd1ad",
"g": "a46fc8e7e70ca893",
"name": "Timer Change",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.timer_modify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"timer\": timer,\t \"change\": change\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "timer_modify",
"x": 520,
"y": 80,
"wires": [
[]
]
},
{
"id": "fd4bbf481e16e6ea",
"type": "sunrise",
"z": "e44b1e7a8ef7ae1d",
"name": "",
"lat": "41.286720",
"lon": "-84.362106",
"start": "sunriseEnd",
"end": "sunsetStart",
"soff": 0,
"eoff": "-60",
"sendAtStartup": false,
"x": 130,
"y": 180,
"wires": [
[
"15a73af2f8ea690c"
],
[
"dd3f147b2583a136"
]
]
},
{
"id": "bee1e4f9b480f6f6",
"type": "ha-button",
"z": "e44b1e7a8ef7ae1d",
"name": "Manual Trigger",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "738e7f8f2ac71049",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "0",
"valueType": "num"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-trigger",
"valueType": "str"
}
],
"x": 120,
"y": 240,
"wires": [
[
"5ec63f0857df4164",
"7fd1f3f8ccc83192"
]
]
},
{
"id": "3d97e97025c63331",
"type": "ical-upcoming",
"z": "e44b1e7a8ef7ae1d",
"confignode": "0df0d4b823c241ca",
"timeout": "300",
"timeoutUnits": "seconds",
"cron": "",
"name": "",
"offsettype": "",
"offset": "",
"offsetUnitstype": "",
"offsetUnits": "",
"eventtypes": "events",
"eventtypestype": "eventtypes",
"calendar": "",
"calendartype": "str",
"triggertype": "trigger",
"trigger": "match",
"timezone": "America/New_York",
"timezonetype": "str",
"dateformat": "{\"timeStyle\":\"short\",\"dateStyle\":\"short\"}",
"dateformattype": "json",
"language": "en",
"languagetype": "language",
"filterProperty": "summary",
"filterPropertytype": "filterProperty",
"filterOperator": "between",
"filterOperatortype": "filterOperator",
"filtertype": "str",
"filter2type": "str",
"filter2": "",
"filter": "Work",
"checkall": false,
"endpreview": "",
"endpreviewUnits": "",
"previewtype": "num",
"preview": "",
"previewUnitstype": "previewUnits",
"previewUnits": "days",
"pastviewtype": "num",
"pastview": "",
"pastviewUnits": "days",
"pastviewUnitstype": "pastviewUnits",
"x": 150,
"y": 640,
"wires": [
[
"a605e8b865992be7"
]
]
},
{
"id": "798ff6ede18394ea",
"type": "ha-binary-sensor",
"z": "e44b1e7a8ef7ae1d",
"name": "Work Tomorrow",
"entityConfig": "781adad6153d9661",
"version": 0,
"state": "work_tomorrow",
"stateType": "msg",
"attributes": [
{
"property": "date",
"value": "payload.0.date",
"valueType": "msg"
},
{
"property": "eventStart",
"value": "payload.0.eventStart",
"valueType": "msg"
},
{
"property": "eventEnd",
"value": "payload.0.eventEnd",
"valueType": "msg"
},
{
"property": "summary",
"value": "payload.0.summary",
"valueType": "msg"
},
{
"property": "location",
"value": "payload.0.location",
"valueType": "msg"
},
{
"property": "isRecurring",
"value": "payload.0.isRecurring",
"valueType": "msg"
},
{
"property": "allDay",
"value": "payload.0.allDay",
"valueType": "msg"
},
{
"property": "calendarName",
"value": "payload.0.calendarName",
"valueType": "msg"
},
{
"property": "countdown",
"value": "payload.0.countdown",
"valueType": "msg"
},
{
"property": "start_timestamp",
"value": "payload.0.uid.date",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 620,
"y": 600,
"wires": [
[]
]
},
{
"id": "84d40e607426c66f",
"type": "ha-binary-sensor",
"z": "e44b1e7a8ef7ae1d",
"name": "Early Night Mode",
"entityConfig": "e27ae85e2a296e7c",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [
{
"property": "off",
"value": "start",
"valueType": "msg"
},
{
"property": "on",
"value": "end",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 390,
"y": 40,
"wires": [
[
"f6836ec53245f207"
]
]
},
{
"id": "15a73af2f8ea690c",
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Invert",
"func": "const daynight = msg.payload\n\nif (daynight === 1) {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Day\"});\n msg.payload = 0\n} else if (daynight === 0) {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Night\"});\n msg.payload = 1\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 255,
"y": 40,
"wires": [
[
"84d40e607426c66f"
]
],
"l": false
},
{
"id": "cb5becd5a322ef50",
"type": "mqtt out",
"z": "e44b1e7a8ef7ae1d",
"name": "MQTT Publish",
"topic": "house/time/early_night_mode",
"qos": "0",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 660,
"y": 40,
"wires": []
},
{
"id": "f6836ec53245f207",
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Invert",
"func": "const daynight = msg.payload\n\nif (daynight === 0) {\n node.status({fill:\"red\",shape:\"ring\",text:\"Off\"});\n msg.payload = \"off\"\n} else if (daynight === 1) {\n node.status({fill:\"green\",shape:\"dot\",text:\"On\"});\n msg.payload = \"on\"\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 525,
"y": 40,
"wires": [
[
"cb5becd5a322ef50"
]
],
"l": false
},
{
"id": "369e5f1ea8730d39",
"type": "mqtt out",
"z": "e44b1e7a8ef7ae1d",
"name": "MQTT Publish",
"topic": "house/time/night_mode",
"qos": "1",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 400,
"y": 780,
"wires": []
},
{
"id": "9d4ffc704e9ff81e",
"type": "mqtt out",
"z": "e44b1e7a8ef7ae1d",
"name": "MQTT Publish",
"topic": "house/time/give_me_darkness",
"qos": "1",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 400,
"y": 720,
"wires": []
},
{
"id": "14ea08ea216a10b6",
"type": "server-state-changed",
"z": "e44b1e7a8ef7ae1d",
"name": "Night Mode",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.night_mode"
],
"substring": [],
"regex": []
},
"outputInitially": true,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 130,
"y": 780,
"wires": [
[
"369e5f1ea8730d39"
]
]
},
{
"id": "e6fdd1843b17def1",
"type": "server-state-changed",
"z": "e44b1e7a8ef7ae1d",
"name": "Give Me Darkness",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.give_me_darkness"
],
"substring": [],
"regex": []
},
"outputInitially": true,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 150,
"y": 720,
"wires": [
[
"9d4ffc704e9ff81e"
]
]
},
{
"id": "a605e8b865992be7",
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Processing",
"func": "let tomorrow = msg.tomorrow\nlet today = msg.today\nlet number = {}\nlet work_tomorrow = {}\n\n// Check if calendar data exists\nif (!msg.payload || msg.payload.length === 0) {\n msg.payload = [{\n date: \"No Data\",\n eventStart: \"No Data\",\n eventEnd: \"No Data\",\n summary: \"No Data\",\n location: \"No Data\",\n isRecurring: \"No Data\",\n allDay: \"No Data\",\n calendarName: \"No Data\",\n countdown: \"No Data\",\n uid: { date: \"No Data\" }\n }]\n work_tomorrow = \"false\"\n number = 0\n} else {\n if (tomorrow > 0) {\n work_tomorrow = \"true\"\n if (today == 0) {\n number = 0\n } else {\n number = 1\n }\n } else {\n work_tomorrow = \"false\"\n number = 0\n }\n}\n\nmsg.work_tomorrow = work_tomorrow\n\nnode.status({fill:\"green\",shape:\"dot\",text:`Number ${number}`})\n\nif (number == 0) {\n node.send([msg,null])\n} else {\n node.send([null,msg])\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 640,
"wires": [
[
"798ff6ede18394ea"
],
[
"469e44739d85f2c7"
]
],
"outputLabels": [
"Number 0",
"Number 1"
]
},
{
"id": "469e44739d85f2c7",
"type": "ha-binary-sensor",
"z": "e44b1e7a8ef7ae1d",
"name": "Work Tomorrow",
"entityConfig": "781adad6153d9661",
"version": 0,
"state": "work_tomorrow",
"stateType": "msg",
"attributes": [
{
"property": "date",
"value": "payload.1.date",
"valueType": "msg"
},
{
"property": "eventStart",
"value": "payload.1.eventStart",
"valueType": "msg"
},
{
"property": "eventEnd",
"value": "payload.1.eventEnd",
"valueType": "msg"
},
{
"property": "summary",
"value": "payload.1.summary",
"valueType": "msg"
},
{
"property": "location",
"value": "payload.1.location",
"valueType": "msg"
},
{
"property": "isRecurring",
"value": "payload.1.isRecurring",
"valueType": "msg"
},
{
"property": "allDay",
"value": "payload.1.allDay",
"valueType": "msg"
},
{
"property": "calendarName",
"value": "payload.1.calendarName",
"valueType": "msg"
},
{
"property": "countdown",
"value": "payload.1.countdown",
"valueType": "msg"
},
{
"property": "start_timestamp",
"value": "payload.1.uid.date",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 620,
"y": 680,
"wires": [
[]
]
},
{
"id": "c59fac053d848a65",
"type": "api-call-service",
"z": "e44b1e7a8ef7ae1d",
"name": "Service Calls",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 590,
"y": 220,
"wires": [
[]
]
},
{
"id": "41df7a1ac03de337",
"type": "api-call-service",
"z": "e44b1e7a8ef7ae1d",
"name": "Script Calls",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 590,
"y": 280,
"wires": [
[]
]
},
{
"id": "7cc1659362b85ba0",
"type": "api-call-service",
"z": "e44b1e7a8ef7ae1d",
"name": "Notify Calls",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 590,
"y": 160,
"wires": [
[]
]
},
{
"id": "dd3f147b2583a136",
"type": "delay",
"z": "e44b1e7a8ef7ae1d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 245,
"y": 180,
"wires": [
[
"5ec63f0857df4164"
]
],
"l": false
},
{
"id": "5ec63f0857df4164",
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Processing",
"func": "//! FLOW VARIABLES DEFINED IN START TAB\n\n// Set Constants\n\nconst states = global.get('homeassistant.homeAssistant.states')\nconst holidayMode = states['input_boolean.holiday_mode'].state\nconst holidayHold = states['input_boolean.holiday_mode_hold'].state\nconst currentHoliday = states['input_select.holiday_animation'].state\nconst holiday = currentHoliday.toLowerCase()\nconst sunsetLights = states['input_boolean.sunset_lights_on'].state\nconst vacation = states['input_boolean.vacation_mode'].state\nconst upBathOcc = states['binary_sensor.upstairs_bathroom_occupied'].state\nconst deskLights = states['light.tina_desk_lights'].state\nconst adaptiveSleep = flow.get(\"adaptiveSleep\", \"diskCon\")\nconst selScenesMain = flow.get(\"selScenesMain\", \"diskCon\")\nconst selScenesTinaDesk = flow.get(\"selScenesTinaDesk\", \"diskCon\")\nconst booleanOff = flow.get(\"booleanOff\", \"diskCon\")\nconst triggered = states['input_boolean.sunset_lights_triggered'].state\nconst payload = msg.payload\nconst topic = msg.topic\nnode.log(\"Time-based Automations: Constants Set\")\n\n// Set a few important variables\n\nlet time = {}\nlet eventCall = {}\n\nif (payload == 0) {\n time = \"night\"\n eventCall = \"on\"\n} else if (payload == 1) {\n time = \"day\"\n eventCall = \"off\"\n}\n\nnode.log(\"Time-based Automations: Main variables defined\")\n\n// ---------- Configuration ----------\n// Decide which nighttime lighting to turn off at sunrise\nlet lightsOff = []\n\nif (holidayHold === 'off') {\n lightsOff.push(\"light.front_porch_light\")\n}\n\nif (upBathOcc === 'off') {\n lightsOff.push(\"light.upstairs_bathroom_lights\")\n}\n\n// Sunset lights timer settings\nlet timerEntity = [\"timer.sunset_lighting_timer\"]\nlet timerDuration = \"00:30:00\"\n\n// Adaptive lighting switches to set\nlet switchAdaptive = []\nlet setAdaptive = {}\n\nif (time === 'day') {\n if (holidayHold === 'on'){\n switchAdaptive = flow.get(\"adaptiveDayHoliday\", \"diskCon\")\n } else {\n switchAdaptive = flow.get(\"adaptiveDay\", \"diskCon\")\n }\n setAdaptive = 'on'\n} else if (time === 'night') {\n switchAdaptive = flow.get(\"adaptiveNight\", \"diskCon\")\n if (holidayMode === 'on') {\n setAdaptive = 'off'\n } else {\n setAdaptive = 'on'\n }\n}\n\n// Notification settings\nlet notifyTitle = {}\nlet notifyMsg = {}\nlet sunsetStatus = {}\nif (sunsetLights === 'off') {\n notifyTitle = \"Sunset Lights SKIPPED\"\n notifyMsg = \"Lights not on due to nobody home, or toggle shutoff\"\n sunsetStatus = \"Skipped\"\n} else {\n notifyTitle = \"Sunset Lights On\"\n notifyMsg = \"It's getting dark, evening lighting is now active\"\n sunsetStatus = \"Light Level Trigger\"\n}\n\n// Holiday Settings\nlet setHoliday = {}\nlet switchHoliday = [\"switch.animated_scene_\" + holiday]\nif (holidayMode === 'on') {\n if (time === 'day') {\n setHoliday = 'off'\n } else if (time === 'night') {\n setHoliday = 'on'\n }\n}\n\nnode.log(\"Time-based Automations: Decision Logic Complete\")\n\n// ---------- Service Calls ----------\n\nlet sendTriggered = {\n \"payload\": {\n \"action\": \"input_boolean.turn_on\",\n \"target\": {\n \"entity_id\": [\"input_boolean.sunset_lights_triggered\"]\n },\n \"data\": {}\n }\n}\n\nlet sendLights = {\n \"payload\": {\n \"action\": \"light.turn_off\",\n \"target\": {\n \"entity_id\": lightsOff\n },\n \"data\": {}\n }\n}\n\nlet sendSleepOff = {\n \"payload\": {\n \"action\": \"switch.turn_off\",\n \"target\": {\n \"entity_id\": adaptiveSleep\n },\n \"data\": {}\n }\n}\n\nlet sendBooleanOff = {\n \"payload\": {\n \"action\": \"input_boolean.turn_off\",\n \"target\": {\n \"entity_id\": booleanOff\n },\n \"data\": {}\n }\n}\n\nlet sendAdaptive = {\n \"payload\": {\n \"action\": \"switch.turn_\" + setAdaptive,\n \"target\": {\n \"entity_id\": switchAdaptive\n },\n \"data\": {}\n }\n}\n\nlet sendSceneResetMain = {\n \"payload\": {\n \"action\": \"input_text.set_value\",\n \"target\": {\n \"entity_id\": selScenesMain\n },\n \"data\": {\n \"value\": \"Adaptive\"\n }\n }\n}\n\nlet sendSceneResetDesk = {\n \"payload\": {\n \"action\": \"input_text.set_value\",\n \"target\": {\n \"entity_id\": selScenesTinaDesk\n },\n \"data\": {\n \"value\": \"Day Mode\"\n }\n }\n}\n\nlet sendHoliday = {\n \"payload\": {\n \"action\": \"switch.turn_\" + setHoliday,\n \"target\": {\n \"entity_id\": switchHoliday\n },\n \"data\": {}\n }\n}\n\nlet sendNotifyPhone = {\n \"payload\": {\n \"action\": \"script.text_notify\",\n \"data\": {\n \"who\": \"all\",\n \"title\": notifyTitle,\n \"message\": notifyMsg,\n \"type\": \"normal\",\n \"tag\": \"sunset-lights\"\n }\n }\n}\n\nlet sendNotifyTV = {\n \"payload\": {\n \"action\": \"script.tv_notify\",\n \"data\": {\n \"who\": \"all\",\n \"title\": notifyTitle,\n \"message\": notifyMsg,\n \"data\": {\n \"fontsize\": \"large\",\n \"duration\": 3,\n \"transparency\": \"25%\"\n }\n }\n }\n}\n\nlet sendFirstFloorScene = {\n \"payload\": {\n \"action\": \"script.evening_on_first_floor\",\n \"data\": {\n \"sunset_lights\": 1\n }\n }\n}\n\nlet sendSecondFloorScene = {\n \"payload\": {\n \"action\": \"script.evening_on_second_floor\",\n \"data\": {\n \"sunset_lights\": 1\n }\n }\n}\n\nlet sendDeskScene = {\n \"payload\": {\n \"action\": \"input_select.select_option\",\n \"target\": {\n \"entity_id\": [\"input_select.tina_desk_scenes\"]\n },\n \"data\": {\n \"option\": \"Reset\"\n }\n }\n}\n\nlet sendExtraLights = {\n \"payload\": {\n \"event\": \"extraLights\",\n \"data\": {\n \"toggle\": eventCall\n }\n }\n}\n\nnode.log(\"Time-based Automations: Message Payloads Defined\")\n\nnode.log(\"----- Time-based Automations: Set Parameters\")\nnode.log(\"time: \" + time)\nnode.log(\"topic: \" + topic)\nnode.log(\"lightsOff: \" + lightsOff)\nnode.log(\"holidayMode: \" + holidayMode)\nnode.log(\"eventCall: \" + eventCall)\nif (time === 'night') {\n node.log(\"sunsetStatus: \" + sunsetStatus)\n}\nif (holidayMode === 'on') {\n node.log(\"switchHoliday: \" + switchHoliday)\n node.log(\"holiday: \" + holiday)\n node.log(\"holidayHold: \" + holidayHold)\n node.log(\"switchHoliday: \" + switchHoliday)\n}\nnode.log(\"----- Time-based Automations: End Parameters -----\")\n\nif (vacation === 'off') {\n if (time === \"day\") {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sunrise Flow\"})\n node.send([null,[sendLights,sendBooleanOff],null,sendExtraLights])\n setTimeout(() => {\n node.send([null,[sendSleepOff,sendAdaptive,sendSceneResetMain,sendSceneResetDesk],null,null])\n if (holidayMode === 'on' && holidayHold === 'off') {\n node.send([null,[sendHoliday],null,null])\n }\n }, 5000)\n } else if (time === \"night\") {\n if (triggered === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sunset Flow\"})\n node.send([null,[sendAdaptive,sendTriggered],null,null])\n if (holidayMode === 'on') {\n setTimeout(() => {\n node.send([null,sendHoliday,null,null])\n }, 1000)\n }\n node.send([null,null,[sendFirstFloorScene,sendSecondFloorScene],sendExtraLights])\n if (deskLights === 'on') {\n node.send([null,sendDeskScene,null,null])\n }\n if (topic != 'manual-trigger') {\n node.send([[sendNotifyPhone,sendNotifyTV],null,null,null])\n }\n } else {\n node.status({fill:'green',shape:'dot',text:'Sunset Flow (Already Triggered)'})\n }\n }\n}\nnode.log(\"Time-based Automations: Processing Complete\")",
"outputs": 4,
"timeout": 0,
"noerr": 0,
"initialize": "//! ---------- DAY MODE ----------\n// Lists of adaptive lighting switches for different scenarios\nconst adaptiveDay = [\n \"switch.adaptive_lighting_basement_studio\",\n \"switch.adaptive_lighting_downstairs_bathroom\",\n \"switch.adaptive_lighting_emma_bedroom\",\n \"switch.adaptive_lighting_kallen_bedroom\",\n \"switch.adaptive_lighting_living_room\",\n \"switch.adaptive_lighting_master_bedroom\",\n \"switch.adaptive_lighting_mud_room\",\n \"switch.adaptive_lighting_tina_lamp\",\n \"switch.adaptive_lighting_upstairs_bathroom\",\n \"switch.adaptive_lighting_upstairs_hallway\",\n \"switch.adaptive_lighting_front_porch\"\n]\n\nconst adaptiveDayHoliday = [\n \"switch.adaptive_lighting_basement_studio\",\n \"switch.adaptive_lighting_downstairs_bathroom\",\n \"switch.adaptive_lighting_emma_bedroom\",\n \"switch.adaptive_lighting_kallen_bedroom\",\n \"switch.adaptive_lighting_living_room\",\n \"switch.adaptive_lighting_master_bedroom\",\n \"switch.adaptive_lighting_mud_room\",\n \"switch.adaptive_lighting_tina_lamp\",\n \"switch.adaptive_lighting_upstairs_bathroom\",\n \"switch.adaptive_lighting_upstairs_hallway\",\n]\n\n// List of adaptive lighting sleep mode switches to turn off\nconst adaptiveSleep = [\n \"switch.adaptive_lighting_sleep_mode_basement_studio\",\n \"switch.adaptive_lighting_sleep_mode_downstairs_bathroom\",\n \"switch.adaptive_lighting_sleep_mode_emma_bedroom\",\n \"switch.adaptive_lighting_sleep_mode_kallen_bedroom\",\n \"switch.adaptive_lighting_sleep_mode_living_room\",\n \"switch.adaptive_lighting_sleep_mode_master_bedroom\",\n \"switch.adaptive_lighting_sleep_mode_mud_room\",\n \"switch.adaptive_lighting_sleep_mode_tina_lamp\",\n \"switch.adaptive_lighting_sleep_mode_upstairs_bathroom\",\n \"switch.adaptive_lighting_sleep_mode_upstairs_hallway\"\n]\n\n// List of selected scene input texts to reset to Adaptive\nconst selScenesMain = [\n \"input_text.basement_studio_selected_scene\",\n \"input_text.downstairs_bathroom_selected_scene\",\n \"input_text.emma_bedroom_selected_scene\",\n \"input_text.front_porch_selected_scene\",\n \"input_text.kallen_bedroom_selected_scene\",\n \"input_text.living_room_selected_scene\",\n \"input_text.master_bedroom_selected_scene\",\n \"input_text.mud_room_selected_scene\",\n \"input_text.tina_lamp_selected_scene\",\n \"input_text.upstairs_bathroom_selected_scene\",\n \"input_text.upstairs_hallway_selected_scene\"\n]\n\n// Tina's desk reset\nconst selScenesTinaDesk = [\"input_text.tina_desk_selected_scene\"]\n\n// List of booleans to turn off\nconst booleanOff = [\n \"input_boolean.give_me_darkness\",\n \"input_boolean.goodnight\",\n \"input_boolean.kallen_computer_updates\",\n \"input_boolean.night_mode\",\n \"input_boolean.sunset_lights_triggered\"\n]\n\n//! ---------- NIGHT MODE ----------\n// Booleans to turn on at night\nconst adaptiveNight = [\n \"switch.adaptive_lighting_front_porch\"\n]\n\n\nflow.set(\"adaptiveDay\", adaptiveDay, \"diskCon\")\nflow.set(\"adaptiveDayHoliday\", adaptiveDayHoliday, \"diskCon\")\nflow.set(\"adaptiveNight\", adaptiveNight, \"diskCon\")\nflow.set(\"adaptiveSleep\", adaptiveSleep, \"diskCon\")\nflow.set(\"selScenesMain\", selScenesMain, \"diskCon\")\nflow.set(\"selScenesTinaDesk\", selScenesTinaDesk, \"diskCon\")\nflow.set(\"booleanOff\", booleanOff, \"diskCon\")",
"finalize": "",
"libs": [],
"x": 390,
"y": 180,
"wires": [
[
"7cc1659362b85ba0"
],
[
"c59fac053d848a65"
],
[
"41df7a1ac03de337"
],
[
"51c4e0e4f75a06df"
]
],
"outputLabels": [
"Notify",
"Services",
"Scripts",
""
],
"icon": "node-red-node-suncalc/sun.png"
},
{
"id": "51c4e0e4f75a06df",
"type": "ha-fire-event",
"z": "e44b1e7a8ef7ae1d",
"name": "Event Calls",
"server": "9e87348d.9c1c48",
"version": 0,
"event": "",
"data": "",
"dataType": "json",
"x": 590,
"y": 340,
"wires": [
[]
]
},
{
"id": "1e292a2db40e58de",
"type": "server-state-changed",
"z": "e44b1e7a8ef7ae1d",
"name": "Living Room",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.living_room_front_illuminance"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "num",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "level",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "lux",
"valueType": "str"
},
{
"property": "room",
"propertyType": "msg",
"value": "living-room",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "0",
"valueType": "num"
}
],
"x": 110,
"y": 300,
"wires": [
[
"96b23f9fc6e83696"
]
]
},
{
"id": "96b23f9fc6e83696",
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Light Level Filter",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst luxThresholdLivingRoom = states['input_number.living_room_lux_threshold'].state\nconst luxThresholdStairwell = states['input_number.stairwell_lux_threshold'].state\nconst luxThresholdOutdoor = states['input_number.sunset_lights_outdoor_lux_threshold'].state\nconst earlyNight = states['binary_sensor.early_night_mode'].state\nconst triggered = states['input_boolean.sunset_lights_triggered'].state\nconst level = msg.level\nconst room = msg.room\n\nif (earlyNight === 'on' && triggered === 'off') {\n if (room === 'living-room' && level <= luxThresholdLivingRoom) {\n node.status({fill:'green',shape:'dot',text:'Sent (Living Room)'})\n node.send([msg,msg])\n } else if (room === 'stairwell-bottom' && level <= luxThresholdStairwell) {\n node.status({fill:'green',shape:'dot',text:'Sent (Stairwell Bottom)'})\n node.send([msg,msg])\n } else if (room === 'outdoor' && level <= luxThresholdOutdoor) {\n node.status({fill:'green',shape:'dot',text:'Sent (Outdoor)'})\n node.send([msg,msg])\n }\n} else if (earlyNight === 'off') {\n node.status({fill:'red',shape:'ring',text:'Not Evening'})\n} else if (triggered === 'on') {\n node.status({fill:'red',shape:'ring',text:'Already Triggered'})\n} else {\n node.status({fill:'red',shape:'ring',text:'No Action'})\n}",
"outputs": 2,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 235,
"y": 300,
"wires": [
[
"dc087c5494270cc2"
],
[
"7fd1f3f8ccc83192"
]
],
"icon": "node-red-node-suncalc/sun.png",
"l": false
},
{
"id": "501c93564516bb56",
"type": "server-state-changed",
"z": "e44b1e7a8ef7ae1d",
"name": "Stairwell",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.stairwell_bottom_illuminance"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "num",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "level",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "lux",
"valueType": "str"
},
{
"property": "room",
"propertyType": "msg",
"value": "stairwell-bottom",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "0",
"valueType": "num"
}
],
"x": 100,
"y": 360,
"wires": [
[
"96b23f9fc6e83696"
]
]
},
{
"id": "9672b9b9c58b8d84",
"type": "server-state-changed",
"z": "e44b1e7a8ef7ae1d",
"name": "Outdoor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_illuminance"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "num",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "level",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "lux",
"valueType": "str"
},
{
"property": "room",
"propertyType": "msg",
"value": "outdoor",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "0",
"valueType": "num"
}
],
"x": 100,
"y": 420,
"wires": [
[
"96b23f9fc6e83696"
]
]
},
{
"id": "7fd1f3f8ccc83192",
"type": "api-call-service",
"z": "e44b1e7a8ef7ae1d",
"name": "Sunset Lights Triggered",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.sunset_lights_triggered"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_boolean",
"service": "turn_on",
"x": 630,
"y": 400,
"wires": [
[]
]
},
{
"id": "dc087c5494270cc2",
"type": "delay",
"z": "e44b1e7a8ef7ae1d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 285,
"y": 240,
"wires": [
[
"5ec63f0857df4164"
]
],
"l": false
},
{
"id": "134433d6e21dab5b",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Tony Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"person.tony_stork"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "home",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
}
],
"x": 180,
"y": 120,
"wires": [
[
"77857e77d43a9d2e",
"7169f007c32ccc46",
"e6bdfba61c73d081",
"77bb530373808a86",
"f54ba77dfe1e7ba4"
],
[
"379edcf9fe985ebe",
"f54ba77dfe1e7ba4"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "77857e77d43a9d2e",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Enable Texts (Tony)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_tony"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 410,
"y": 100,
"wires": [
[
"8c7c1cd31a824cd5"
]
]
},
{
"id": "379edcf9fe985ebe",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Disable Texts (Tony)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_tony"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 420,
"y": 280,
"wires": [
[
"24a89088d5503778"
]
]
},
{
"id": "49dbd6d6cba1b010",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Tina Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"person.christina_stork"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "home",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
},
{
"property": "tinawork",
"propertyType": "msg",
"value": "tinawork",
"valueType": "global"
}
],
"x": 170,
"y": 560,
"wires": [
[
"a0c7649e26e66ddb",
"35d7371023527600",
"edaa6ff605ba6fa7",
"77bb530373808a86",
"9d03fda88310da78",
"8c910479678a8f5e"
],
[
"898659d514aa58fd",
"8c910479678a8f5e"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "a0c7649e26e66ddb",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Enable Texts (Tina)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_tina"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 410,
"y": 540,
"wires": [
[
"2851173db6835eda"
]
]
},
{
"id": "898659d514aa58fd",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Disable Texts (Tina)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_tina"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 410,
"y": 720,
"wires": [
[
"82c0fb65066f3b67"
]
]
},
{
"id": "cd4d8dd6b1d34f49",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Kallen Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"person.kallen_stork"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "home",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
}
],
"x": 180,
"y": 960,
"wires": [
[
"5193627a30d1b32d",
"77bb530373808a86",
"8a450e797b413418",
"547753c8de135e69"
],
[
"8584a491587be9a2",
"547753c8de135e69"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "5193627a30d1b32d",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Enable Texts (Kallen)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_kallen"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 420,
"y": 940,
"wires": [
[
"8e081e76e5f19ead"
]
]
},
{
"id": "fb1afc4c2078ca29",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Disable Texts (Kallen)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_kallen"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 640,
"y": 1000,
"wires": [
[
"156d50efeaeb681c"
]
]
},
{
"id": "35d7371023527600",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Notify Tony",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"normal\",\t \"who\":\"tony\",\t \"title\": \"New Arrival\",\t \"message\": \"Tina has arrived at home!\",\t \"sound\":\"US-EN-Morgan-Freeman-Wife-Is-Arriving.wav\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 390,
"y": 660,
"wires": [
[
"bcdf2e5f1249631d"
]
]
},
{
"id": "9ae7e308f889137d",
"type": "wake on lan",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"mac": "B4:2E:99:A8:CF:88",
"host": "192.168.1.255",
"udpport": 9,
"numpackets": 3,
"interval": 100,
"name": "Boot Tina's Computer",
"x": 900,
"y": 500,
"wires": []
},
{
"id": "edaa6ff605ba6fa7",
"type": "change",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Christina has arrived at home!",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "New Arrival!",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 335,
"y": 600,
"wires": [
[
"10228956c46b8d7a"
]
],
"l": false
},
{
"id": "e6bdfba61c73d081",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Notify Tina",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "\t{\t \"type\":\"normal\",\t \"who\":\"tina\",\t \"title\": \"New Arrival\",\t \"message\": \"Tony has arrived at home!\",\t \"sound\":\"US-EN-Alexa-Husband-Is-Arriving.wav\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 390,
"y": 220,
"wires": [
[
"41aa4436b55474b2"
]
]
},
{
"id": "7169f007c32ccc46",
"type": "change",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Tony has arrived at home!",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "New Arrival!",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 335,
"y": 160,
"wires": [
[
"0a039e097233b977"
]
],
"l": false
},
{
"id": "41aa4436b55474b2",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Notify Kallen",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"normal\",\t \"who\":\"kallen\",\t \"title\": \"New Arrival\",\t \"message\": \"Tony has arrived at home!\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 590,
"y": 200,
"wires": [
[]
]
},
{
"id": "bcdf2e5f1249631d",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Notify Kallen",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"normal\",\t \"who\":\"kallen\",\t \"title\": \"New Arrival\",\t \"message\": \"Christina has arrived at home!\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 590,
"y": 640,
"wires": [
[]
]
},
{
"id": "7992545819db1a42",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Notify Tony",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"tony\",\t \"title\": \"Hey Dummy\",\t \"message\": \"Your presence flow is a failure and you should be ashamed.\",\t \"data\": {\t \"url\": \"/lovelace/mobile-devices\"\t }\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 870,
"y": 560,
"wires": [
[]
]
},
{
"id": "26f15fc8d75a4020",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Presence Detection for Front Porch",
"mode": "link",
"links": [
"f34816b23181f21e"
],
"x": 995,
"y": 100,
"wires": []
},
{
"id": "6a1cecedd6ef4b44",
"type": "link in",
"z": "3abb5ae57afb4761",
"name": "Cleanup - Presence",
"links": [
"619d1474239faf58"
],
"x": 195,
"y": 40,
"wires": [
[
"bf504c30194524b9",
"ec497068c3a61d02",
"43048b96595e3e97",
"df53af0726555079",
"802ff36b76e55809",
"1ac137ebc9f53e3c"
]
]
},
{
"id": "bf504c30194524b9",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Tony Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "home",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "person.tony_stork",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 180,
"y": 180,
"wires": [
[
"77857e77d43a9d2e"
],
[
"379edcf9fe985ebe"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "ec497068c3a61d02",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Tina Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "home",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "person.christina_stork",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 180,
"y": 620,
"wires": [
[
"a0c7649e26e66ddb"
],
[
"898659d514aa58fd"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "43048b96595e3e97",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Kallen Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "home",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "person.kallen_stork",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 190,
"y": 1020,
"wires": [
[
"5193627a30d1b32d"
],
[
"8584a491587be9a2"
]
],
"outputLabels": [
"home",
"away"
]
},
{
"id": "0a039e097233b977",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "TV Notifications",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tv_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"all\",\t \"title\": msg.topic,\t \"message\": msg.payload,\t \"data\": {\t \"fontsize\": \"large\",\t \"duration\": 3,\t \"transparency\": \"25%\",\t \"color\": \"green\"\t }\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tv_notify",
"x": 600,
"y": 160,
"wires": [
[]
]
},
{
"id": "10228956c46b8d7a",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "TV Notifications",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tv_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"all\",\t \"title\": msg.topic,\t \"message\": msg.payload,\t \"data\": {\t \"fontsize\": \"large\",\t \"duration\": 3,\t \"transparency\": \"25%\",\t \"color\": \"green\"\t }\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tv_notify",
"x": 600,
"y": 600,
"wires": [
[]
]
},
{
"id": "77bb530373808a86",
"type": "change",
"z": "3abb5ae57afb4761",
"name": "Formatting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "on",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 335,
"y": 40,
"wires": [
[
"26f15fc8d75a4020"
]
],
"l": false
},
{
"id": "47aa56df01f697fc",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Front Door Open",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "door",
"valueType": "str"
},
{
"property": "whichdoor",
"propertyType": "msg",
"value": "front",
"valueType": "str"
}
],
"x": 850,
"y": 120,
"wires": [
[
"26f15fc8d75a4020",
"5f8b61ddc9963e99",
"025e65a78727f99e"
],
[
"26f15fc8d75a4020"
]
],
"outputLabels": [
"Open",
""
]
},
{
"id": "c46dfcaa9a2798f0",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Doorbell",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_doorbell_ding_mqtt"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "doorbell",
"valueType": "str"
}
],
"x": 870,
"y": 300,
"wires": [
[
"26f15fc8d75a4020",
"025e65a78727f99e"
]
]
},
{
"id": "05547a934bbcab4d",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Motion Detected",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_doorbell_motion_mqtt"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 850,
"y": 240,
"wires": [
[
"26f15fc8d75a4020",
"025e65a78727f99e"
]
],
"outputLabels": [
"On"
]
},
{
"id": "ff44de8d65439a5f",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Back Door Open",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.back_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "door",
"valueType": "str"
},
{
"property": "whichdoor",
"propertyType": "msg",
"value": "back",
"valueType": "str"
}
],
"x": 850,
"y": 180,
"wires": [
[
"5f8b61ddc9963e99"
],
[]
],
"outputLabels": [
"Open",
""
]
},
{
"id": "5f8b61ddc9963e99",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "+1",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "counter.increment",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"counter.{{whichdoor}}_door_opened_today"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "counter",
"service": "increment",
"x": 1340,
"y": 200,
"wires": [
[]
]
},
{
"id": "0ba46659c49cf39a",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "MQTT Last Trigger",
"topic": "house/presence/outdoor/last_trigger",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 1300,
"y": 140,
"wires": []
},
{
"id": "025e65a78727f99e",
"type": "change",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Set Payload",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "detect",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1100,
"y": 140,
"wires": [
[
"0ba46659c49cf39a"
]
]
},
{
"id": "028e16d90ac7433d",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "Family Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.family_home"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
}
],
"x": 180,
"y": 1600,
"wires": [
[
"d5a9248680297b56",
"96ebe81b6e20112e"
],
[
"b8ef333da370f91e",
"96ebe81b6e20112e"
]
],
"outputLabels": [
"home",
"not_home"
]
},
{
"id": "d5a9248680297b56",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "Enable Texts (All)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_all"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 450,
"y": 1600,
"wires": [
[
"66b7ec9a7e332cca"
]
]
},
{
"id": "b8ef333da370f91e",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "Disable Texts (All)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_all"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 450,
"y": 1660,
"wires": [
[
"bebba6e7a61461b8"
]
]
},
{
"id": "351ac66c934832eb",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "Parents Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.parents_home"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
}
],
"x": 190,
"y": 1160,
"wires": [
[
"331ed2d217025fd1",
"8811ce1d8dacd3b1"
],
[
"0eaa398b977e03b5",
"8811ce1d8dacd3b1"
]
]
},
{
"id": "df53af0726555079",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "Parents Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.parents_home",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 190,
"y": 1220,
"wires": [
[
"331ed2d217025fd1"
],
[
"0eaa398b977e03b5"
]
]
},
{
"id": "331ed2d217025fd1",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "Enable Texts (Parents)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_parents"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 460,
"y": 1160,
"wires": [
[
"63dc161e193d33c5"
]
]
},
{
"id": "0eaa398b977e03b5",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "Disable Texts (Parents)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_parents"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 470,
"y": 1220,
"wires": [
[
"84a56bf51e79fd4d"
]
]
},
{
"id": "663b5401ea953d2d",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "Nerds Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.nerds_home"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "presence",
"valueType": "str"
}
],
"x": 180,
"y": 1380,
"wires": [
[
"a999c33047fc3b61",
"4e97de53400335b9"
],
[
"84a2692b31e7d7d8",
"4e97de53400335b9"
]
]
},
{
"id": "802ff36b76e55809",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "Nerds Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.nerds_home",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 190,
"y": 1440,
"wires": [
[
"a999c33047fc3b61"
],
[
"84a2692b31e7d7d8"
]
]
},
{
"id": "a999c33047fc3b61",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "Enable Texts (Nerds)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_nerds"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 460,
"y": 1380,
"wires": [
[
"bf5f6c5af1c02315"
]
]
},
{
"id": "84a2692b31e7d7d8",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "Disable Texts (Nerds)",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.text_notify_nerds"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 460,
"y": 1440,
"wires": [
[
"dafcce5a61b19f8b"
]
]
},
{
"id": "1ac137ebc9f53e3c",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "Family Presence?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.family_home",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 190,
"y": 1660,
"wires": [
[
"d5a9248680297b56"
],
[
"b8ef333da370f91e"
]
]
},
{
"id": "788f7cfdfa2fdef9",
"type": "server-state-changed",
"z": "3abb5ae57afb4761",
"g": "6a0fc544a641af5f",
"name": "Basement Door",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.basement_studio_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "door",
"valueType": "str"
},
{
"property": "whichdoor",
"propertyType": "msg",
"value": "basement_studio",
"valueType": "str"
}
],
"x": 1070,
"y": 220,
"wires": [
[
"5f8b61ddc9963e99"
],
[]
],
"outputLabels": [
"Open",
""
]
},
{
"id": "8c7c1cd31a824cd5",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "MQTT Publish",
"topic": "house/presence/people/tony",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 620,
"y": 100,
"wires": []
},
{
"id": "24a89088d5503778",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "MQTT Publish",
"topic": "house/presence/people/tony",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 620,
"y": 280,
"wires": []
},
{
"id": "2851173db6835eda",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "MQTT Publish",
"topic": "house/presence/people/tina",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 600,
"y": 540,
"wires": []
},
{
"id": "82c0fb65066f3b67",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "MQTT Publish",
"topic": "house/presence/people/tina",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 600,
"y": 720,
"wires": []
},
{
"id": "8e081e76e5f19ead",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "MQTT Publish",
"topic": "house/presence/people/kallen",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 620,
"y": 940,
"wires": []
},
{
"id": "156d50efeaeb681c",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "MQTT Publish",
"topic": "house/presence/people/kallen",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 840,
"y": 1000,
"wires": []
},
{
"id": "63dc161e193d33c5",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/parents",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1160,
"wires": []
},
{
"id": "84a56bf51e79fd4d",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/parents",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1220,
"wires": []
},
{
"id": "bf5f6c5af1c02315",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/nerds",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1380,
"wires": []
},
{
"id": "dafcce5a61b19f8b",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/nerds",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1440,
"wires": []
},
{
"id": "66b7ec9a7e332cca",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/family",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1600,
"wires": []
},
{
"id": "bebba6e7a61461b8",
"type": "mqtt out",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "MQTT Publish",
"topic": "house/presence/people/groups/family",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 680,
"y": 1660,
"wires": []
},
{
"id": "8a450e797b413418",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Notify Parents",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"normal\",\t \"who\":\"parents\",\t \"title\": \"New Arrival\",\t \"message\": \"Kallen has arrived at home!\",\t \"sound\":\"US-EN-Morgan-Freeman-Son-Is-Arriving.wav\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 400,
"y": 880,
"wires": [
[]
]
},
{
"id": "7fbab2c7cb7ecc92",
"type": "api-current-state",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Give Me Darkness?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.give_me_darkness",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "givemedarkness",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1005,
"y": 440,
"wires": [
[
"5e72a180d8f0232d"
],
[]
],
"l": false
},
{
"id": "5e72a180d8f0232d",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Living Room Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1150,
"y": 440,
"wires": [
[]
]
},
{
"id": "8584a491587be9a2",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Bedroom Lights Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kallen_bedroom_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 410,
"y": 1000,
"wires": [
[
"fb1afc4c2078ca29"
]
]
},
{
"id": "9d03fda88310da78",
"type": "function",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst workEndZone = states['binary_sensor.tina_work_end_zone'].state\nconst tinawork = msg.tinawork\n\nif (tinawork === 'on' && workEndZone === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Activated\"})\n return[msg,null]\n} else if (tinawork === 'on' && workEndZone === 'off') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Not time to leave yet\"})\n return null\n} else if (tinawork === 'off') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"No Work Today\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"We fucked up\"})\n node.warn(\"Tina presence flow encountered a situation we did not account for\")\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 480,
"wires": [
[
"9ae7e308f889137d",
"8a22032494f84cae"
],
[
"7992545819db1a42"
]
],
"outputLabels": [
"Activated",
"We fucked up"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "8a22032494f84cae",
"type": "api-call-service",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Lights Handler",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.tina_desk_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 880,
"y": 440,
"wires": [
[
"7fbab2c7cb7ecc92"
]
]
},
{
"id": "547753c8de135e69",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "6c0f29670fcc9493",
"name": "Kallen Presence - Out",
"mode": "link",
"links": [
"de09ef54cbab864a"
],
"x": 335,
"y": 1060,
"wires": []
},
{
"id": "8c910479678a8f5e",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "bf0e3e8c2f5a5474",
"name": "Tina Presence - Out",
"mode": "link",
"links": [],
"x": 335,
"y": 780,
"wires": []
},
{
"id": "f54ba77dfe1e7ba4",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "7821289ad49774c9",
"name": "Tony Presence - Out",
"mode": "link",
"links": [],
"x": 335,
"y": 340,
"wires": []
},
{
"id": "8811ce1d8dacd3b1",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "e74c2fa5c53fd805",
"name": "Parents Presence - Out",
"mode": "link",
"links": [],
"x": 375,
"y": 1280,
"wires": []
},
{
"id": "4e97de53400335b9",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "205da12d712d058b",
"name": "Nerds Presence - Out",
"mode": "link",
"links": [],
"x": 375,
"y": 1500,
"wires": []
},
{
"id": "96ebe81b6e20112e",
"type": "link out",
"z": "3abb5ae57afb4761",
"g": "c19f180ec1dc0bcf",
"name": "Family Presence - Out",
"mode": "link",
"links": [],
"x": 375,
"y": 1720,
"wires": []
},
{
"id": "d95d9964546768a5",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Downstairs Bathroom Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.downstairs_bathroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "downstairs_bathroom",
"valueType": "str"
}
],
"x": 160,
"y": 120,
"wires": [
[
"d790134891fedfcc"
]
]
},
{
"id": "bdab41af28f2c7cd",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Living Room Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.living_room_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "living_room",
"valueType": "str"
}
],
"x": 130,
"y": 60,
"wires": [
[
"85e820743550308b"
]
]
},
{
"id": "7c224927d50a5f97",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Mud Room Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.mud_room_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mud_room",
"valueType": "str"
}
],
"x": 130,
"y": 180,
"wires": [
[
"d790134891fedfcc"
]
]
},
{
"id": "e689231430e9c829",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Tina Lamp Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.tina_lamp_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "tina_lamp",
"valueType": "str"
}
],
"x": 130,
"y": 240,
"wires": [
[
"d790134891fedfcc"
]
]
},
{
"id": "5123a607588fa737",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.downstairs_bathroom_lights"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 530,
"y": 1100,
"wires": [
[]
]
},
{
"id": "d790134891fedfcc",
"type": "subflow:a4ee891237e460a2",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Main Scenes Handler",
"x": 600,
"y": 60,
"wires": []
},
{
"id": "74f9d2bf4a8c0b53",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "dcdfa098347020de",
"name": "Back Door Open",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.back_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "door",
"valueType": "str"
}
],
"x": 880,
"y": 60,
"wires": [
[
"f0ef9a565f72dcae"
],
[]
]
},
{
"id": "5e7a082800eeb73c",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "dcdfa098347020de",
"name": "Mud Room Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [
"mud_room"
],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1310,
"y": 60,
"wires": [
[
"1238a342e440e582"
]
]
},
{
"id": "f0ef9a565f72dcae",
"type": "api-current-state",
"z": "eff21041cc941fef",
"g": "dcdfa098347020de",
"name": "Early Night Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.early_night_mode",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1090,
"y": 60,
"wires": [
[
"5e7a082800eeb73c"
],
[]
]
},
{
"id": "5a81041c4a1390b8",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Tina Desk Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.tina_desk_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "tina_desk",
"valueType": "str"
}
],
"x": 130,
"y": 300,
"wires": [
[
"b19f4a996fd4c2ee"
]
]
},
{
"id": "b19f4a996fd4c2ee",
"type": "subflow:85c4f81ca9628aea",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "",
"x": 610,
"y": 300,
"wires": []
},
{
"id": "f84e6b5157e857cf",
"type": "function",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.downstairs_bathroom_lights'].state\nconst duration = states['input_number.downstairs_bathroom_lights_off_delay'].state\nconst lux = parseInt(states['sensor.downstairs_bathroom_illuminance'].state)\nconst threshold = parseInt(states['input_number.downstairs_bathroom_lux_threshold'].state)\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nif (payload === 'on') {\n if (lux <= threshold && lights === 'off') {\n node.status({fill:'green',shape:'dot',text:'Turning lights on'})\n node.send([msg,msg,null])\n } else {\n if (lights === 'on') {\n node.status({fill:'red',shape:'ring',text:'Lights already on'})\n node.send([null,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n }\n} else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,null,msg])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 270,
"y": 980,
"wires": [
[
"b281061a4b08d2eb"
],
[
"41a8d5ef20cf55d7"
],
[
"b7d94cd0e420c650"
]
],
"outputLabels": [
"Lights On",
"Cancel Timer",
"Start Timer"
],
"icon": "node-red/timer.svg"
},
{
"id": "b7d94cd0e420c650",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.downstairs_bathroom_lights_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 530,
"y": 1040,
"wires": [
[]
]
},
{
"id": "41a8d5ef20cf55d7",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.downstairs_bathroom_lights_timer"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 530,
"y": 980,
"wires": [
[]
]
},
{
"id": "3e40025ac99ec712",
"type": "server-events",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.downstairs_bathroom_lights_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 120,
"y": 1100,
"wires": [
[
"5123a607588fa737"
]
]
},
{
"id": "8d2e7fb5f214879c",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "2bdf556c5a30e5d5",
"entities": {
"entity": [
"binary_sensor.downstairs_bathroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 110,
"y": 980,
"wires": [
[
"f84e6b5157e857cf"
]
],
"outputLabels": [
"on"
]
},
{
"id": "b281061a4b08d2eb",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "8aee4d340a136bac",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.downstairs_bathroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 520,
"y": 920,
"wires": [
[]
]
},
{
"id": "85e820743550308b",
"type": "function",
"z": "eff21041cc941fef",
"g": "98e38052d1cc2f9b",
"name": "Adaptive",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst adaptBrt = states['switch.adaptive_lighting_adapt_brightness_living_room'].state\nconst adaptColor = states['switch.adaptive_lighting_adapt_color_living_room'].state\n\nif (adaptBrt === 'on' && adaptColor === 'off') {\n msg.brightness = 'true'\n msg.color = 'false'\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Brightness Only\"});\n} else if (adaptColor === 'on' && adaptBrt === 'off') {\n msg.brightness = 'false'\n msg.color = 'true'\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Color Only\"});\n} else {\n msg.brightness = 'true'\n msg.color = 'true'\n node.status({fill:\"green\",shape:\"dot\",text:\"Both\"});\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 60,
"wires": [
[
"d790134891fedfcc"
]
]
},
{
"id": "c983b44381b46ab5",
"type": "api-current-state",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Home?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.parents_home",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "presence",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 300,
"y": 400,
"wires": [
[
"bc3e0a041efec910",
"2c351b21e13b7289"
],
[]
]
},
{
"id": "bc3e0a041efec910",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Lights Backup",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\": lightsScene,\t \"snapshot_entities\":[\"light.living_room_overhead\",\"light.living_room_led_strip\",\"light.tina_lamp_top\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 180,
"y": 480,
"wires": [
[
"41ababe9cfbe1297"
]
]
},
{
"id": "2c351b21e13b7289",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Adaptive Backup",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\": adaptiveScene,\t \"snapshot_entities\":[\"switch.adaptive_lighting_tina_lamp\",\"switch.adaptive_lighting_living_room\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 190,
"y": 540,
"wires": [
[
"71e6ae54dc1b958b"
]
]
},
{
"id": "71e6ae54dc1b958b",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_living_room",
"switch.adaptive_lighting_tina_lamp"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 390,
"y": 540,
"wires": [
[]
]
},
{
"id": "41ababe9cfbe1297",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Lights Green",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_led_strip",
"light.living_room_lights",
"light.tina_lamp"
],
"labelId": [],
"data": "{\t \"color_name\":\"green\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 550,
"y": 480,
"wires": [
[
"c0ce3c040d25e0a1"
]
]
},
{
"id": "c0ce3c040d25e0a1",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Flash LED Strip",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_pulse",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_led_strip"
],
"labelId": [],
"data": "{\t \"power_on\":\"true\",\t \"mode\":\"ping\",\t \"period\": 1,\t \"cycles\": 30,\t \"color_name\":\"white\",\t \"brightness\": 255\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_pulse",
"x": 740,
"y": 480,
"wires": [
[
"e67a2b594c648ac6"
]
]
},
{
"id": "e67a2b594c648ac6",
"type": "ha-wait-until",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Wait for door",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"binary_sensor.front_door"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "30",
"timeoutType": "num",
"timeoutUnits": "seconds",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [],
"entityLocation": "data",
"entityLocationType": "none",
"x": 610,
"y": 580,
"wires": [
[
"45df5f447e52cb0f"
],
[
"45df5f447e52cb0f"
]
]
},
{
"id": "e8510a6c66cd84e6",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Lights Restore",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.{{lightsScene}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 980,
"y": 580,
"wires": [
[
"2ebe03f5023de47c"
]
]
},
{
"id": "2ebe03f5023de47c",
"type": "delay",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1105,
"y": 580,
"wires": [
[
"12e827e7416c9dac"
]
],
"l": false
},
{
"id": "12e827e7416c9dac",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Stop Effect",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_stop",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_led_strip"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_stop",
"x": 1230,
"y": 580,
"wires": [
[
"e3ecd23a34c7f82e"
]
]
},
{
"id": "e3ecd23a34c7f82e",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Adaptive Restore",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.{{adaptiveScene}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1430,
"y": 580,
"wires": [
[]
]
},
{
"id": "58b11f0c0353d67b",
"type": "comment",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Still need to add support for returning to living room media scenes",
"info": "",
"x": 270,
"y": 600,
"wires": []
},
{
"id": "45df5f447e52cb0f",
"type": "function",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Media?",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst media = states['input_boolean.living_room_entertainment_mode'].state\n\nif (media === 'on') {\n msg.payload = 'on'\n msg.alert = 'on'\n node.status({fill:\"green\",shape:\"dot\",text:\"Media App Running\"})\n return[msg,null]\n} else {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Otherwise\"})\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 780,
"y": 580,
"wires": [
[
"e23e7b080ee3773f"
],
[
"e8510a6c66cd84e6"
]
],
"outputLabels": [
"media app running",
"otherwise"
]
},
{
"id": "e23e7b080ee3773f",
"type": "link out",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Doorbell to Media",
"mode": "link",
"links": [
"27b2c22907382e6d",
"8146f43fea5aec03"
],
"x": 915,
"y": 520,
"wires": []
},
{
"id": "1e1059008d19c0ee",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "31767ffd6a647579",
"name": "Doorbell Rings",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "7d2b67c31769ed69",
"entities": {
"entity": [
"binary_sensor.front_doorbell_ding_mqtt"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "lightsScene",
"propertyType": "msg",
"value": "doorbell_lights_restore",
"valueType": "str"
},
{
"property": "adaptiveScene",
"propertyType": "msg",
"value": "doorbell_adaptive_restore",
"valueType": "str"
}
],
"x": 120,
"y": 400,
"wires": [
[
"c983b44381b46ab5"
],
[]
]
},
{
"id": "87d449113f439710",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Living Room Front Motion",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "4a9187b8b68e4181",
"entities": {
"entity": [
"binary_sensor.living_room_front_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 150,
"y": 700,
"wires": [
[
"7305cfffd320c75a"
]
]
},
{
"id": "29c0dbf6add54879",
"type": "server-events",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.living_room_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "finished",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "timer",
"valueType": "str"
}
],
"x": 180,
"y": 820,
"wires": [
[
"7305cfffd320c75a"
]
]
},
{
"id": "7305cfffd320c75a",
"type": "function",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Living Room Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst peoplePresent = states['binary_sensor.people_present'].state\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst nightMode = states['input_boolean.night_mode'].state\nconst kallenSleeping = states['input_boolean.kallen_sleeping'].state\nconst kallenOvernight = states['input_boolean.kallen_overnight'].state\nconst duration = states['input_number.living_room_lights_off_delay'].state\nconst guestMode = states['input_boolean.guest_mode'].state\nconst newDuration = duration * 60\nconst topic = msg.topic\nconst payload = msg.payload\n\nlet block = {}\n\nif ((peoplePresent === 'on' && vacationMode === 'off' && nightMode === 'on' && guestMode === 'off') && (kallenSleeping === 'on' || kallenOvernight === 'on')) {\n block = false\n} else {\n block = true\n}\n\nif (topic === 'motion' && block === false) {\n if (payload === 'on') {\n node.status({fill:'green',shape:'dot',text:'Motion On'})\n node.send([msg,null,null])\n } else if (payload === 'off') {\n msg.duration = newDuration\n node.status({fill:'red',shape:'ring',text:parseInt(duration) + ' minutes'})\n node.send([null,msg,null])\n }\n} else if (topic === 'timer') {\n if (payload === 'finished') {\n node.status({fill:'green',shape:'dot',text:'Timer Finished'})\n node.send([null,null,msg])\n }\n} else if (block === true) {\n node.status({fill:'red',shape:'ring',text:'Blocked'})\n}",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 430,
"y": 760,
"wires": [
[
"130c6ac167cd49f0"
],
[
"bcbc098444744cbb"
],
[
"f31cabbf0dd66d75"
]
],
"outputLabels": [
"Motion On",
"Motion Off",
"Timer Finished"
],
"icon": "node-red-contrib-huemagic/hue-motion.svg"
},
{
"id": "f511cce02d6ad811",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Living Room Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 850,
"y": 700,
"wires": [
[
"7c33144c3e356edf"
]
]
},
{
"id": "130c6ac167cd49f0",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.living_room_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 650,
"y": 700,
"wires": [
[
"f511cce02d6ad811"
]
]
},
{
"id": "7c33144c3e356edf",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.living_room_scenes"
],
"labelId": [],
"data": "{\t \"option\": \"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1050,
"y": 700,
"wires": [
[]
]
},
{
"id": "bcbc098444744cbb",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.living_room_motion_timer"
],
"labelId": [],
"data": "{\t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 650,
"y": 760,
"wires": [
[]
]
},
{
"id": "f31cabbf0dd66d75",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 640,
"y": 820,
"wires": [
[]
]
},
{
"id": "de9fe68a439b4c41",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "c5511d32d6044b83",
"entities": {
"entity": [
"binary_sensor.mud_room_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 110,
"y": 1260,
"wires": [
[
"7c4cc52be117251f"
]
],
"outputLabels": [
"on"
]
},
{
"id": "7c4cc52be117251f",
"type": "function",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.mud_room_overhead'].state\nconst selScene = states['input_text.mud_room_selected_scene'].state\nconst duration = states['input_number.mud_room_lights_off_delay'].state\nconst lux = parseInt(states['sensor.mud_room_illuminance'].state)\nconst threshold = parseInt(states['input_number.mud_room_lux_threshold'].state)\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nif (payload === 'on') {\n if (lux <= threshold && (lights === 'off' || selScene === 'Nightlight')) {\n node.status({fill:'green',shape:'dot',text:'Turning lights on'})\n node.send([msg,msg,null])\n } else {\n if (lights === 'on') {\n node.status({fill:'red',shape:'ring',text:'Lights already on'})\n node.send([null,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n }\n} else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,null,msg])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 270,
"y": 1260,
"wires": [
[
"67d04dc394a23636"
],
[
"ddae3391e8b78cb8"
],
[
"0c70e666ebfcd6c1"
]
],
"outputLabels": [
"Lights On",
"Cancel Timer",
"Start Timer"
],
"icon": "node-red/timer.svg"
},
{
"id": "a7cd304d11f25e60",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Lights Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.mud_room_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 700,
"y": 1200,
"wires": [
[]
]
},
{
"id": "ddae3391e8b78cb8",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.mud_room_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 530,
"y": 1260,
"wires": [
[]
]
},
{
"id": "0c70e666ebfcd6c1",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.mud_room_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 530,
"y": 1320,
"wires": [
[]
]
},
{
"id": "67d04dc394a23636",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [
"mud_room"
],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 520,
"y": 1200,
"wires": [
[
"a7cd304d11f25e60"
]
]
},
{
"id": "d4c7136ad434c2b5",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.mud_room_overhead"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 530,
"y": 1440,
"wires": [
[]
]
},
{
"id": "95fe501e85a5f65b",
"type": "server-events",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.mud_room_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 120,
"y": 1380,
"wires": [
[
"5d9a85d3534d83e6"
]
]
},
{
"id": "5d9a85d3534d83e6",
"type": "api-current-state",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Early Night Mode?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.early_night_mode",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "earlynight",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 330,
"y": 1380,
"wires": [
[
"fa7c83f1dece9741"
],
[
"d4c7136ad434c2b5"
]
]
},
{
"id": "fa7c83f1dece9741",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "ab4dbcc968a1d346",
"name": "Lights Nightlight",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.mud_room_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Nightlight\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 540,
"y": 1380,
"wires": [
[]
]
},
{
"id": "c96c398bc26cfc26",
"type": "server-state-changed",
"z": "eff21041cc941fef",
"g": "0f7fdf39e4400032",
"name": "Living Room Back Motion",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "4a9187b8b68e4181",
"entities": {
"entity": [
"binary_sensor.living_room_back_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 150,
"y": 760,
"wires": [
[
"7305cfffd320c75a"
]
]
},
{
"id": "1238a342e440e582",
"type": "api-call-service",
"z": "eff21041cc941fef",
"g": "dcdfa098347020de",
"name": "Set Bright",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.mud_room_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Bright\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_select",
"service": "select_option",
"x": 1500,
"y": 60,
"wires": [
[]
]
},
{
"id": "879ee8903841b8f0",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "Upstairs Hallway Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.upstairs_hallway_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "upstairs_hallway",
"valueType": "str"
}
],
"x": 150,
"y": 300,
"wires": [
[
"fba69dfc80829db7"
]
]
},
{
"id": "bc2426cfcd5afbe8",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "Upstairs Bathroom Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.upstairs_bathroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "upstairs_bathroom",
"valueType": "str"
}
],
"x": 150,
"y": 60,
"wires": [
[
"fba69dfc80829db7"
]
]
},
{
"id": "a5498446c1edffa9",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "Kallen Bedroom Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.kallen_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "kallen_bedroom",
"valueType": "str"
}
],
"x": 140,
"y": 120,
"wires": [
[
"fba69dfc80829db7"
]
]
},
{
"id": "f28e7fd88f75041e",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "Emma Bedroom Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.emma_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "emma_bedroom",
"valueType": "str"
}
],
"x": 150,
"y": 180,
"wires": [
[
"fba69dfc80829db7"
]
]
},
{
"id": "e1123236ee16fdaf",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "Master Bedroom Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.master_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "master_bedroom",
"valueType": "str"
}
],
"x": 150,
"y": 240,
"wires": [
[
"fba69dfc80829db7"
]
]
},
{
"id": "a1ee07ab20229b45",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Motion Detected",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "b721c7240c08272f",
"entities": {
"entity": [
"binary_sensor.upstairs_bathroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 120,
"y": 460,
"wires": [
[
"fd33d3e819d8c772"
]
],
"outputLabels": [
"On"
]
},
{
"id": "74c0ced4ac160364",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.upstairs_bathroom_lights"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1330,
"y": 640,
"wires": [
[]
]
},
{
"id": "a17d58585048335d",
"type": "subflow:a4ee891237e460a2",
"z": "5e238cbbe6d612c9",
"g": "fd15bf62ba5e5171",
"name": "",
"x": 520,
"y": 60,
"wires": []
},
{
"id": "d2df58b074b9ba08",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Set Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.upstairs_bathroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 570,
"y": 400,
"wires": [
[]
]
},
{
"id": "83686fab02a3d825",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.upstairs_bathroom_scenes"
],
"labelId": [],
"data": "{\t \"option\": option\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1330,
"y": 580,
"wires": [
[]
]
},
{
"id": "853abef16fadc824",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Shower Mode",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.shower_mode"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "toggle",
"valueType": "str"
},
{
"property": "showermode",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 110,
"y": 640,
"wires": [
[
"f70e4a4480d43b2b"
]
],
"outputLabels": [
"On"
]
},
{
"id": "2ad7be43ccdbdeaf",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.upstairs_bathroom_scenes"
],
"labelId": [],
"data": "{\t \"option\": scene\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 490,
"y": 640,
"wires": [
[]
]
},
{
"id": "ea02f8930aa2c7aa",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Turn Off Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.upstairs_bathroom_lights"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 500,
"y": 700,
"wires": [
[
"8859759915625e2f"
]
]
},
{
"id": "8859759915625e2f",
"type": "delay",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 625,
"y": 700,
"wires": [
[
"3941b4a5b3493461"
]
],
"l": false
},
{
"id": "3941b4a5b3493461",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Adaptive On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_upstairs_bathroom"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_on",
"x": 750,
"y": 700,
"wires": [
[
"0b122b02cfb10c25"
]
]
},
{
"id": "0b122b02cfb10c25",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Set Scene Text",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.upstairs_bathroom_selected_scene"
],
"labelId": [],
"data": "{\t \"value\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 940,
"y": 700,
"wires": [
[]
]
},
{
"id": "31b8c8291d19ffc6",
"type": "link out",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Shower Mode Out",
"mode": "link",
"links": [
"7a7f626dce181b23"
],
"x": 545,
"y": 580,
"wires": []
},
{
"id": "55e84ccb73ae9b74",
"type": "link in",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Goodnight - Lighting",
"links": [
"60ce44747cf3e507"
],
"x": 405,
"y": 520,
"wires": [
[
"a1fa2d2d1f55af4b"
]
]
},
{
"id": "017de174925e8c75",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Motion Detected",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.upstairs_bathroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"x": 1100,
"y": 460,
"wires": [
[
"5e00ecbccbe51462"
],
[]
],
"outputLabels": [
"On",
"Off"
]
},
{
"id": "2dc5f9d3e00f4ddc",
"type": "stoptimer",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"duration": "2",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "Wait 2 Minutes",
"x": 1340,
"y": 460,
"wires": [
[
"86922621398f4b79"
],
[]
]
},
{
"id": "86922621398f4b79",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.upstairs_bathroom_lights"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1530,
"y": 460,
"wires": [
[]
]
},
{
"id": "a1fa2d2d1f55af4b",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.upstairs_bathroom_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 570,
"y": 520,
"wires": [
[
"34e2055344eea8fe"
]
]
},
{
"id": "463689442b9d2046",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.upstairs_bathroom_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 570,
"y": 460,
"wires": [
[]
]
},
{
"id": "5350d2264880d0ad",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.upstairs_bathroom_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 900,
"y": 580,
"wires": [
[
"b9741e2e2ed0448b"
]
]
},
{
"id": "b9741e2e2ed0448b",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Timer Finished",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst showerMode = states['input_boolean.shower_mode'].state\nconst earlyNightMode = states['binary_sensor.early_night_mode'].state\nconst kallenOvernight = states['input_boolean.kallen_overnight'].state\nconst nightMode = states['input_boolean.night_mode'].state\nconst masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state\n\nlet scene = 'Single Nightlight'\nlet late = {}\n\nif (nightMode === 'on' || (earlyNightMode === 'on' && masterBedroomSleep === 'on')) {\n late = true\n} else {\n late = false\n}\n\nif (showerMode === 'off') {\n if (earlyNightMode === 'off') {\n node.send([null,null,msg])\n node.status({fill:'green',shape:'dot',text:'Lights Off'})\n } else {\n msg.option = scene\n node.send([null,msg,null])\n if (late === true && kallenOvernight === 'on') {\n node.send([msg,null,null])\n }\n node.status({fill:'green',shape:'dot',text:'Scene set to ' + scene})\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Blocked'})\n}\n\nnode.log(\"----- Upstairs Bathroom Timer Parameters Start -----\")\nnode.log(\"Upstairs Bathroom showerMode: \" + showerMode)\nnode.log(\"Upstairs Bathroom earlyNightMode: \" + showerMode)\nnode.log(\"Upstairs Bathroom kallenOvernight: \" + kallenOvernight)\nnode.log(\"Upstairs Bathroom nightMode: \" + nightMode)\nnode.log(\"Upstairs Bathroom masterBedroomSleep: \" + masterBedroomSleep)\nnode.log(\"Upstairs Bathroom scene: \" + scene)\nnode.log(\"Upstairs Bathroom late: \" + late)\nnode.log(\"----- Upstairs Bathroom Timer Parameters End -----\")",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 580,
"wires": [
[
"5e00ecbccbe51462"
],
[
"83686fab02a3d825"
],
[
"74c0ced4ac160364"
]
],
"outputLabels": [
"Overnight",
"Scene",
"Lights Off"
]
},
{
"id": "f18aab5a5bda9a84",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Stairwell",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.stairwell_led_strip"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 520,
"y": 1040,
"wires": [
[]
]
},
{
"id": "293a957a5c4f79fa",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "On/Off",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst stairwellLights = states['light.stairwell_led_strip'].state\nconst hallwayLights = states['light.hallway_overhead'].state\nconst earlyNightMode = states['binary_sensor.early_night_mode'].state\nconst nightMode = states['input_boolean.night_mode'].state\nconst goodnight = states['input_boolean.goodnight'].state\nconst masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state\nconst kallenBedroomSleep = states['input_boolean.kallen_sleeping'].state\nconst peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on')\nconst duration = states['input_number.stairwell_lights_off_delay'].state\nconst lux = parseInt(states['sensor.stairwell_bottom_illuminance'].state)\nconst threshold = parseInt(states['input_number.stairwell_lux_threshold'].state)\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nlet hallwayScene = {}\nlet hallwayAction = {}\n\nif (payload === 'on') {\n if (goodnight === 'on') {\n hallwayAction = 'off'\n } else if (nightMode === 'on' || (peopleSleeping === true && earlyNightMode === 'on')) {\n hallwayAction = 'on'\n hallwayScene = 'Nightlight'\n } else if (earlyNightMode === 'on') {\n hallwayAction = 'on'\n hallwayScene = 'Adaptive'\n } else {\n hallwayAction = 'off'\n }\n}\n\nmsg.hallway = hallwayAction\nmsg.scene = hallwayScene\n\nif (payload === 'on') {\n if (lux <= threshold || stairwellLights === 'on' || hallwayLights === 'on') {\n if (hallwayScene === 'Adaptive') {\n node.send([null,null,msg,msg])\n } else if (hallwayAction === 'on') {\n node.send([null,null,msg,null])\n }\n node.status({fill:'green',shape:'dot',text:'Lights On'})\n node.send([msg,null,null,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n} else if (payload === 'off') {\n if (stairwellLights === 'on' || hallwayLights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,msg,null,null])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n}",
"outputs": 4,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 290,
"y": 880,
"wires": [
[
"4e3d058c164d6a97"
],
[
"96e7237a63089317"
],
[
"b05b87a1e43f11f9"
],
[
"48c5c102461f0981"
]
],
"outputLabels": [
"Stairwell",
"Timer",
"Hallway Scene",
"Hallway On/Off"
],
"icon": "node-red/timer.svg"
},
{
"id": "96e7237a63089317",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.stairwell_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 530,
"y": 860,
"wires": [
[]
]
},
{
"id": "33ba5ffd653f09a1",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.stairwell_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 710,
"y": 800,
"wires": [
[]
]
},
{
"id": "0df82708f1ef261c",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.stairwell_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 120,
"y": 980,
"wires": [
[
"76423fc24fedb52c"
]
]
},
{
"id": "48c2ad199a4ab538",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "e86f48a9dd99dd2b",
"entities": {
"entity": [
"binary_sensor.stairwell_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 110,
"y": 880,
"wires": [
[
"293a957a5c4f79fa"
]
],
"outputLabels": [
"on"
]
},
{
"id": "4e3d058c164d6a97",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.stairwell_led_strip"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 520,
"y": 800,
"wires": [
[
"33ba5ffd653f09a1"
]
]
},
{
"id": "c3f2a4aa281295ce",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.emma_bedroom_light"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 530,
"y": 1380,
"wires": [
[]
]
},
{
"id": "3b698d0a4f2620bd",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.emma_bedroom_light'].state\nconst duration = states['input_number.emma_bedroom_lights_off_delay'].state\nconst lux = parseInt(states['sensor.emma_bedroom_illuminance'].state)\nconst threshold = parseInt(states['input_number.emma_bedroom_lux_threshold'].state)\nconst sleeping = states['input_boolean.emma_sleeping'].state\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nif (sleeping === 'off') {\n if (payload === 'on') {\n if (lux <= threshold && lights === 'off') {\n node.status({fill:'green',shape:'dot',text:'Turning lights on'})\n node.send([msg,msg,null])\n } else {\n if (lights === 'on') {\n node.status({fill:'red',shape:'ring',text:'Lights already on'})\n node.send([null,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n }\n } else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,null,msg])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Blocked (Sleeping)'})\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 270,
"y": 1260,
"wires": [
[
"440fc7142e7345d4"
],
[
"b058c2262ac522ff"
],
[
"55c893b1d3009fed"
]
],
"outputLabels": [
"Lights On",
"Cancel Timer",
"Start Timer"
],
"icon": "node-red/timer.svg"
},
{
"id": "55c893b1d3009fed",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.emma_bedroom_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 530,
"y": 1320,
"wires": [
[]
]
},
{
"id": "b058c2262ac522ff",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.emma_bedroom_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 530,
"y": 1260,
"wires": [
[]
]
},
{
"id": "b542615d3dee41f6",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.emma_bedroom_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 120,
"y": 1380,
"wires": [
[
"cef61cdb2808ce5a"
]
]
},
{
"id": "fc25e2a837ec8229",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "f3f1bf31d66d2f88",
"entities": {
"entity": [
"binary_sensor.emma_bedroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 110,
"y": 1260,
"wires": [
[
"3b698d0a4f2620bd"
]
],
"outputLabels": [
"on"
]
},
{
"id": "440fc7142e7345d4",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.emma_bedroom_light"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 520,
"y": 1200,
"wires": [
[]
]
},
{
"id": "cef61cdb2808ce5a",
"type": "api-current-state",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Sleep Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.emma_sleeping",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 330,
"y": 1380,
"wires": [
[
"c3f2a4aa281295ce"
],
[]
]
},
{
"id": "fd33d3e819d8c772",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Motion Detected",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.upstairs_bathroom_lights'].state\nconst duration = states['input_number.upstairs_bathroom_motion_off_delay'].state\nconst lux = parseInt(states['sensor.upstairs_bathroom_illuminance'].state)\nconst threshold = parseInt(states['input_number.upstairs_bathroom_lux_threshold'].state)\nconst showerMode = states['input_boolean.shower_mode'].state\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nlet timerCancel = {\n \"payload\": \"stop\"\n}\n\nif (showerMode === 'off') {\n if (payload === 'on') {\n node.send([null,null,timerCancel])\n if (lux <= threshold || lights === 'on') {\n node.status({fill:'green',shape:'dot',text:'Lights On'})\n node.send([msg,null,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n } else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,msg,null])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n }\n}\n\nnode.log(\"----- Upstairs Bathroom Motion Parameters Start -----\")\nnode.log(\"Upstairs Bathroom payload: \" + payload)\nnode.log(\"Upstairs Bathroom lights: \" + lights)\nnode.log(\"Upstairs Bathroom duration: \" + duration)\nnode.log(\"Upstairs Bathroom newDuration: \" + newDuration)\nnode.log(\"Upstairs Bathroom lux: \" + lux)\nnode.log(\"Upstairs Bathroom threshold: \" + threshold)\nnode.log(\"Upstairs Bathroom showerMode: \" + showerMode)\nnode.log(\"----- Upstairs Bathroom Motion Parameters End -----\")",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 460,
"wires": [
[
"d2df58b074b9ba08"
],
[
"463689442b9d2046"
],
[
"a1fa2d2d1f55af4b"
]
],
"outputLabels": [
"On",
"Off",
"Timer Cancel"
]
},
{
"id": "f70e4a4480d43b2b",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "Shower Mode",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst occupied = states['binary_sensor.upstairs_bathroom_occupied'].state\nconst earlyNightMode = states['binary_sensor.early_night_mode'].state\nconst nightMode = states['input_boolean.night_mode'].state\nconst kallenOvernight = states['input_boolean.kallen_overnight'].state\nconst motion = states['binary_sensor.upstairs_bathroom_motion'].state\nconst payload = msg.payload\n\nlet timerCancel = {\n \"payload\": \"stop\"\n}\n\nlet scene = {}\nif (payload === 'on') {\n scene = 'Bright'\n} else {\n if (motion === 'on') {\n scene = 'Adaptive'\n } else {\n scene = 'Single Nightlight'\n }\n}\n\nif (payload === 'on') {\n msg.scene = scene\n node.status({fill:'green',shape:'dot',text:'Shower Mode On'})\n node.send([timerCancel,msg,null])\n} else if (payload === 'off') {\n node.send([timerCancel,null,null])\n if (motion === 'on') {\n msg.scene = scene\n node.status({fill:'green',shape:'dot',text:'Lights Adaptive'})\n node.send([null,msg,null])\n } else if (earlyNightMode === 'on') {\n if (kallenOvernight === 'on') {\n node.status({fill:'green',shape:'dot',text:'Lights Off'})\n node.send([null,null,msg])\n } else {\n msg.scene = scene\n node.status({fill:'green',shape:'dot',text:'Scene Set'})\n node.send([null,msg,null])\n }\n } else {\n node.status({fill:'green',shape:'dot',text:'Lights Off'})\n node.send([null,null,msg])\n }\n}\n\nnode.log(\"----- Upstairs Bathroom Shower Mode Parameters Start -----\")\nnode.log(\"Upstairs Bathroom payload: \" + payload)\nnode.log(\"Upstairs Bathroom scene: \" + scene)\nif (payload === 'off') {\n node.log(\"Upstairs Bathroom occupied: \" + occupied)\n node.log(\"Upstairs Bathroom earlyNightMode: \" + earlyNightMode)\n node.log(\"Upstairs Bathroom nightMode: \" + nightMode)\n node.log(\"Upstairs Bathroom kallenOvernight: \" + kallenOvernight)\n node.log(\"Upstairs Bathroom motion: \" + motion)\n}\nnode.log(\"----- Upstairs Bathroom Shower Mode Parameters End -----\")",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 640,
"wires": [
[
"a1fa2d2d1f55af4b"
],
[
"2ad7be43ccdbdeaf",
"31b8c8291d19ffc6"
],
[
"ea02f8930aa2c7aa"
]
],
"outputLabels": [
"Cancel Timer",
"Set Scene",
"Lights Off"
]
},
{
"id": "5e00ecbccbe51462",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "eccca853a916b662",
"name": "function 13",
"func": "const payload = msg.payload\n\nif (payload === 'stop') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Timer Stopped\"})\n} else {\n node.log(\"Upstairs Bathroom 2-minute timer started\")\n node.log(\"Upstairs Bathroom 2-minute timer payload: \" + payload)\n node.status({fill:\"red\",shape:\"ring\",text:\"Message Logged\"})\n} \n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1215,
"y": 520,
"wires": [
[
"2dc5f9d3e00f4ddc"
]
],
"l": false
},
{
"id": "76423fc24fedb52c",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Settings",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst earlyNightMode = states['binary_sensor.early_night_mode'].state\nconst nightMode = states['input_boolean.night_mode'].state\nconst goodnight = states['input_boolean.goodnight'].state\nconst masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state\nconst kallenBedroomSleep = states['input_boolean.kallen_sleeping'].state\nconst peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on')\n\nlet hallwayScene = {}\nlet hallwayAction = {}\n\nif (goodnight === 'on' || peopleSleeping === true) {\n hallwayAction = 'off'\n} else if (earlyNightMode === 'on' || nightMode === 'on') {\n hallwayAction = 'on'\n hallwayScene = 'Nightlight'\n} else {\n hallwayAction = 'off'\n}\n\nmsg.hallway = hallwayAction\n\n// Turn off Stairwell LED Strip\nnode.send([null,null,msg])\n\n// Hallway actions\nif (hallwayAction === 'on') {\n msg.scene = hallwayScene\n node.status({fill:'green',shape:'dot',text:'Hallway ' + hallwayScene})\n node.send([msg,null,null])\n} else if (hallwayAction === 'off') {\n node.status({fill:'green',shape:'dot',text:'Hallway Off'})\n node.send([null,msg,null])\n}",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 980,
"wires": [
[
"b05b87a1e43f11f9"
],
[
"48c5c102461f0981"
],
[
"f18aab5a5bda9a84"
]
],
"outputLabels": [
"Scene",
"Hallway",
"Stairwell"
]
},
{
"id": "48c5c102461f0981",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Hallway On/Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_{{hallway}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.hallway_overhead"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_{{hallway}}",
"x": 540,
"y": 980,
"wires": [
[]
]
},
{
"id": "b05b87a1e43f11f9",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Hallway Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.upstairs_hallway_scenes"
],
"labelId": [],
"data": "{\t \"option\": scene\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 540,
"y": 920,
"wires": [
[]
]
},
{
"id": "ef677459c795d246",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Goodnight",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.goodnight"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 100,
"y": 1100,
"wires": [
[
"1f1489a0514e233b"
]
]
},
{
"id": "1f1489a0514e233b",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "f16f28689b7ec2b4",
"name": "Sleep Mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_{{payload}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_sleep_mode_stairwell"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_{{payload}}",
"x": 530,
"y": 1100,
"wires": [
[]
]
},
{
"id": "f3824e4c7e202605",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kallen_bedroom_lights"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1390,
"y": 980,
"wires": [
[]
]
},
{
"id": "4954c509d4d697e2",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.kallen_bedroom_lights'].state\nconst duration = states['input_number.kallen_bedroom_lights_off_delay'].state\nconst lux = parseInt(states['sensor.kallen_bedroom_illuminance'].state)\nconst threshold = parseInt(states['input_number.kallen_bedroom_lux_threshold'].state)\nconst kallenBedroomSleep = states['input_boolean.kallen_sleeping'].state\nconst masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state\nconst peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on')\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nif (peopleSleeping === false) {\n if (payload === 'on') {\n if (lux <= threshold && lights === 'off') {\n node.status({fill:'green',shape:'dot',text:'Turning lights on'})\n node.send([msg,msg,null])\n } else {\n if (lights === 'on') {\n node.status({fill:'red',shape:'ring',text:'Lights already on'})\n node.send([null,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n }\n } else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,null,msg])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Blocked (Sleeping)'})\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1130,
"y": 860,
"wires": [
[
"5524e8ba9b5545be"
],
[
"bbe9fd4eff4e6a04"
],
[
"9a8f53db7d3ed3b7"
]
],
"outputLabels": [
"Lights On",
"Cancel Timer",
"Start Timer"
],
"icon": "node-red/timer.svg"
},
{
"id": "9a8f53db7d3ed3b7",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.kallen_bedroom_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 1390,
"y": 920,
"wires": [
[]
]
},
{
"id": "bbe9fd4eff4e6a04",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.kallen_bedroom_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 1390,
"y": 860,
"wires": [
[]
]
},
{
"id": "f6aca47ad4719dab",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.kallen_bedroom_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 980,
"y": 980,
"wires": [
[
"0b5424aadc3479f7"
]
]
},
{
"id": "1a63ea711d6658b2",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "5053909a498e0d02",
"entities": {
"entity": [
"binary_sensor.kallen_bedroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 970,
"y": 860,
"wires": [
[
"4954c509d4d697e2"
]
],
"outputLabels": [
"on"
]
},
{
"id": "0b5424aadc3479f7",
"type": "api-current-state",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Sleep Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_sleeping",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1190,
"y": 980,
"wires": [
[
"f3824e4c7e202605"
],
[]
]
},
{
"id": "5524e8ba9b5545be",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "5c1df7492351b925",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_bedroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1380,
"y": 800,
"wires": [
[]
]
},
{
"id": "e270c73896a1a50c",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.master_bedroom_lights"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1390,
"y": 1260,
"wires": [
[]
]
},
{
"id": "3063e6a5b5c3f677",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst lights = states['light.master_bedroom_lights'].state\nconst duration = states['input_number.master_bedroom_lights_off_delay'].state\nconst lux = parseInt(states['sensor.master_bedroom_illuminance'].state)\nconst threshold = parseInt(states['input_number.master_bedroom_lux_threshold'].state)\nconst masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state\nconst kallenBedroomSleep = states['input_boolean.kallen_sleeping'].state\nconst peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on')\nconst nightMode = states['input_boolean.night_mode'].state\nconst payload = msg.payload\nconst newDuration = duration * 60\n\nif (peopleSleeping === false && nightMode === 'off') {\n if (payload === 'on') {\n if (lux <= threshold && lights === 'off') {\n node.status({fill:'green',shape:'dot',text:'Turning lights on'})\n node.send([msg,msg,null])\n } else {\n if (lights === 'on') {\n node.status({fill:'red',shape:'ring',text:'Lights already on'})\n node.send([null,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Too bright'})\n }\n }\n } else if (payload === 'off') {\n if (lights === 'on') {\n msg.duration = newDuration\n node.status({fill:\"green\",shape:\"dot\",text:parseInt(duration) + ' minutes'})\n node.send([null,null,msg])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Lights already off\"})\n }\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Blocked (Sleeping)'})\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1130,
"y": 1140,
"wires": [
[
"81129efa6676b58e"
],
[
"f14572686bbbbf9e"
],
[
"31686303c43971c7"
]
],
"outputLabels": [
"Lights On",
"Cancel Timer",
"Start Timer"
],
"icon": "node-red/timer.svg"
},
{
"id": "31686303c43971c7",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.master_bedroom_motion_timer"
],
"labelId": [],
"data": "{ \t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 1390,
"y": 1200,
"wires": [
[]
]
},
{
"id": "f14572686bbbbf9e",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.master_bedroom_motion_timer"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 1390,
"y": 1140,
"wires": [
[]
]
},
{
"id": "602869aebc96184c",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.master_bedroom_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 980,
"y": 1260,
"wires": [
[
"4a431478798a51c8"
]
]
},
{
"id": "cfb6cf1f5f583447",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Motion Sensor",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "9a5af08b3c421d41",
"entities": {
"entity": [
"binary_sensor.master_bedroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "detect",
"propertyType": "msg",
"value": "motion",
"valueType": "str"
}
],
"x": 970,
"y": 1140,
"wires": [
[
"3063e6a5b5c3f677"
]
],
"outputLabels": [
"on"
]
},
{
"id": "4a431478798a51c8",
"type": "api-current-state",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Sleep Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.master_bedroom_sleeping",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1190,
"y": 1260,
"wires": [
[
"e270c73896a1a50c"
],
[]
]
},
{
"id": "81129efa6676b58e",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "505e378279011759",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.master_bedroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1380,
"y": 1080,
"wires": [
[]
]
},
{
"id": "b26bc471bcac2653",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "c1e37f193ee65d73",
"name": "Auto Shower Mode",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst showerMode = states['input_boolean.shower_mode'].state\nconst tempChange = parseFloat(msg.payload)\n\nlet action = {}\n\nif (tempChange < 0) {\n action = 'off'\n} else if (tempChange >= 5.0) {\n action = 'on'\n} else {\n action = 'none'\n}\n\nlet actionMsg = {\n 'action': 'turn_' + action\n}\n\nif ((action === 'on' && showerMode === 'off') || (action === 'off' && showerMode === 'on')) {\n node.status({fill:'green',shape:'dot',text:'Shower Mode ' + action})\n node.send(actionMsg)\n} else {\n node.status({fill:'red',shape:'ring',text:'No action taken'})\n return null\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1030,
"y": 60,
"wires": [
[
"646ac99f62432e22"
]
]
},
{
"id": "b51f19fa5b3d1587",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "c1e37f193ee65d73",
"name": "Temp Change",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "48a08ecc20e474e9",
"entities": {
"entity": [
"sensor.upstairs_bathroom_temp_change"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "temp-change",
"valueType": "str"
}
],
"x": 770,
"y": 60,
"wires": [
[
"b26bc471bcac2653"
]
]
},
{
"id": "646ac99f62432e22",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "c1e37f193ee65d73",
"name": "Turn on/off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.{{action}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.shower_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "{{action}}",
"x": 1250,
"y": 60,
"wires": [
[]
]
},
{
"id": "0367216416de8b4d",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Door",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "9643a7993e266372",
"entities": {
"entity": [
"binary_sensor.emma_bedroom_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "door",
"valueType": "str"
}
],
"x": 90,
"y": 1440,
"wires": [
[
"03075516f3003707"
]
]
},
{
"id": "03075516f3003707",
"type": "function",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Door Alert",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst masterBedroomSleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst emmaSleep = states['input_boolean.emma_sleeping'].state\nconst tonyAwake = states['input_boolean.tony_awake'].state\nconst xiaDesktopUser = states['sensor.xia_desktop_current_username'].state\nconst xiaDesktopIdle = states['binary_sensor.tina_desktop_idle'].state\nconst tonyLocation = states['person.tony_stork'].state\nconst tinaLocation = states['person.christina_stork'].state\nconst overnight = states['binary_sensor.overnight'].state\nconst payload = msg.payload\nconst topic = msg.topic\n\n// Set some default values\n\nlet who = 'Alexa Everywhere' // Default to playing on all Echo Dots unless told otherwise\nlet tinaAvailable = false\nlet tonyAvailable = false\nlet enable = false\nlet reason = {}\n\n// Determine who is available to respond\n\nif (tonyAwake === 'on' && tonyLocation === 'home') {\n tonyAvailable = true\n}\n\nif (xiaDesktopUser === 'irish' && xiaDesktopIdle === 'off' && tinaLocation === 'home') {\n tinaAvailable = true\n}\n\n// If both of us are still asleep, or I am asleep and she is at work, play the alert only in the master bedroom\n\nif (tinaAvailable === false && tonyAvailable === false) {\n who = 'Master Bedroom'\n}\n\n// Determine if the alert should be sent\n\nif (emmaSleep === 'on') {\n if (overnight === 'on' && masterBedroomSleeping === 'on') {\n enable = true\n reason = 'Overnight is on, and master bedroom is sleeping'\n } else if (overnight === 'off') {\n enable = true\n reason = 'Overnight is off'\n }\n}\n\n// Define the alert message\n\nlet alertTTS = {\n \"topic\": who,\n \"payload\": \"Emma has opened her door, please check on her. I repeat, Emma has opened her door, please check on her. This is urgent, Emma is awake. PDS toddler warning, a large and extremely dangerous toddler is on the ground in your area.\",\n \"type\": \"critical\"\n}\n\n// Add some logs for debugging\n\nnode.log(`--------------- Emma Door Alert --------------`)\nnode.log(`Emma Door Alert - topic: ${topic}`)\nnode.log(`Emma Door Alert - payload: ${payload}`)\nnode.log(`Emma Door Alert - masterBedroomSleeping: ${masterBedroomSleeping}`)\nnode.log(`Emma Door Alert - emmaSleep: ${emmaSleep}`)\nnode.log(`Emma Door Alert - tonyAwake: ${tonyAwake}`)\nnode.log(`Emma Door Alert - xiaDesktopUser: ${xiaDesktopUser}`)\nnode.log(`Emma Door Alert - xiaDesktopIdle: ${xiaDesktopIdle}`)\nnode.log(`Emma Door Alert - tonyLocation: ${tonyLocation}`)\nnode.log(`Emma Door Alert - tinaLocation: ${tinaLocation}`)\nnode.log(`Emma Door Alert - overnight: ${overnight}`)\nnode.log(`Emma Door Alert - tonyAvailable: ${tonyAvailable}`)\nnode.log(`Emma Door Alert - tinaAvailable: ${tinaAvailable}`)\nnode.log(`Emma Door Alert - who: ${who}`)\nnode.log(`Emma Door Alert - enable: ${enable}`)\nnode.log(`Emma Door Alert - reason: ${reason}`)\nnode.log(`----------------------------------------------`)\n\n// Send the alert if conditions are met\n\nif (topic === 'door' && payload === 'on') {\n if (enable === true) {\n node.status({fill:'green',shape:'dot',text:`Sending alert to ${who}`})\n node.send([alertTTS,msg,null])\n } else {\n node.status({fill:'red',shape:'ring',text:'Door Opened, but no alert sent'})\n }\n} else if (topic === 'timer') {\n node.status({fill:'green',shape:'dot',text:'Timer Finished'})\n node.send([alertTTS,msg,null])\n} else if (topic === 'cancel') {\n node.status({fill:'green',shape:'dot',text:'Cancel Button Pressed'})\n node.send([null,null,msg])\n} else if (topic === 'door' && payload === 'off') {\n node.status({fill:'green',shape:'dot',text:'Door Closed'})\n}",
"outputs": 3,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 1500,
"wires": [
[
"2e356bc6f1ad80dc"
],
[
"c9d498c1e323b1e4"
],
[
"515f7471cec7bce2"
]
],
"outputLabels": [
"TTS Output",
"Start Timer",
"Cancel Timer"
]
},
{
"id": "2e356bc6f1ad80dc",
"type": "subflow:6429099c4571dd6b",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "",
"x": 540,
"y": 1440,
"wires": [
[]
]
},
{
"id": "c9d498c1e323b1e4",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.emma_door_alert"
],
"labelId": [],
"data": "{\"duration\":\"00:00:30\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "timer",
"service": "start",
"x": 530,
"y": 1500,
"wires": [
[]
]
},
{
"id": "f7bd6d5fabdba0e0",
"type": "server-events",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.emma_door_alert\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "timer",
"valueType": "str"
}
],
"x": 120,
"y": 1500,
"wires": [
[
"03075516f3003707"
]
]
},
{
"id": "515f7471cec7bce2",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.emma_door_alert"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "timer",
"service": "cancel",
"x": 530,
"y": 1560,
"wires": [
[
"40dae72402f8cdee"
]
]
},
{
"id": "ca85b450d07da81c",
"type": "ha-button",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Cancel Button",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "7d7c641acaff9284",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "cancel",
"valueType": "str"
}
],
"x": 110,
"y": 1560,
"wires": [
[
"03075516f3003707"
]
]
},
{
"id": "40dae72402f8cdee",
"type": "api-call-service",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Volume Reset",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.volume_reset",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "script",
"service": "volume_reset",
"x": 720,
"y": 1560,
"wires": [
[]
]
},
{
"id": "bb3469b3ec117aab",
"type": "server-state-changed",
"z": "5e238cbbe6d612c9",
"g": "ba738e13229c781b",
"name": "Sleep Off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.emma_sleeping"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "cancel",
"valueType": "str"
}
],
"x": 100,
"y": 1620,
"wires": [
[
"03075516f3003707"
],
[]
]
},
{
"id": "07049ae77b6751c6",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "a60d1c8190059645",
"name": "Basement Studio Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.basement_studio_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "basement_studio",
"valueType": "str"
}
],
"x": 150,
"y": 60,
"wires": [
[
"31c254f61982f19d"
]
]
},
{
"id": "5e31d6aacad206b8",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"name": "Light turned on",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.furnace_room_overhead"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 740,
"y": 60,
"wires": [
[
"dd3608c864d7007b"
],
[]
]
},
{
"id": "18599ab162ab225b",
"type": "change",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"name": "Stop Timer",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "stop",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 930,
"y": 120,
"wires": [
[
"dd3608c864d7007b"
]
]
},
{
"id": "dd3608c864d7007b",
"type": "stoptimer",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"duration": "60",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 1140,
"y": 60,
"wires": [
[
"e79ecc6c79946cc4"
],
[]
]
},
{
"id": "e79ecc6c79946cc4",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.furnace_room_overhead"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1330,
"y": 60,
"wires": [
[]
]
},
{
"id": "ab01d3d95c7ea717",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"name": "Light turned off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.furnace_room_overhead"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 740,
"y": 120,
"wires": [
[
"18599ab162ab225b"
],
[]
]
},
{
"id": "8fa363e9e0c1b165",
"type": "comment",
"z": "47f17992fab9b4f5",
"g": "d00eb21154ac4160",
"name": "Furnace Room",
"info": "",
"x": 940,
"y": 60,
"wires": []
},
{
"id": "97a441f1ac510844",
"type": "inject",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 220,
"wires": [
[
"3c83c0ab0aa96e3d"
]
]
},
{
"id": "fbe3667814a51f6f",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Front Door Opens",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_door"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 210,
"y": 280,
"wires": [
[
"3c83c0ab0aa96e3d"
],
[]
]
},
{
"id": "ec543bc9adac3d08",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Basement Lights On?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.basement_studio_lights",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 620,
"y": 280,
"wires": [
[
"981191938ab4ee2f"
],
[]
]
},
{
"id": "d4019d35bf5a5f98",
"type": "inject",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 400,
"wires": [
[
"7b71cb1967ec5255"
]
]
},
{
"id": "25e12d8e4a0a7f11",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Doorbell Rings",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_doorbell_ding_mqtt"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 200,
"y": 460,
"wires": [
[
"7b71cb1967ec5255"
],
[]
]
},
{
"id": "e91c3392b59ff9d1",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Basement Lights On?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.basement_studio_lights",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 620,
"y": 460,
"wires": [
[
"59af14a564176ce4"
],
[]
]
},
{
"id": "981191938ab4ee2f",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Studio Quiet?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.studio_quiet",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 840,
"y": 280,
"wires": [
[
"03fad0a960ff39e7"
],
[]
]
},
{
"id": "59af14a564176ce4",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Studio Quiet?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.studio_quiet",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 840,
"y": 460,
"wires": [
[
"c0933fcc8737bc0b"
],
[]
]
},
{
"id": "3c83c0ab0aa96e3d",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Save State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"basement_restore\",\t \"snapshot_entities\":[\"light.basement_led_strip_1\",\"light.basement_tall_lamp\",\"light.basement_short_lamp\",\"light.basement_stairwell\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 410,
"y": 280,
"wires": [
[
"ec543bc9adac3d08"
]
]
},
{
"id": "7b71cb1967ec5255",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Save State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"basement_restore\",\t \"snapshot_entities\":[\"light.basement_led_strip_1\",\"light.basement_tall_lamp\",\"light.basement_short_lamp\",\"light.basement_stairwell\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 410,
"y": 460,
"wires": [
[
"e91c3392b59ff9d1"
]
]
},
{
"id": "1f5808147fa975cf",
"type": "link in",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Basement On - iOS",
"links": [
"572b2040be874f4e"
],
"x": 135,
"y": 940,
"wires": [
[
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"bd6bdc6ed9aded9d",
"3bd0a22c66de228a"
]
]
},
{
"id": "1966d10d8f4467c7",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Alexa Button",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_button.basement_on"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "alexa",
"valueType": "str"
}
],
"x": 190,
"y": 880,
"wires": [
[
"0c7ef72bd0ef47d4"
]
]
},
{
"id": "a9bc78f321149316",
"type": "ha-button",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Manual Button",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "23e5e32354cf867a",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
}
],
"x": 190,
"y": 1120,
"wires": [
[
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"bd6bdc6ed9aded9d",
"3bd0a22c66de228a"
]
]
},
{
"id": "b3bb08ff51e46985",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"d": true,
"g": "550e5b2d99316b12",
"name": "Alexa Actionable Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.activate_alexa_actionable_notification",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"text\": \"<voice name='Joanna'><prosody rate='150%'>Would you like me to turn on the computer for Collin?</prosody></voice>\",\t \"event_id\": \"actionable_notification_kallen_computer_on\",\t \"alexa_device\": $globalContext('lastAlexaEntityId')\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "activate_alexa_actionable_notification",
"x": 940,
"y": 880,
"wires": [
[]
]
},
{
"id": "0c7ef72bd0ef47d4",
"type": "delay",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 315,
"y": 880,
"wires": [
[
"2516c6e3146cc851",
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"bd6bdc6ed9aded9d"
]
],
"l": false
},
{
"id": "795c53ad6642733a",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "iOS Actionable Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"title\":\"Basement On\",\t \"message\": \"Should I turn on Kallen's computer?\",\t \"tag\":\"kallen_PC\",\t \"who\": user,\t \"type\":\"alert\",\t \"actions\": [\t {\t \"action\": \"KALLEN_PC_YES\",\t \"title\": \"Yes\",\t \"icon\": \"mdi:thumb-up\"\t },\t {\t \"action\": \"KALLEN_PC_NO\",\t \"title\": \"No\",\t \"icon\": \"mdi:thumb-down\"\t }\t ]\t\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 760,
"y": 1120,
"wires": [
[]
]
},
{
"id": "ea5306d6f92d9550",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Tony PC On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tony_desktop_wake",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tony_desktop_wake",
"x": 450,
"y": 940,
"wires": [
[
"4829663e9913e2aa"
]
]
},
{
"id": "4829663e9913e2aa",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "TV On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "media_player.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"media_player.basement_tv"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "media_player",
"service": "turn_on",
"x": 610,
"y": 940,
"wires": [
[]
]
},
{
"id": "61cb79c998ee0b59",
"type": "change",
"z": "47f17992fab9b4f5",
"d": true,
"g": "550e5b2d99316b12",
"name": "Last Alexa",
"rules": [
{
"t": "set",
"p": "last_alexa",
"pt": "msg",
"to": "lastAlexaEntityId",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 710,
"y": 880,
"wires": [
[
"b3bb08ff51e46985"
]
]
},
{
"id": "73078f818abdc6c2",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Kallen's Computer On?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.kallen_desktop_on",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "kallen_pc",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 490,
"y": 1120,
"wires": [
[],
[
"795c53ad6642733a"
]
]
},
{
"id": "2516c6e3146cc851",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"d": true,
"g": "550e5b2d99316b12",
"name": "Kallen's Computer On?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.kallen_desktop_on",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "kallen_pc",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 490,
"y": 880,
"wires": [
[],
[
"61cb79c998ee0b59"
]
]
},
{
"id": "03fad0a960ff39e7",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Red Alert",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.basement_lights_alert",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"duration\": 5,\t \"type\": \"red\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "basement_lights_alert",
"x": 1020,
"y": 280,
"wires": [
[]
]
},
{
"id": "c0933fcc8737bc0b",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "208284848b13b85b",
"name": "Green Alert",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.basement_lights_alert",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"duration\": 5,\t \"type\": \"green\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "basement_lights_alert",
"x": 1030,
"y": 460,
"wires": [
[]
]
},
{
"id": "31c254f61982f19d",
"type": "subflow:a4ee891237e460a2",
"z": "47f17992fab9b4f5",
"g": "a60d1c8190059645",
"name": "",
"x": 400,
"y": 60,
"wires": []
},
{
"id": "56c84e793b8b0d79",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn off any active modes",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.gaming_mode",
"input_boolean.recliner_mode",
"input_boolean.studio_quiet"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 290,
"y": 1220,
"wires": [
[
"a4490fb4765e1c9c",
"4c7184cd35bf3f1f",
"f052c9629cad7a5f",
"80c5f8a40169fcb7",
"15c84d12d17ac254"
]
]
},
{
"id": "9751c5a6a1b98b7d",
"type": "link in",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Basement Shutdown Full",
"links": [
"9d1cf8af02a6c86b"
],
"x": 135,
"y": 1220,
"wires": [
[
"56c84e793b8b0d79"
]
]
},
{
"id": "a4490fb4765e1c9c",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "If Basement TV is not playing",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "playing",
"halt_if_type": "str",
"halt_if_compare": "is_not",
"entity_id": "media_player.basement_tv",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "tv",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 580,
"y": 1280,
"wires": [
[
"0cfd7edd88cfa0de"
],
[]
],
"outputLabels": [
"Not Playing",
"Else"
]
},
{
"id": "0cfd7edd88cfa0de",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn off Basement TV",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "media_player.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"media_player.basement_tv"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "media_player",
"service": "turn_off",
"x": 840,
"y": 1280,
"wires": [
[]
]
},
{
"id": "4c7184cd35bf3f1f",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "If K's PC is not sched for updates",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_computer_updates",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "kallen-updates",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 600,
"y": 1340,
"wires": [
[
"4681a8b5fa2d942c"
],
[
"09dd0d2cf254619e"
]
],
"outputLabels": [
"No Updates",
"Else"
]
},
{
"id": "4681a8b5fa2d942c",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Shut Down K's PC",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_desktop_shutdown",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_desktop_shutdown",
"x": 870,
"y": 1340,
"wires": [
[]
]
},
{
"id": "09dd0d2cf254619e",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Lock K's PC",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_desktop_lock",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_desktop_lock",
"x": 850,
"y": 1400,
"wires": [
[
"bbcf0451ac4c4cd4"
]
]
},
{
"id": "bbcf0451ac4c4cd4",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn off updates",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.kallen_computer_updates"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 1040,
"y": 1400,
"wires": [
[]
]
},
{
"id": "f052c9629cad7a5f",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Ask to shutdown main PC",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\"type\":\"alert\",\"who\":\"tony\",\"title\":\"Basement Shutting Down\",\"message\":\"Would you like to shut down your computer?\",\"tag\":\"tony-pc-shutdown\",\"actions\":[{\"action\":\"TONY_COMPUTER_SHUTDOWN\",\"title\":\"Shutdown\"},{\"action\":\"TONY_COMPUTER_LOCK\",\"title\":\"Lock\"},{\"action\":\"TONY_COMPUTER_IGNORE\",\"title\":\"Do Nothing\"}]}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 570,
"y": 1400,
"wires": [
[]
]
},
{
"id": "80c5f8a40169fcb7",
"type": "ha-wait-until",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Wait for door to open",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"binary_sensor.basement_studio_door"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "5",
"timeoutType": "num",
"timeoutUnits": "minutes",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [],
"entityLocation": "data",
"entityLocationType": "none",
"x": 560,
"y": 1220,
"wires": [
[
"a9bbf53b9584976a"
],
[
"a9bbf53b9584976a"
]
]
},
{
"id": "a9bbf53b9584976a",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn off fan",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "fan.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"fan.basement_fan"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "fan",
"service": "turn_off",
"x": 770,
"y": 1220,
"wires": [
[
"cc0407d29b656ca6"
]
]
},
{
"id": "cc0407d29b656ca6",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn off lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_studio_lights"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 960,
"y": 1220,
"wires": [
[
"fc1ca3e2f921b01e"
]
]
},
{
"id": "fc1ca3e2f921b01e",
"type": "ha-wait-until",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Wait for door to close",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"binary_sensor.basement_studio_door"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "off",
"valueType": "str",
"timeout": "1",
"timeoutType": "num",
"timeoutUnits": "minutes",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [],
"entityLocation": "data",
"entityLocationType": "none",
"x": 1180,
"y": 1220,
"wires": [
[
"8851dbeb9b28003a"
],
[]
]
},
{
"id": "18cd2aed123cdaa8",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Cancel door timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.basement_studio_door_timer"
],
"labelId": [],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 1470,
"y": 1220,
"wires": [
[]
]
},
{
"id": "8851dbeb9b28003a",
"type": "delay",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1325,
"y": 1220,
"wires": [
[
"18cd2aed123cdaa8"
]
],
"l": false
},
{
"id": "06b3f795ae9e14e6",
"type": "link in",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Basement Shutdown Abridged",
"links": [
"c3b3c90a43c4481a"
],
"x": 385,
"y": 1280,
"wires": [
[
"a4490fb4765e1c9c",
"4c7184cd35bf3f1f",
"15c84d12d17ac254"
]
]
},
{
"id": "d6e7197427bb4d1b",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Reset Basement Briefing",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.basement_briefing"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 490,
"y": 1000,
"wires": [
[]
]
},
{
"id": "4b7ed8ad595ee9cb",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Turn on heater",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_hvac_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.basement_studio_vtherm"
],
"labelId": [],
"data": "{\t \"hvac_mode\":\"heat\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "climate",
"service": "set_hvac_mode",
"x": 640,
"y": 1060,
"wires": [
[
"b7022ac46a70a7d8"
]
]
},
{
"id": "15c84d12d17ac254",
"type": "function",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Heat Logic",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.basement_studio_heat_allowed'].state\nconst outsideTemp = global.get('outdoorTemp.tempInt')\nconst nightMode = states['input_boolean.night_mode'].state\n\nlet power = {}\nlet preset = {}\n\nif (outsideTemp > 32) {\n power = 'off'\n} else {\n power = 'on'\n if (nightMode === 'on') {\n preset = \"frost\"\n } else {\n preset = \"activity\"\n }\n}\n\nif (allowed === 'on') {\n if (power === 'on') {\n msg.preset = preset\n node.status({fill:'green',shape:'dot',text:`Preset ${preset}`})\n node.send(msg,null)\n } else {\n node.status({fill:'red',shape:'ring',text:'Heater Shutoff'})\n node.send(null,msg)\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Heat Disabled'})\n}\n",
"outputs": 2,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 1460,
"wires": [
[
"b947106d8f7b72ed"
],
[
"d575b0381d31edaa"
]
],
"outputLabels": [
"Idle Temp",
"Shutoff"
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "b947106d8f7b72ed",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Set Temp",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_preset_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.basement_studio_vtherm"
],
"labelId": [],
"data": "{\t \"preset_mode\":preset\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "climate",
"service": "set_preset_mode",
"x": 700,
"y": 1460,
"wires": [
[]
]
},
{
"id": "d575b0381d31edaa",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "c4c2c79b692236a0",
"name": "Turn Off Heater",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_hvac_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.basement_studio_vtherm"
],
"labelId": [],
"data": "{\t \"hvac_mode\":\"off\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "climate",
"service": "set_hvac_mode",
"x": 720,
"y": 1520,
"wires": [
[]
]
},
{
"id": "b7022ac46a70a7d8",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Set temperature",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_preset_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.basement_studio_vtherm"
],
"labelId": [],
"data": "{\t \"preset_mode\":\"activity\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "climate",
"service": "set_preset_mode",
"x": 840,
"y": 1060,
"wires": [
[]
]
},
{
"id": "a64928d7a0b836cf",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Room Presence",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.basement_occupied"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 200,
"y": 1060,
"wires": [
[
"aecc95a3db3369e2"
],
[]
],
"outputLabels": [
"occupied",
"not occupied"
]
},
{
"id": "aecc95a3db3369e2",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Night Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.night_mode",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 325,
"y": 1060,
"wires": [
[
"bd6bdc6ed9aded9d"
],
[]
],
"outputLabels": [
"night mode off",
"night mode on"
],
"icon": "font-awesome/fa-moon-o",
"l": false
},
{
"id": "b62ba31a1b35ef47",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Do Not Enter",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.do_not_enter_basement_studio"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dnd",
"valueType": "str"
}
],
"x": 190,
"y": 600,
"wires": [
[
"6e5bbaefb1d2c14e",
"117e6e67bd4c2794",
"e8b5f4ace78d485a"
],
[
"6e5bbaefb1d2c14e",
"117e6e67bd4c2794",
"efa4a1761da0b38d"
]
],
"outputLabels": [
"On",
"Off"
]
},
{
"id": "e8b5f4ace78d485a",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Manual Control",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "adaptive_lighting.set_manual_control",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"entity_id\":\"switch.adaptive_lighting_basement_studio\",\t \"lights\": [\t \"light.basement_stairwell\"\t ],\t \"manual_control\":\"true\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "adaptive_lighting",
"service": "set_manual_control",
"x": 580,
"y": 600,
"wires": [
[
"d7b73ee4a2387bfa"
]
]
},
{
"id": "d7b73ee4a2387bfa",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Set light to red",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_stairwell"
],
"labelId": [],
"data": "{\t \"brightness_pct\": 100,\t \"rgb_color\": [255,0,0]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 780,
"y": 600,
"wires": [
[]
]
},
{
"id": "6e5bbaefb1d2c14e",
"type": "change",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "",
"rules": [
{
"t": "set",
"p": "dnd",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 570,
"y": 720,
"wires": [
[]
]
},
{
"id": "117e6e67bd4c2794",
"type": "mqtt out",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "",
"topic": "house/studio/dnd",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 590,
"y": 780,
"wires": []
},
{
"id": "efa4a1761da0b38d",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Manual Control",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "adaptive_lighting.set_manual_control",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"entity_id\":\"switch.adaptive_lighting_basement_studio\",\t \"lights\": [\t \"light.basement_stairwell\"\t ],\t \"manual_control\":\"false\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "adaptive_lighting",
"service": "set_manual_control",
"x": 580,
"y": 660,
"wires": [
[
"195c2b19593434e1"
]
]
},
{
"id": "6d1291b96a8c9e83",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Selected Scene",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "Adaptive",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_text.basement_studio_selected_scene",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "scene",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 980,
"y": 660,
"wires": [
[
"b8648d760ccc1aa2"
],
[
"9d5f6c64408c0b6a"
]
],
"outputLabels": [
"Adaptive",
"Else"
]
},
{
"id": "b8648d760ccc1aa2",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Apply Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "adaptive_lighting.apply",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"entity_id\":\"switch.adaptive_lighting_basement_studio\",\t \"lights\": [\t \"light.basement_stairwell\"\t ],\t \"adapt_brightness\":true,\t \"adapt_color\":true\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "adaptive_lighting",
"service": "apply",
"x": 1200,
"y": 640,
"wires": [
[]
]
},
{
"id": "e8097cd64b17370a",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Re-apply scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.basement_studio_scenes"
],
"labelId": [],
"data": "{\t \"option\": scene\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_select",
"service": "select_option",
"x": 1400,
"y": 700,
"wires": [
[]
]
},
{
"id": "9d5f6c64408c0b6a",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Apply Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "adaptive_lighting.apply",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"entity_id\":\"switch.adaptive_lighting_basement_studio\",\t \"lights\": [\t \"light.basement_stairwell\"\t ],\t \"adapt_brightness\":true,\t \"adapt_color\":true\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "adaptive_lighting",
"service": "apply",
"x": 1200,
"y": 700,
"wires": [
[
"e8097cd64b17370a"
]
]
},
{
"id": "21496cb5b59bf2fb",
"type": "server-state-changed",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Scene Changed",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.basement_studio_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "Select",
"ifStateType": "str",
"ifStateOperator": "is_not",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "scene",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 200,
"y": 660,
"wires": [
[
"be40ebfb2514fdb2"
],
[]
]
},
{
"id": "be40ebfb2514fdb2",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "DND",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.do_not_enter_basement_studio",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "dnd",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 365,
"y": 560,
"wires": [
[
"724968ddc9702720"
],
[]
],
"outputLabels": [
"On",
"Off"
],
"icon": "font-awesome/fa-warning",
"l": false
},
{
"id": "724968ddc9702720",
"type": "delay",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 435,
"y": 560,
"wires": [
[
"e8b5f4ace78d485a"
]
],
"l": false
},
{
"id": "195c2b19593434e1",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Occupied",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.basement_occupied",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 760,
"y": 660,
"wires": [
[
"6d1291b96a8c9e83"
],
[
"e75fda5ea26d23e5"
]
]
},
{
"id": "e75fda5ea26d23e5",
"type": "api-call-service",
"z": "47f17992fab9b4f5",
"g": "d70533ec9ef234f6",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_studio_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_off",
"x": 960,
"y": 720,
"wires": [
[]
]
},
{
"id": "bd6bdc6ed9aded9d",
"type": "function",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Heat Logic",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.basement_studio_heat_allowed'].state\nconst outsideTemp = global.get('outdoorTemp.tempInt')\nconst todaysHighTemp = states['sensor.todays_high_temp'].state\nconst basementTemp = states['sensor.basement_studio_temperature'].state\n\nlet power = {}\nlet reason = {}\n\nif (todaysHighTemp < 55) {\n power = 'on'\n reason = 'Todays High Temperature'\n} else if (outsideTemp < 40) {\n power = 'on'\n reason = 'Outside Temperature'\n} else if (basementTemp < 64) {\n power = 'on'\n reason = 'Basement Temperature'\n} else {\n power = 'off'\n}\n\nif (allowed === 'on') {\n if (power === 'on') {\n node.status({fill:'green',shape:'dot',text:`Heater Needed: ${reason}`})\n node.send(msg,null)\n } else {\n node.status({fill:'red',shape:'ring',text:'Heater Not Needed'})\n node.send(null,msg)\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Heat Disabled'})\n}\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 1060,
"wires": [
[
"4b7ed8ad595ee9cb"
]
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "3bd0a22c66de228a",
"type": "subflow:ea629141206d5343",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "",
"x": 325,
"y": 1120,
"wires": [
[
"73078f818abdc6c2"
]
],
"l": false
},
{
"id": "091390f43bfeddf5",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Turn on light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.front_porch_light"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"output_location": "",
"output_location_type": "none",
"x": 790,
"y": 220,
"wires": [
[
"3a5bb57569e07beb"
]
]
},
{
"id": "7a7229eb69c9b1a3",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Turn off light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.front_porch_light"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"output_location": "",
"output_location_type": "none",
"x": 1250,
"y": 360,
"wires": [
[]
]
},
{
"id": "f34816b23181f21e",
"type": "link in",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Porch Light Input",
"links": [
"26f15fc8d75a4020"
],
"x": 125,
"y": 220,
"wires": [
[
"cfdcc7c9c168dc17"
]
]
},
{
"id": "bd75b077a1c76fce",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"d": true,
"g": "eeafd13be593ae69",
"name": "Turn off Delivery Mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.delivery_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 1160,
"y": 160,
"wires": [
[]
]
},
{
"id": "b69eeb738bbd4bdb",
"type": "server-state-changed",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Porch Automation Stop",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.front_porch_light_on"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 180,
"y": 160,
"wires": [
[
"459433738b64d14d"
],
[]
]
},
{
"id": "cfdcc7c9c168dc17",
"type": "switch",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "On/Off",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 230,
"y": 220,
"wires": [
[
"16029ccf061bdd10",
"459433738b64d14d"
],
[
"76815f07ec2f3eef"
]
]
},
{
"id": "16029ccf061bdd10",
"type": "switch",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Method",
"property": "detect",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "presence",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 380,
"y": 220,
"wires": [
[
"c7a8df4ebeb3b5c5",
"77759257dd9c9465"
],
[
"77759257dd9c9465"
]
]
},
{
"id": "d2751bc2cfc5af8f",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Set Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.front_porch_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1130,
"y": 220,
"wires": [
[]
]
},
{
"id": "435280acadb9f364",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Holiday Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.animated_scene_{{holiday}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_on",
"x": 1440,
"y": 300,
"wires": [
[]
]
},
{
"id": "ec5937bc60874009",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Animations Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.animated_scene_{{holiday}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 800,
"y": 160,
"wires": [
[]
]
},
{
"id": "defcae57f9916394",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_front_porch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 1250,
"y": 300,
"wires": [
[
"435280acadb9f364"
]
]
},
{
"id": "459433738b64d14d",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.front_porch_motion_timer"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 390,
"y": 160,
"wires": [
[]
]
},
{
"id": "a2ec35a79d79bf2f",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.front_porch_motion_timer"
],
"labelId": [],
"data": "{\t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 510,
"y": 360,
"wires": [
[]
]
},
{
"id": "9a8c39dc1a0c20e6",
"type": "server-events",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.front_porch_motion_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 860,
"y": 360,
"wires": [
[
"f5fb96bf1a33b3cd"
]
]
},
{
"id": "8c29a2e1a06c5524",
"type": "server-state-changed",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Delivery Mode Off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.delivery_mode"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 870,
"y": 300,
"wires": [
[
"f5fb96bf1a33b3cd"
],
[]
]
},
{
"id": "c7a8df4ebeb3b5c5",
"type": "delay",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "",
"pauseType": "delay",
"timeout": "10",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 245,
"y": 360,
"wires": [
[
"76815f07ec2f3eef"
]
],
"l": false
},
{
"id": "77759257dd9c9465",
"type": "function",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Check Parameters",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst outdoorLux = parseInt(states['sensor.home_tempest_illuminance'].state)\nconst threshold = parseInt(states['input_number.front_porch_lux_threshold'].state)\nconst frontPorchToggle = states['input_boolean.front_porch_light_on'].state\nconst holidaymode = states['input_boolean.holiday_mode'].state\nconst currentholiday = states['input_select.holiday_animation'].state\nconst holiday = currentholiday.toLowerCase()\n\nlet holidayMsg = {\n \"holiday\": holiday\n}\n\nif ((outdoorLux <= threshold) && frontPorchToggle === 'on') {\n if (holidaymode === 'on') {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Holiday On\"})\n node.send([holidayMsg,msg])\n } else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Holiday Off\"})\n node.send([null,msg])\n }\n} else {\n if (frontPorchToggle === 'off') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Disabled\" })\n } else if (outdoorLux > threshold) {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Daytime\" })\n }\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 220,
"wires": [
[
"ec5937bc60874009"
],
[
"091390f43bfeddf5"
]
],
"outputLabels": [
"Holiday",
"Otherwise"
],
"icon": "font-awesome/fa-check"
},
{
"id": "3a5bb57569e07beb",
"type": "function",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "If Motion",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst deliveryMode = states['input_boolean.delivery_mode'].state\nconst detect = msg.detect\n\nnode.send([null,msg])\n\nif (detect === 'motion' && deliveryMode === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Motion/Delivery\"})\n node.send([msg,null])\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Not Motion\"})\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 960,
"y": 220,
"wires": [
[
"bd75b077a1c76fce"
],
[
"d2751bc2cfc5af8f"
]
],
"outputLabels": [
"Motion",
"Otherwise"
],
"icon": "node-red-contrib-huemagic/hue-motion.svg"
},
{
"id": "76815f07ec2f3eef",
"type": "function",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Delay",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst delay = states['input_number.front_porch_motion_off_delay'].state\nconst duration = delay * 60\nconst lights = states['light.front_porch_light'].state\n\nmsg.duration = duration\n\nif (lights === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text: parseInt(delay) + \" minutes\"})\n node.send(msg)\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Light Off\"})\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 360,
"wires": [
[
"a2ec35a79d79bf2f"
]
],
"icon": "font-awesome/fa-tree"
},
{
"id": "f5fb96bf1a33b3cd",
"type": "function",
"z": "b5717a86ce55bc29",
"g": "eeafd13be593ae69",
"name": "Shut Off",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst frontPorchToggle = states['input_boolean.front_porch_light_on'].state\nconst deliveryMode = states['input_boolean.delivery_mode'].state\nconst holidayMode = states['input_boolean.holiday_mode'].state\nconst holidayHold = states['input_boolean.holiday_mode_hold'].state\nconst currentHoliday = states['input_select.holiday_animation'].state\nconst earlyNight = states['binary_sensor.early_night_mode'].state\nconst holiday = currentHoliday.toLowerCase()\n\nif (frontPorchToggle === 'on' && deliveryMode === 'off') {\n if (earlyNight === 'off') {\n if (holidayMode === 'on' && holidayHold === 'on') {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Daytime (Holiday Hold)\"})\n node.send([msg,null])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Daytime\"})\n node.send([null,msg])\n }\n } else if (earlyNight === 'on') {\n if (holidayMode === 'on') {\n msg.holiday = holiday\n node.status({fill:\"blue\",shape:\"dot\",text:\"Night (Holiday On)\"})\n node.send([msg,null])\n } else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Night (Holiday Off)\"})\n node.send([null,msg])\n }\n }\n} else if (frontPorchToggle === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked (Automation Off\"})\n} else if (deliveryMode === 'on') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked (Delivery Mode)\"})\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1080,
"y": 360,
"wires": [
[
"defcae57f9916394"
],
[
"7a7229eb69c9b1a3"
]
],
"outputLabels": [
"Holiday",
"Otherwise"
],
"icon": "font-awesome/fa-power-off"
},
{
"id": "af64b56e28c93907",
"type": "server-state-changed",
"z": "b5717a86ce55bc29",
"g": "628bc6d9078cb924",
"name": "Front Porch Scenes",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.front_porch_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "front_porch",
"valueType": "str"
}
],
"x": 170,
"y": 60,
"wires": [
[
"3747d0c21057f3a6"
]
]
},
{
"id": "3747d0c21057f3a6",
"type": "subflow:a4ee891237e460a2",
"z": "b5717a86ce55bc29",
"g": "628bc6d9078cb924",
"name": "",
"x": 400,
"y": 60,
"wires": []
},
{
"id": "d2709b4d48275a22",
"type": "ha-switch",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Storm Mode",
"version": 0,
"debugenabled": false,
"inputs": 0,
"outputs": 2,
"entityConfig": "8371db473f46baf2",
"enableInput": false,
"outputOnStateChange": true,
"outputProperties": [
{
"property": "outputType",
"propertyType": "msg",
"value": "state change",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 150,
"y": 500,
"wires": [
[
"ef4722474ddd6df7"
],
[
"742fb59053708930"
]
]
},
{
"id": "ef4722474ddd6df7",
"type": "api-current-state",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Early Night Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.early_night_mode",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 350,
"y": 460,
"wires": [
[
"2d4e34f55fca3d30"
],
[
"b6fa25d3e17bf7ac"
]
]
},
{
"id": "994d4b415cfc1726",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.front_porch_light"
],
"labelId": [],
"data": "{\t \"rgb_color\": [255,0,0],\t \"brightness_pct\": 100\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 1000,
"y": 460,
"wires": [
[]
]
},
{
"id": "68701ec04bbaacf0",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn Off Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_front_porch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "turn_off",
"x": 810,
"y": 460,
"wires": [
[
"994d4b415cfc1726"
]
]
},
{
"id": "2d4e34f55fca3d30",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn Off Automation",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.front_porch_light_on"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_boolean",
"service": "turn_off",
"x": 580,
"y": 460,
"wires": [
[
"68701ec04bbaacf0"
]
]
},
{
"id": "742fb59053708930",
"type": "api-current-state",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Early Night Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.early_night_mode",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 350,
"y": 580,
"wires": [
[
"6d9c29e9ac683246"
],
[]
]
},
{
"id": "6d9c29e9ac683246",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn On Automation",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.front_porch_light_on"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_boolean",
"service": "turn_on",
"x": 580,
"y": 580,
"wires": [
[
"1bc2077d7cfb57ed"
]
]
},
{
"id": "d6ef529ccde504ef",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Reset Light",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.front_porch_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_select",
"service": "select_option",
"x": 1010,
"y": 580,
"wires": [
[]
]
},
{
"id": "1bc2077d7cfb57ed",
"type": "api-current-state",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Light On?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.front_porch_light",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 780,
"y": 580,
"wires": [
[
"d6ef529ccde504ef"
],
[
"6073a1ffd782cbde"
]
]
},
{
"id": "6073a1ffd782cbde",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn On Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_front_porch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "turn_on",
"x": 1030,
"y": 640,
"wires": [
[
"616e794707796e49"
]
]
},
{
"id": "616e794707796e49",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Reset Text",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.front_porch_selected_scene"
],
"labelId": [],
"data": "{\t \"value\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "input_text",
"service": "set_value",
"x": 1230,
"y": 640,
"wires": [
[]
]
},
{
"id": "b6fa25d3e17bf7ac",
"type": "api-call-service",
"z": "b5717a86ce55bc29",
"g": "277dd697dbcfe9c7",
"name": "Turn Storm Mode Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.front_porch_storm_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "turn_off",
"x": 580,
"y": 520,
"wires": [
[]
]
},
{
"id": "3a29cecbefa6cbe2",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Reset Living Room",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.living_room_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 930,
"y": 300,
"wires": [
[
"ed2e0f4f214ad76c"
]
]
},
{
"id": "4a2031f363418db1",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.living_room_scenes"
],
"labelId": [],
"data": "{\t \"option\": msg.huescene\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1130,
"y": 180,
"wires": [
[]
]
},
{
"id": "984386fa0a6369d6",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Living Room TV Current App",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.living_room_tv_current_app"
],
"substring": [],
"regex": []
},
"outputInitially": true,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "toggle",
"propertyType": "msg",
"value": "appmode",
"valueType": "str"
}
],
"x": 180,
"y": 100,
"wires": [
[
"0beae13503166379"
]
]
},
{
"id": "0beae13503166379",
"type": "function",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Processing",
"func": "const appList = global.get(\"appListLivingRoom\", \"diskCon\")\nconst states = global.get('homeassistant.homeAssistant.states')\nconst lampState = states['light.dining_room_lamp'].state\nconst app = msg.payload\nconst toggle = msg.toggle\nlet payload = {}\n\nif (toggle === 'appmode' || toggle === 'on') {\n if (appList.includes(app)) {\n flow.set(\"lampState\", lampState)\n payload = \"start\"\n } else {\n payload = \"stop\"\n }\n} else if (toggle === 'off') {\n payload = \"stop\"\n}\n\nmsg.payload = payload\n\nglobal.set('tvAppLivingRoom',app)\n\nif (payload === 'start') {\n node.status({fill:\"green\",shape:\"dot\",text:app});\n return[msg,null]\n} else if (payload === 'stop') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Stopped\"});\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 410,
"y": 100,
"wires": [
[
"6c77ade442a47a30"
],
[
"6392f2f0586d988a"
]
],
"outputLabels": [
"Start",
"Stop"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "6c77ade442a47a30",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Entertainment Mode On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.living_room_entertainment_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 630,
"y": 60,
"wires": [
[]
]
},
{
"id": "6392f2f0586d988a",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Entertainment Mode Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.living_room_entertainment_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 630,
"y": 120,
"wires": [
[]
]
},
{
"id": "e505e9f24bf919dd",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Entertainment Mode State",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.living_room_entertainment_mode"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "alert",
"propertyType": "msg",
"value": "off",
"valueType": "str"
}
],
"x": 170,
"y": 220,
"wires": [
[
"346379575efad516"
]
],
"outputLabels": [
"On"
]
},
{
"id": "9efd5346a1ca1972",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Detect Pause",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"media_player.living_room_tv"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "seconds",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 130,
"y": 380,
"wires": [
[
"f463df7e17e045e9"
]
],
"outputLabels": [
"paused",
"playing"
]
},
{
"id": "8b53b9f4d5ba0bf0",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Dynamic On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.living_room_dynamic_scenes"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 950,
"y": 200,
"wires": [
[
"4a2031f363418db1",
"d2390789a8b3101a"
]
]
},
{
"id": "cc8f6ab710549be2",
"type": "stoptimer",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"duration": "15",
"units": "Second",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 550,
"y": 420,
"wires": [
[
"7cb8056b3b41a9e8"
],
[]
]
},
{
"id": "346379575efad516",
"type": "function",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.living_room_entertainment_control'].state\nconst active = states['input_boolean.living_room_entertainment_mode'].state\nconst currentApp = global.get('tvAppLivingRoom');\nconst lights = states['light.living_room_lights'].state\nconst selectedScene = states['input_text.living_room_selected_scene'].state\nconst lamp = flow.get(\"lampState\")\nconst alert = msg.alert\nconst payload = msg.payload\n\nlet hueScene = {}\nlet lifxScene = {}\n\nif (currentApp === 'YouTube' || currentApp === 'Jellyfin') {\n hueScene = 'Tokyo'\n lifxScene = 'intense'\n} else if (currentApp === 'Twitch') {\n hueScene = 'Twitch'\n lifxScene = 'party'\n} else if (currentApp === 'Hulu') {\n hueScene = 'Forest Adventure'\n lifxScene = 'relaxing'\n} else if (currentApp === 'Netflix') {\n hueScene = 'Netflix'\n lifxScene = 'love'\n} else if (currentApp === 'MLB') {\n hueScene = 'MLB'\n lifxScene = 'independence'\n}\n\nmsg.huescene = hueScene\nmsg.lifxscene = lifxScene\n\nif (allowed === 'on' && lights === 'on') {\n if (payload === 'on') {\n if (selectedScene != hueScene) {\n node.status({fill:\"green\",shape:\"dot\",text:\"On\"});\n return[msg,null,null]\n } else if (alert === 'on' && active === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"On (Alert Resume)\"});\n return[msg,null,null]\n } else if (selectedScene === hueScene) {\n node.status({fill:\"yellow\",shape:\"ring\",text:\"Scene already set\"});\n return null\n }\n } else if (payload === 'off') {\n if (lamp === 'on') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Off\"});\n return[null,msg,msg]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Off\"});\n return[null,msg,null]\n }\n }\n} else {\n node.status({fill:\"grey\",shape:\"dot\",text:\"Blocked\"});\n return null\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 220,
"wires": [
[
"107f2c88924975fe"
],
[
"3a29cecbefa6cbe2"
],
[]
],
"outputLabels": [
"On",
"Off (Living Room)",
"Off (Dining Room)"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "8b0b39deb5142557",
"type": "function",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.living_room_entertainment_control'].state\nconst lights = states['light.living_room_lights'].state\nconst active = states['input_boolean.living_room_entertainment_mode'].state\nconst selectedScene = states['input_text.living_room_selected_scene'].state\nconst payload = msg.payload\nconst stopMsg = {\n \"payload\":\"stop\"\n}\nlet resumeMsg = {\n \"payload\":\"on\"\n}\n\nif (allowed === 'on' && lights === 'on') {\n if (payload === 'paused') {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Paused\"});\n return [null,msg,null]\n } else if (payload === 'playing') {\n if (allowed === 'on' && lights === 'on' && active === 'on') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Playing\" });\n return[resumeMsg,null,stopMsg]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return[null,null,stopMsg]\n }\n } else {\n node.status({fill:\"grey\",shape:\"dot\",text:\"Timer Stopped\"});\n return[null,null,stopMsg]\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 380,
"wires": [
[
"346379575efad516"
],
[
"cc8f6ab710549be2"
],
[
"cc8f6ab710549be2"
]
],
"outputLabels": [
"Playing",
"Paused",
"Stop Timer"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "7cb8056b3b41a9e8",
"type": "function",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Check",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst active = states['input_boolean.living_room_entertainment_mode'].state\nconst lights = states['light.living_room_lights'].state\n\nif (active === 'on' && lights === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sent\"});\n return msg\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 420,
"wires": [
[
"3a29cecbefa6cbe2"
]
],
"outputLabels": [
"Living Room",
""
],
"icon": "font-awesome/fa-check"
},
{
"id": "d2390789a8b3101a",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "LIFX",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_move",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_led_strip"
],
"labelId": [],
"data": "{\t \"speed\": 8,\t \"direction\": \"right\",\t \"theme\": msg.lifxscene,\t \"power_on\": \"true\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_move",
"x": 1110,
"y": 240,
"wires": [
[]
]
},
{
"id": "d961ffeaea408909",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "LIFX Stop",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_stop",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_led_strip"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_stop",
"x": 1180,
"y": 300,
"wires": [
[]
]
},
{
"id": "107f2c88924975fe",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_living_room"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 590,
"y": 220,
"wires": [
[
"8b53b9f4d5ba0bf0"
]
]
},
{
"id": "ed2e0f4f214ad76c",
"type": "delay",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1075,
"y": 300,
"wires": [
[
"d961ffeaea408909"
]
],
"l": false
},
{
"id": "6110b45c374a5b7f",
"type": "function",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Settings",
"func": "const appListLivingRoom = [\"YouTube\", \"Netflix\", \"MLB\", \"Jellyfin\", \"Twitch\", \"Hulu\"]\n\nglobal.set(\"appListLivingRoom\", appListLivingRoom, \"diskCon\");\n\nnode.status({fill:\"green\",shape:\"dot\",text:\"Updated\"});",
"outputs": 0,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 480,
"wires": []
},
{
"id": "e5af55b177f37c65",
"type": "inject",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Update",
"props": [
{
"p": "payload"
}
],
"repeat": "3600",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 480,
"wires": [
[
"6110b45c374a5b7f"
]
]
},
{
"id": "496fafb580e8af1b",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Reset Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.basement_studio_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 910,
"y": 820,
"wires": [
[
"99fccb06d0ae097b"
]
]
},
{
"id": "6253b68980f8bbca",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Set Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.basement_studio_scenes"
],
"labelId": [],
"data": "{\t \"option\": msg.huescene\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1130,
"y": 700,
"wires": [
[]
]
},
{
"id": "19907ff0b6cef449",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Basement TV Current App",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.basement_tv_current_app"
],
"substring": [],
"regex": []
},
"outputInitially": true,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 170,
"y": 620,
"wires": [
[
"98d5f1fa7001b848"
]
]
},
{
"id": "98d5f1fa7001b848",
"type": "function",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Processing",
"func": "const appList = global.get(\"appListBasement\", \"diskCon\")\nconst states = global.get('homeassistant.homeAssistant.states')\nconst app = msg.payload\nlet payload = {}\n\nif (appList.includes(app)) {\n payload = \"start\"\n} else {\n payload = \"stop\"\n}\n\nmsg.payload = payload\n\nglobal.set('tvAppBasement',app)\n\nif (payload === 'start') {\n node.status({fill:\"green\",shape:\"dot\",text:app});\n return[msg,null]\n} else if (payload === 'stop') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Stopped\"});\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 410,
"y": 620,
"wires": [
[
"8535d555f858eb5c"
],
[
"d2d07f8ee20733d0"
]
],
"outputLabels": [
"Start",
"Stop"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "8535d555f858eb5c",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Entertainment Mode On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.basement_studio_entertainment_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 630,
"y": 580,
"wires": [
[]
]
},
{
"id": "d2d07f8ee20733d0",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Entertainment Mode Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.basement_studio_entertainment_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 630,
"y": 640,
"wires": [
[]
]
},
{
"id": "7d266754621825e7",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Entertainment Mode State",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.basement_studio_entertainment_mode"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "alert",
"propertyType": "msg",
"value": "off",
"valueType": "str"
}
],
"x": 170,
"y": 740,
"wires": [
[
"cb285727507f50da"
]
],
"outputLabels": [
"On"
]
},
{
"id": "d41365c49024c8eb",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Detect Pause",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"media_player.basement_tv"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "seconds",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 130,
"y": 900,
"wires": [
[
"cb68f561b5023b31"
]
],
"outputLabels": [
"paused"
]
},
{
"id": "c71a9ea311a86b7f",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Dynamic On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.basement_studio_dynamic_scenes"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 950,
"y": 720,
"wires": [
[
"6253b68980f8bbca",
"65aaba2528dfde3d"
]
]
},
{
"id": "5d582639d1f6a501",
"type": "stoptimer",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"duration": "15",
"units": "Second",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 550,
"y": 940,
"wires": [
[
"50b997d6e5680e6e"
],
[]
]
},
{
"id": "cb285727507f50da",
"type": "function",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.basement_studio_entertainment_control'].state\nconst active = states['input_boolean.basement_studio_entertainment_mode'].state\nconst quiet = states['input_boolean.studio_quiet'].state\nconst recliner = states['input_boolean.recliner_mode'].state\nconst currentApp = global.get('tvAppBasement');\nconst lights = states['light.basement_studio_lights'].state\nconst selectedScene = states['input_text.basement_studio_selected_scene'].state\nconst alert = msg.alert\nconst payload = msg.payload\n\nlet proceed = {}\nlet hueScene = {}\nlet lifxScene = {}\n\nif (currentApp === 'YouTube' || currentApp === 'Jellyfin' || currentApp === 'Google Cast') {\n hueScene = 'Tokyo'\n lifxScene = 'intense'\n} else if (currentApp === 'Twitch') {\n hueScene = 'Twitch'\n lifxScene = 'party'\n} else if (currentApp === 'Hulu') {\n hueScene = 'Forest Adventure'\n lifxScene = 'relaxing'\n} else if (currentApp === 'Netflix') {\n hueScene = 'Netflix'\n lifxScene = 'love'\n} else if (currentApp === 'MLB') {\n hueScene = 'MLB'\n lifxScene = 'independence'\n}\n\nif (allowed === 'on' && lights === 'on' && quiet === 'off' && recliner === 'off') {\n proceed = 'true'\n} else {\n proceed = 'false'\n}\n\nmsg.huescene = hueScene\nmsg.lifxscene = lifxScene\n\nif (proceed === 'true') {\n if (payload === 'on') {\n if (selectedScene != hueScene) {\n node.status({fill:\"green\",shape:\"dot\",text:\"On\"});\n return[msg,null]\n } else if (alert === 'on' && active === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"On (Alert Resume)\"});\n return[msg,null]\n } else if (selectedScene === hueScene) {\n node.status({fill:\"yellow\",shape:\"ring\",text:\"Scene already set\"});\n return null\n }\n } else if (payload === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Off\"});\n return[null,msg]\n }\n} else {\n node.status({fill:\"grey\",shape:\"dot\",text:\"Blocked\"});\n return null\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 740,
"wires": [
[
"5ff13862fb36f90e"
],
[
"496fafb580e8af1b"
]
],
"outputLabels": [
"On",
"Off"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "2a8f44429acdd1ea",
"type": "function",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.basement_studio_entertainment_control'].state\nconst lights = states['light.basement_studio_lights'].state\nconst active = states['input_boolean.basement_studio_entertainment_mode'].state\nconst selectedScene = states['input_text.basement_studio_selected_scene'].state\nconst app = global.get(\"tvAppBasement\");\nconst payload = msg.payload\nconst stopMsg = {\n \"payload\":\"stop\"\n}\nlet resumeMsg = {\n \"payload\":\"on\"\n}\n\nif (allowed === 'on' && lights === 'on' && app != 'TV') {\n if (payload === 'paused') {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Paused\"});\n return [null,msg,null]\n } else if (payload === 'playing') {\n if (allowed === 'on' && lights === 'on' && active === 'on') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Playing\" });\n return[resumeMsg,null,stopMsg]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return[null,null,stopMsg]\n }\n } else {\n node.status({fill:\"grey\",shape:\"dot\",text:\"Timer Stopped\"});\n return[null,null,stopMsg]\n }\n} else if (app === 'TV') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked (TV)\"});\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 900,
"wires": [
[
"cb285727507f50da"
],
[
"5d582639d1f6a501"
],
[
"5d582639d1f6a501"
]
],
"outputLabels": [
"Playing",
"Paused",
"Stop Timer"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "50b997d6e5680e6e",
"type": "function",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Check",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst active = states['input_boolean.basement_studio_entertainment_mode'].state\nconst lights = states['light.basement_studio_lights'].state\n\nif (active === 'on' && lights === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sent\"});\n return msg\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 940,
"wires": [
[
"496fafb580e8af1b"
]
],
"outputLabels": [
"Living Room"
],
"icon": "font-awesome/fa-check"
},
{
"id": "65aaba2528dfde3d",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "LIFX",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_move",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_led_strip_1"
],
"labelId": [],
"data": "{\t \"speed\": 8,\t \"direction\": \"right\",\t \"theme\": msg.lifxscene,\t \"power_on\": \"true\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_move",
"x": 1110,
"y": 760,
"wires": [
[]
]
},
{
"id": "55962141df8ef164",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "LIFX Stop",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "lifx.effect_stop",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_led_strip_1"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "lifx",
"service": "effect_stop",
"x": 1140,
"y": 820,
"wires": [
[]
]
},
{
"id": "5ff13862fb36f90e",
"type": "api-call-service",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_basement_studio"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 590,
"y": 740,
"wires": [
[
"c71a9ea311a86b7f"
]
]
},
{
"id": "99fccb06d0ae097b",
"type": "delay",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1025,
"y": 820,
"wires": [
[
"55962141df8ef164"
]
],
"l": false
},
{
"id": "f3efe80c6ffa4522",
"type": "function",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Settings",
"func": "const appListBasement = [\"YouTube\", \"Netflix\", \"MLB\", \"Jellyfin\", \"Twitch\", \"Hulu\", \"Google Cast\"]\n\nglobal.set(\"appListBasement\", appListBasement, \"diskCon\");\n\nnode.status({fill:\"green\",shape:\"dot\",text:\"Updated\"});",
"outputs": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 1000,
"wires": []
},
{
"id": "74d645f646c713d2",
"type": "inject",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Update",
"props": [
{
"p": "payload"
}
],
"repeat": "3600",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 1000,
"wires": [
[
"f3efe80c6ffa4522"
]
]
},
{
"id": "cb68f561b5023b31",
"type": "delay",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 235,
"y": 900,
"wires": [
[
"2a8f44429acdd1ea"
]
],
"l": false
},
{
"id": "27b2c22907382e6d",
"type": "link in",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Media Scenes Input - Living Room",
"links": [
"e23e7b080ee3773f",
"a586df67c15b0914"
],
"x": 265,
"y": 280,
"wires": [
[
"346379575efad516"
]
]
},
{
"id": "f111c40459e27629",
"type": "comment",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Figure out why alerts aren't resetting to media scenes properly",
"info": "",
"x": 1060,
"y": 440,
"wires": []
},
{
"id": "8146f43fea5aec03",
"type": "link in",
"z": "b0286fae9f2ce547",
"g": "1cc8b382530c33d0",
"name": "Media Scenes Input - Basement",
"links": [
"e23e7b080ee3773f",
"a586df67c15b0914"
],
"x": 265,
"y": 800,
"wires": [
[
"cb285727507f50da"
]
]
},
{
"id": "33903d3f8f53dadd",
"type": "server-state-changed",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Media Scenes Toggle",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.living_room_entertainment_control"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "tvAppLivingRoom",
"valueType": "global"
},
{
"property": "toggle",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 200,
"y": 160,
"wires": [
[
"0beae13503166379"
]
]
},
{
"id": "f463df7e17e045e9",
"type": "delay",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 235,
"y": 380,
"wires": [
[
"8b0b39deb5142557"
]
],
"l": false
},
{
"id": "4c98b4516ab685ac",
"type": "comment",
"z": "b0286fae9f2ce547",
"d": true,
"g": "ff6d8150e8d5e606",
"name": "Fix for dining room",
"info": "",
"x": 410,
"y": 260,
"wires": []
},
{
"id": "b4dbbf788c5a30d2",
"type": "subflow:6429099c4571dd6b",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "",
"x": 780,
"y": 1200,
"wires": [
[]
]
},
{
"id": "1aa901d26ce8ac46",
"type": "ha-button",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MB Night Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "be9ed28696adcdb0",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
},
{
"property": "time",
"propertyType": "msg",
"value": "night",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-night",
"valueType": "str"
}
],
"x": 200,
"y": 360,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "21001f5409130f44",
"type": "ha-button",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MB Day Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "59cb8692ed7accd1",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "day",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-day",
"valueType": "str"
}
],
"x": 210,
"y": 420,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "1f7ac875e593d434",
"type": "ha-button",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MB Bedtime Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "9c63750f16f845ea",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-bedtime",
"valueType": "str"
},
{
"property": "time",
"propertyType": "msg",
"value": "bedtime",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
}
],
"x": 190,
"y": 120,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "bc592ba259667f9d",
"type": "link in",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Master Bedroom Climate - Input",
"links": [
"5c9c73b7adb72896",
"60ce44747cf3e507"
],
"x": 265,
"y": 540,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "7a7f626dce181b23",
"type": "link in",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Shower Mode - Climate",
"links": [
"31b8c8291d19ffc6"
],
"x": 125,
"y": 660,
"wires": [
[
"ce5d8005cbf08144"
]
]
},
{
"id": "6c06c2eec1583c66",
"type": "comment",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Shower Mode",
"info": "",
"x": 290,
"y": 780,
"wires": []
},
{
"id": "e2581a5f3f4888df",
"type": "comment",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Main Flow",
"info": "",
"x": 540,
"y": 220,
"wires": []
},
{
"id": "1dfb0bcc98f1457b",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Set to Fan",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_hvac_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.master_bedroom_aircon"
],
"labelId": [],
"data": "{\t \"hvac_mode\":\"fan_only\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "climate",
"service": "set_hvac_mode",
"x": 1010,
"y": 740,
"wires": [
[
"096369136e9e607f"
]
]
},
{
"id": "096369136e9e607f",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Eco Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_preset_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.master_bedroom_aircon"
],
"labelId": [],
"data": "{\t \"preset_mode\":\"none\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "climate",
"service": "set_preset_mode",
"x": 1180,
"y": 740,
"wires": [
[]
]
},
{
"id": "783cfb381b70afc5",
"type": "ha-button",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "A/C Fan Only",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "d3f8c4466cc1deeb",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 830,
"y": 740,
"wires": [
[
"1dfb0bcc98f1457b"
]
]
},
{
"id": "57651381835f659c",
"type": "api-current-state",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "School Today?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_school_today",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "school_today",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 700,
"y": 1000,
"wires": [
[
"62211bf089bc5b04",
"7c483301056c67a9"
],
[
"f1dbb3a206dba921"
]
]
},
{
"id": "acb52adc50d34045",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Lights On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kallen_bedroom_lights"
],
"labelId": [],
"data": "{\t \"brightness_pct\": brightness,\t \"transition\": fade\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1240,
"y": 1000,
"wires": [
[
"7b390a3b24fc3197"
]
]
},
{
"id": "1eb13d819ba7e226",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "iOS Notifications",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"parents\",\t \"title\": topic,\t \"message\": payload,\t \"type\": \"normal\",\t \"tag\": \"master-bedroom-climate\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 940,
"y": 360,
"wires": [
[]
]
},
{
"id": "d6b56cb65c2ff140",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Toggle Boolean",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_{{toggle}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.kallen_sleeping"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_{{toggle}}",
"x": 700,
"y": 880,
"wires": [
[]
]
},
{
"id": "e32aaeb51d3f2e95",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Boolean State",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.kallen_sleeping"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "toggle",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "boolean",
"valueType": "str"
}
],
"x": 110,
"y": 1060,
"wires": [
[
"61405a43f61f3d60"
]
]
},
{
"id": "a10629857d60f774",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Processing",
"func": "node.log(\"Master Bedroom Climate: Processing Started\")\n// pull in the necessary information\n\nconst states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.master_bedroom_climate_protocol'].state\nconst ac = global.get('masterBedroom.aircon.installed', \"diskCon\")\nconst temp = global.get(\"outdoorTemp.tempStr\")\nconst payload = msg.payload\nconst vacation = states['input_boolean.vacation_mode'].state\nconst dayTemp = states['input_number.master_bedroom_daytime_temp'].state\nconst nightTemp = states['input_number.master_bedroom_night_temp'].state\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\nconst showerMode = states['input_boolean.shower_mode'].state\nconst nightVolume = states['input_number.master_bedroom_echo_dot_night_volume'].state\nconst fanMode = states['input_select.scheduled_climate_mode_master_bedroom_fan'].state\nconst acMode = states['input_select.scheduled_climate_mode_master_bedroom_aircon'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states[\"binary_sensor.heat_warning\"].state\nconst showerCooldown = states[\"timer.shower_mode_cooldown\"].state\nconst earlyNight = states[\"binary_sensor.early_night_mode\"].state\nconst danger = states['binary_sensor.heat_warning'].attributes.danger\nconst meltdown = states['input_boolean.meltdown_protocol'].state\nconst coolingActive = states['input_boolean.master_bedroom_cooling_on'].state\nconst echoDotDND = 'switch.basement_echo_dot_do_not_disturb_switch'\nnode.log(\"Master Bedroom Climate: Constants Set\")\n\n// Define some entity IDs\n\nconst airconEntity = [\"climate.master_bedroom_aircon\"]\nconst fanEntity = [\"fan.master_bedroom_fan\"]\nconst peopleIDs = [\"input_boolean.tony_awake\", \"input_boolean.tina_awake\"]\n\n// Helper function to convert a string to title case\n\nfunction convertToTitleCase(str) {\n if (!str) {\n return \"\";\n }\n return str.toLowerCase().replace(/\\b\\w/g, (s) => s.toUpperCase());\n}\n\n// init variables\n\nlet setTemp = []\nlet setEco = []\nlet setHvac = []\nlet setFan = []\nlet setCool = []\nlet setSleep = []\nlet setPeople = []\nlet setDisplay = []\nlet time = []\nlet echoDotService = []\nlet setBriefing = []\nlet setBriefingDelay = []\nlet type = msg.type\nlet topic = msg.topic\nlet isWakeup = context.get(\"isWakeup\")\nnode.log(\"Master Bedroom Climate: Variables Defined\")\n\n// Sleep Switch Handling\nif (type === 'sleep' && payload === 'off') {\n setDisplay = 'turn_on'\n echoDotService = 'turn_off'\n setPeople = 'turn_on'\n if (coolingActive === 'on') {\n time = 'night'\n } else {\n time = 'day'\n }\n} else if (type === 'sleep' && payload === 'on') {\n setDisplay = 'turn_off'\n echoDotService = 'turn_on'\n time = 'bedtime'\n} else {\n time = msg.time\n}\n\nif (topic === 'mrbedroom-wakeup') {\n setSleep = 'turn_off'\n}\n\n// Setup TTS briefing\nif (topic === 'mrbedroom-wakeup') {\n setBriefing = \"master_bedroom_wakeup_briefing\"\n setBriefingDelay = 60000\n} else if (type === 'sleep' && payload === 'off') {\n setBriefing = \"master_bedroom_wakeup_briefing\"\n setBriefingDelay = 15000\n}\n\n// Day Time\nif (time === 'day') {\n if (type === 'auto') {\n setCool = 'turn_off'\n }\n if (earlyNight === 'off') {\n setFan = \"turn_off\"\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp = nightTemp\n setEco = \"turn_on\"\n setHvac = \"cool\"\n } else if (hotDay === 'on' || heatWarning === 'on') {\n setTemp = dayTemp\n setEco = \"turn_on\"\n setHvac = \"cool\"\n } else {\n setTemp = nightTemp\n setEco = \"turn_on\"\n setHvac = \"off\"\n }\n }\n } else if (earlyNight === 'on') {\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp === bedTemp\n } else {\n setTemp = nightTemp\n }\n if (fanMode === 'Fan') {\n setFan = 'turn_on'\n } else {\n setFan = 'turn_off'\n }\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n if (hotDay === 'on') {\n setEco = 'turn_off'\n } else {\n setEco = 'turn_on'\n }\n }\n }\n// Night Time\n} else if (time === 'night') {\n // If this is being run at scheduled time, turn on input_boolean.master_bedroom_cooling_on\n if (type === 'auto') {\n setCool = 'turn_on'\n }\n // Decide temperature\n if (type === 'sleep' && payload === 'off') {\n setTemp = dayTemp\n } else if (danger === 'Extreme') {\n setTemp = bedTemp\n } else {\n setTemp = nightTemp\n }\n // Decide eco mode\n if (sleeping === 'on') {\n setEco = 'turn_off'\n } else {\n setEco = 'turn_on'\n }\n // Decide HVAC mode\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'Fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n // Decide fan on/off\n if (type === 'sleep' && payload === 'off') {\n setFan = 'turn_off'\n } else if (fanMode === 'Fan') {\n setFan = 'turn_on'\n }\n// Bed Time\n} else if (time === 'bedtime') {\n setPeople = 'turn_off'\n if (ac === 'on') {\n setTemp = bedTemp\n setEco = 'turn_off'\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'Fan') {\n setHvac = \"fan_only\"\n } else {\n setHvac = \"off\"\n }\n }\n if (fanMode === 'Fan') {\n setFan = 'turn_on'\n } else {\n setFan = 'turn_off'\n }\n}\nnode.log(\"Master Bedroom Climate: Decision Logic Complete\")\n\n// Define message payloads\n\nlet sendFan = {\n \"payload\": {\n \"action\": `fan.${setFan}`,\n \"target\": {\n \"entity_id\": fanEntity\n },\n \"data\": {}\n }\n}\n\nlet sendCool = {\n \"payload\": {\n \"action\": `input_boolean.${setCool}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.master_bedroom_cooling_on\"]\n },\n \"data\": {}\n }\n}\n\nlet sendSleep = {\n \"payload\": {\n \"action\": `input_boolean.${setSleep}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.master_bedroom_sleeping\"]\n },\n \"data\": {}\n }\n}\n\nlet sendPeople = {\n \"payload\": {\n \"action\": `input_boolean.${setPeople}`,\n \"target\": {\n \"entity_id\": peopleIDs\n },\n \"data\": {}\n }\n}\n\nlet sendDisplay = {\n \"payload\": {\n \"action\": `switch.${setDisplay}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_display\"]\n },\n \"data\": {}\n }\n}\n\nlet notify = {\n \"topic\": topic,\n \"nighttemp\": nightTemp,\n \"acmode\": acMode,\n \"fanmode\": fanMode\n}\n\nlet sendBriefing = {\n \"payload\": {\n \"action\": `script.${setBriefing}`,\n },\n \"delay\": setBriefingDelay\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": \"auto\"\n }\n }\n}\n\nlet sendEchoDotDND = {\n \"payload\": {\n \"action\": `switch.${echoDotService}`,\n \"target\": {\n \"entity_id\": [\"switch.basement_echo_dot_do_not_disturb_switch\"]\n },\n \"data\": {}\n }\n}\n\nnode.log(\"Master Bedroom Climate: Message Payloads Defined\")\n\n// Log the parameters that were chosen, for debugging purposes\n\nnode.log(\"----- Master Bedroom Climate: Set Parameters -----\")\nnode.log(`setTemp: ${setTemp}`)\nnode.log(`setEco: ${setEco}`)\nnode.log(`setHvac: ${setHvac}`)\nnode.log(`setFan: ${setFan}`)\nnode.log(`setCool: ${setCool}`)\nnode.log(`setSleep: ${setSleep}`)\nnode.log(`setPeople: ${setPeople}`)\nnode.log(`setDisplay: ${setDisplay}`)\nnode.log(`setBriefing: ${setBriefing}`)\nnode.log(`setBriefingDelay: ${setBriefingDelay}`)\nnode.log(`time: ${time}`)\nnode.log(`type: ${type}`)\nnode.log(`topic: ${topic}`)\nnode.log(\"----- Master Bedroom Climate: End Parameters -----\")\n\n// If this was an automated trigger, set the cooling context for the bedroom accordingly.\n\nif (type === 'auto' && time != 'bedtime') {\n node.send([null, null, sendCool, null, null])\n node.log(\"Master Bedroom Climate: Cooling Context Set\")\n}\n\n// Automated responses\nif (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'off') {\n node.log(\"Master Bedroom Climate: Auto\")\n if (sleeping === 'on' && topic != 'mrbedroom-wakeup') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (sleep mode)\" })\n node.log(\"Master Bedroom Climate: Blocked (sleep mode)\")\n } else {\n if (topic === 'mrbedroom-cooling' && ac === 'on') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Cooling Schedule\" })\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Cooling\")\n } else if (topic === 'mrbedroom-bedtime') {\n node.send([null, null, sendPeople, null, null])\n node.status({ fill: \"green\", shape: \"dot\", text: \"Bedtime\" })\n node.log(\"Master Bedroom Climate: Auto/Bedtime\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Bedtime/AC\")\n }\n if (fanMode === 'fan') {\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Bedtime/Fan\")\n }\n } else if (topic === 'mrbedroom-fan' && fanMode === 'Fan') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Fan Schedule\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Fan\")\n } else if (topic === 'mrbedroom-wakeup') {\n node.send([null, null, null, null, sendBriefing])\n node.status({ fill: \"green\", shape: \"dot\", text: \"Wakeup Schedule\" })\n node.log(\"Master Bedroom Climate: Auto/Wakeup\")\n if (sleeping === 'off') {\n context.set(\"isWakeup\", false)\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/Sleep Off\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/AC On\")\n }\n } else if (sleeping === 'on') {\n context.set(\"isWakeup\", true)\n node.send([null, null, sendSleep, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/Sleep On\")\n }\n }\n }\n// Manual Responses\n} else if (type === 'manual') {\n node.log(\"Master Bedroom Climate: Manual\")\n if (time === 'night') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Night\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Night\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Night/AC\")\n }\n } else if (time === 'day') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Day\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Day\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Day/AC\")\n }\n } else if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Bedtime\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Bedtime\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Bedtime/AC\")\n }\n }\n context.set(\"isWakeup\", false)\n// Sleep Switch Responses\n} else if (type === 'sleep') {\n if (payload === 'off') {\n node.send([null, null, sendPeople, null, null])\n }\n node.log(\"Master Bedroom Climate: Sleep\")\n if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Sleep\" })\n node.send([null, sendFan, [sendEchoDotDND,sendPeople], null, null])\n node.log(\"Master Bedroom Climate: Sleep/Bedtime\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(\"Master Bedroom Climate: Sleep/Bedtime/AC\")\n }\n } else {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Wakeup\" })\n node.send([null, sendFan, sendEchoDotDND, null, null])\n node.log(\"Master Bedroom Climate: Sleep/Day\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null, null, null])\n node.log(`Master Bedroom Climate: Sleep/${convertToTitleCase(time)}/AC`)\n }\n if (time === 'day' && isWakeup === false) {\n node.send([null, null, null, null, sendBriefing])\n }\n }\n context.set(\"isWakeup\", false)\n} else if (meltdown === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Meltdown Protocol)\" })\n node.log(\"Master Bedroom Climate: Blocked (Meltdown Protocol)\")\n} else if (vacation === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Vacation Mode)\" })\n node.log(\"Master Bedroom Climate: Blocked (Vacation Mode)\")\n} else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Automation Disabled)\" })\n node.log(\"Master Bedroom Climate: Blocked (Automation Disabled)\")\n}\n\nnode.log(\"Master Bedroom Climate: Processing Complete\")\n",
"outputs": 5,
"timeout": "",
"noerr": 0,
"initialize": "context.set(\"isWakeup\", false)",
"finalize": "",
"libs": [],
"x": 550,
"y": 280,
"wires": [
[
"862666f576addab8"
],
[
"b1c0cca848416d74"
],
[
"e914726b0364c6be"
],
[
"a8ef744455bb4c0a"
],
[
"6bbf7df2c43c481e"
]
],
"outputLabels": [
"A/C",
"Fan",
"Boolean",
"Notify",
"Briefing"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "a8ef744455bb4c0a",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Notifications",
"func": "const topic = msg.topic\nconst nightTemp = msg.nighttemp\nconst acMode = msg.acmode\nconst fanMode = msg.fanmode\n\nlet coolMsg = {\n \"payload\": `Master bedroom AC temp has been set to ${nightTemp} °F as scheduled`,\n \"topic\": 'AC Mode: Cooling'\n}\nlet fanOnlyMsg = {\n \"payload\": 'Too cold outside, AC running fan only.',\n \"topic\": \"AC Mode: Fan Only\"\n}\nlet fanSchedMsg = {\n \"payload\": 'Master bedroom fan has been activated as scheduled.',\n \"topic\": 'Fan Schedule Activated'\n}\n\nif (topic === 'mrbedroom-cooling') {\n if (acMode === 'AC') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Cooling\"})\n return coolMsg\n } else if (acMode === 'Fan') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Fan Only\"})\n return fanOnlyMsg\n }\n} else if (topic === 'mrbedroom-fan' && fanMode === 'Fan') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Fan Schedule\"})\n return fanSchedMsg\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Notification not sent\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 750,
"y": 360,
"wires": [
[
"1eb13d819ba7e226"
]
]
},
{
"id": "9c01880c6319d29b",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "On",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst ac = global.get('masterBedroom.aircon.installed', \"diskCon\")\nconst temp = global.get('outdoorTemp.tempStr')\nconst threshold = states['input_number.master_bedroom_aircon_run_threshold'].state\nconst nightTemp = states['input_number.master_bedroom_night_temp'].state\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\n\nconst airconEntity = [\"climate.master_bedroom_aircon\"]\n\nlet setTemp = []\nlet setHvac = \"dry\"\nlet setEco = \"turn_off\"\n\nif (sleeping === 'on') {\n setTemp = bedTemp\n} else {\n setTemp = nightTemp\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nif (ac === 'on') {\n if (temp >= threshold) {\n node.status({fill:\"green\",shape:\"dot\",text:`Shower Mode On: ${setTemp}°F`})\n node.send([[sendHvac, sendTemp, sendEco]])\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Too Cold\"})\n return null\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"A/C Not Installed\"})\n return null\n}\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 620,
"wires": [
[
"5ee549aa5e97d4a5"
]
],
"icon": "node-red/switch.svg"
},
{
"id": "61405a43f61f3d60",
"type": "function",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst overnight = states['input_boolean.kallen_overnight'].state\nconst kallenLoc = states['person.kallen_stork'].state\nconst dayVolume = states['input_number.kallen_bedroom_google_speaker_day_volume'].state\nconst nightVolume = states['input_number.kallen_bedroom_google_speaker_night_volume'].state\nconst brightness = states['switch.adaptive_lighting_kallen_bedroom'].attributes.brightness_pct\nconst fadeNight = states['input_number.wakeup_lights_fade_night'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states['binary_sensor.heat_warning'].state\nconst fanState = states['fan.kallen_bedroom_fan'].state\nconst fanAvailable = fanState !== 'unavailable'\nconst fanSeparate = states['binary_sensor.kallen_fan_separate_schedule'].state\nconst schedMode = states['input_select.scheduled_climate_mode_kallen_bedroom'].state\nconst topic = msg.topic\nconst toggle = msg.toggle || ''\n\nconst roomName = 'Kallen Bedroom'\n\nnode.log(\"Kallen Bedroom: Constants Set\")\n\nlet setFan = []\nlet setWhiteNoise = []\nlet setVolume = []\nlet setLights = []\nlet setWake = []\nnode.log(`${roomName}: Variables Defined`)\n\nif (schedMode === 'White Noise') {\n setFan = 'turn_off'\n} else {\n if (fanAvailable) {\n if (toggle === 'off' && (hotDay === 'on' || heatWarning === 'on')) {\n setFan = 'turn_on'\n } else if ((toggle === 'on' || topic === 'kallen-fan') && schedMode === 'Fan') {\n setFan = 'turn_on'\n } else {\n setFan = 'turn_off'\n }\n } else {\n if (schedMode === 'Fan') {\n node.log(`${roomName}: Fan is unavailable, forcing White Noise mode`)\n }\n setFan = 'turn_off'\n }\n}\n\nif ((schedMode === 'White Noise' && toggle === 'on') || (schedMode === 'Fan' && !fanAvailable)) {\n setWhiteNoise = 'turn_on'\n} else if (topic === 'kallen-fan' && !fanAvailable && schedMode !== 'N/A') {\n setWhiteNoise = 'turn_on'\n} else {\n setWhiteNoise = 'turn_off'\n}\n\nif (topic === 'boolean' && toggle === 'on') {\n setVolume = parseFloat(nightVolume)\n setLights = 'turn_on'\n setWake = 'turn_off'\n} else if (topic === 'boolean' && toggle === 'off') {\n setVolume = parseFloat(dayVolume)\n setWake = 'turn_on'\n}\n\nlet fadeMult = fadeNight * 60\nlet fadeFinal = Math.round(fadeMult)\n\nlet brtFinal = Math.round(brightness)\n\nnode.log(`${roomName}: Decision Logic Complete`)\n\nlet sendFan = {\n \"payload\": {\n \"action\": `fan.${setFan}`,\n \"target\": {\n \"entity_id\": [\"fan.kallen_bedroom_fan\"]\n },\n \"data\": {}\n }\n}\n\nlet sendWhiteNoise = {\n \"payload\": {\n \"action\": `input_boolean.${setWhiteNoise}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.white_noise_kallen_bedroom\"]\n },\n \"data\": {}\n }\n}\n\nlet sendVolume = {\n \"payload\": {\n \"action\": \"media_player.volume_set\",\n \"target\": {\n \"entity_id\": [\"media_player.kallen_bedroom_google_speaker\"]\n },\n \"data\": {\n \"volume_level\": setVolume\n }\n }\n}\n\nlet sendLights = {\n \"payload\": {\n \"action\": `light.${setLights}`,\n \"target\": {\n \"entity_id\": [\"light.kallen_bedroom_lights\"]\n },\n \"data\": {}\n }\n}\n\nlet sendWake = {\n \"payload\": {\n \"action\": `input_boolean.${setWake}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.kallen_awake\"]\n },\n \"data\": {}\n }\n}\n\nlet wakeMsg = {\n \"brightness\": brtFinal,\n \"fade\": fadeFinal\n}\n\nlet sleepMsg = {\n \"payload\": \"sleep\"\n}\n\nnode.log(`${roomName}: Message Payloads Defined`)\n\nnode.log(`----- ${roomName}: Set Parameters -----`)\nnode.log(`${roomName}: fanAvailable: ${fanAvailable}`)\nnode.log(`${roomName}: setFan: ${setFan}`)\nnode.log(`${roomName}: setWhiteNoise: ${setWhiteNoise}`)\nnode.log(`${roomName}: setVolume: ${setVolume}`)\nnode.log(`${roomName}: setLights: ${setLights}`)\nnode.log(`${roomName}: setWake: ${setWake}`)\nnode.log(`----- ${roomName}: End Parameters -----`)\n\nif (vacationMode === 'off' && overnight === 'off' && kallenLoc === 'home') {\n if (topic === 'kallen-fan' && fanSeparate === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Fan\"})\n node.log(`${roomName}: Early Fan`)\n node.send([null,[sendFan,sendWhiteNoise],null])\n } else if (topic === 'boolean' && toggle === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Wakeup\"})\n node.log(`${roomName}: Wake`)\n node.send([wakeMsg,[sendFan,sendWhiteNoise,sendVolume,sendWake],null])\n } else if (topic === 'boolean' && toggle === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sleep\"})\n node.log(`${roomName}: Sleep`)\n node.send([null,[sendFan,sendWhiteNoise,sendVolume,sendLights,sendWake],sleepMsg])\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"})\n node.log(`${roomName}: Flow Blocked`)\n}\n\nnode.log(`${roomName}: Processing Complete`)",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 1060,
"wires": [
[
"17e5f9acd57c2819",
"57651381835f659c"
],
[
"46a1e386f7468d21"
],
[
"7b0648758704fad4",
"292cda64df0c1c10",
"5b3a0cf1ee7d06b9"
]
],
"outputLabels": [
"wake",
"services",
"sleep"
]
},
{
"id": "62211bf089bc5b04",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_kallen_bedroom"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 1010,
"y": 1000,
"wires": [
[
"d0dacbae4513b1ad"
]
]
},
{
"id": "d0dacbae4513b1ad",
"type": "delay",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1135,
"y": 1000,
"wires": [
[
"acb52adc50d34045"
]
],
"l": false
},
{
"id": "7b390a3b24fc3197",
"type": "delay",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1345,
"y": 1000,
"wires": [
[
"a417e93366843249"
]
],
"l": false
},
{
"id": "a417e93366843249",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Adaptive On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_bedroom_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1470,
"y": 1000,
"wires": [
[]
]
},
{
"id": "17e5f9acd57c2819",
"type": "api-render-template",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ as_timestamp(now()) | timestamp_custom('%H:%M') }}",
"resultsLocation": "waketime",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 635,
"y": 940,
"wires": [
[
"a8070806c0f88856"
]
],
"l": false
},
{
"id": "a8070806c0f88856",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Set Wakeup Time",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_datetime.set_datetime",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_datetime.kallen_awake_at"
],
"labelId": [],
"data": "{\t \"time\": waketime\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_datetime",
"service": "set_datetime",
"x": 770,
"y": 940,
"wires": [
[]
]
},
{
"id": "3937c38bc1bd0ee0",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Set Sleep Time",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_datetime.set_datetime",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_datetime.kallen_asleep_at"
],
"labelId": [],
"data": "{\t \"time\": sleeptime\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_datetime",
"service": "set_datetime",
"x": 780,
"y": 1140,
"wires": [
[]
]
},
{
"id": "7b0648758704fad4",
"type": "api-render-template",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Sleep Time",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ as_timestamp(now()) | timestamp_custom('%H:%M') }}",
"resultsLocation": "sleeptime",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 635,
"y": 1140,
"wires": [
[
"3937c38bc1bd0ee0"
]
],
"l": false
},
{
"id": "f1dbb3a206dba921",
"type": "api-current-state",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Override",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_wakeup_override",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "wake_override",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 860,
"y": 1020,
"wires": [
[
"62211bf089bc5b04"
],
[]
]
},
{
"id": "94c022d2eb71e7d5",
"type": "server-events",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Timer Finished",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.shower_mode_cooldown\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "topic",
"propertyType": "msg",
"value": "timer",
"valueType": "str"
},
{
"property": "showermode",
"propertyType": "msg",
"value": "off",
"valueType": "str"
}
],
"x": 120,
"y": 720,
"wires": [
[
"ce5d8005cbf08144",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "ce5d8005cbf08144",
"type": "switch",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "On or Off",
"property": "showermode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 255,
"y": 660,
"wires": [
[
"9c01880c6319d29b"
],
[
"7646c6833d5a1df2"
]
],
"outputLabels": [
"On",
"Off"
],
"l": false
},
{
"id": "7646c6833d5a1df2",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Off",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst ac = global.get('masterBedroom.aircon.installed', \"diskCon\")\nconst temp = global.get('outdoorTemp.tempStr')\nconst threshold = states['input_number.master_bedroom_aircon_run_threshold'].state\nconst dayTemp = states['input_number.master_bedroom_daytime_temp'].state\nconst nightTemp = states['input_number.master_bedroom_night_temp'].state\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\nconst currentSetTemp = states['climate.master_bedroom_aircon'].attributes.temperature\nconst coolingTime = states['input_boolean.master_bedroom_cooling_on'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst topic = msg.topic\n\nconst airconEntity = [\"climate.master_bedroom_aircon\"]\n\nlet setTemp = {}\nlet setEco = {}\nlet duration = {}\nlet end = {}\nlet setHvac = {}\n\nif (topic === 'toggle') {\n if (hotDay === 'on' || sleeping === 'on') {\n setTemp = bedTemp\n setEco = 'turn_off'\n } else {\n setTemp = nightTemp\n setEco = 'turn_on'\n }\n} else if (topic === 'timer') {\n if (currentSetTemp == bedTemp) {\n setTemp = nightTemp\n if (hotDay === 'on') {\n setEco = 'turn_off'\n } else {\n setEco = 'turn_on'\n }\n } else {\n setTemp = dayTemp\n setEco = 'turn_on'\n }\n}\n\nif (setTemp == bedTemp) {\n duration = 3600\n} else if (setTemp == nightTemp && hotDay === 'off') {\n duration = 3600\n} else {\n duration = 1800\n}\n\nif (setTemp == dayTemp) {\n end = true\n if (hotDay === 'off') {\n setHvac = 'off'\n } else {\n setHvac = 'cool'\n }\n} else if (setTemp != bedTemp && coolingTime === 'on') {\n end = true\n setHvac = 'cool'\n} else {\n end = false\n setHvac = 'cool'\n}\n\nlet timerStart = {\n \"duration\": duration\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": \"auto\"\n }\n }\n}\n\nif (ac === 'on' && temp >= threshold) {\n if (sleeping === 'on' || coolingTime === 'on' || end === true) {\n node.status({fill:\"green\",shape:\"dot\",text:\"Finished\"})\n return [[sendHvac, sendTemp, sendAcFan, sendEco], null]\n } else {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Next Cycle\"})\n return [[sendHvac, sendTemp, sendAcFan, sendEco], timerStart]\n }\n} else if (ac === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"A/C Not Installed\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Too Cold\"})\n return null\n}\n",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 700,
"wires": [
[
"5ee549aa5e97d4a5"
],
[
"8286284fc9598efa"
]
],
"outputLabels": [
"Set",
"Timer"
]
},
{
"id": "8286284fc9598efa",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.start",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.shower_mode_cooldown"
],
"labelId": [],
"data": "{\t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "start",
"x": 550,
"y": 740,
"wires": [
[]
]
},
{
"id": "cbe37fd5b5fc4381",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "AC Settings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 750,
"y": 180,
"wires": [
[]
]
},
{
"id": "5def5d2440e767b3",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Meltdown Protocol",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.meltdown_protocol"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "danger",
"propertyType": "flow",
"value": "",
"valueType": "entityState"
}
],
"x": 190,
"y": 60,
"wires": [
[
"d153c7a7f050ce84"
]
]
},
{
"id": "d153c7a7f050ce84",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Meltdown Center",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst toggle = msg.payload\nconst ac = global.get('masterBedroom.aircon.installed', \"diskCon\")\nconst lastMode = flow.get(\"masterBedroom.lastMode\", \"diskCon\")\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\n\nconst airconEntity = [\"climate.master_bedroom_aircon\"]\nconst fanEntity = [\"fan.master_bedroom_fan\"]\n\nlet setTemp = bedTemp\nlet setEco = 'turn_off'\nlet setHvac = 'cool'\nlet setAcFan = 'High'\nlet setFan = 'turn_off'\n\nlet sendFan = {\n \"payload\": {\n \"action\": `fan.${setFan}`,\n \"target\": {\n \"entity_id\": fanEntity\n },\n \"data\": {}\n }\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": setAcFan\n }\n }\n}\n\nlet reset = {\n \"topic\": \"Reset\"\n}\n\nif (toggle === 'on') {\n node.status({fill:\"red\",shape:\"dot\",text:\"DANGER MODE ACTIVE\"})\n node.send([null,sendFan,null])\n if (ac === 'on') {\n node.send([[sendHvac,sendTemp,sendAcFan,sendEco],null,null])\n }\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Danger Mode Off\"})\n node.send([null,null,reset])\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 410,
"y": 60,
"wires": [
[
"862666f576addab8"
],
[
"b1c0cca848416d74"
],
[
"92ce51a81f7bc58d"
]
],
"outputLabels": [
"On (AC)",
"On (Fan)",
"Off"
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "b1c0cca848416d74",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Fan Settings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 750,
"y": 240,
"wires": [
[]
]
},
{
"id": "73c2d06e9114a0f6",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Sleep Switch",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.master_bedroom_sleeping"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "type",
"propertyType": "msg",
"value": "sleep",
"valueType": "str"
}
],
"x": 210,
"y": 480,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "e914726b0364c6be",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Bool Settings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 750,
"y": 300,
"wires": [
[]
]
},
{
"id": "d613dbf3643d1d4a",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Set Mode",
"func": "const states = global.get(\"homeassistant.homeAssistant.states\")\nconst sleeping = states[\"input_boolean.master_bedroom_sleeping\"].state\nconst earlyNight = states[\"binary_sensor.early_night_mode\"].state\nconst giveMeDarkness = states[\"input_boolean.give_me_darkness\"].state\nconst nightMode = states[\"input_boolean.night_mode\"].state\nconst goodnight = states[\"input_boolean.goodnight\"].state\nconst coolingActive = states['input_boolean.master_bedroom_cooling_on'].state\n\nlet lastMode = []\n\nif (sleeping === 'on' || nightMode === 'on' || goodnight === 'on') {\n lastMode = 'bedtime'\n} else if (earlyNight === 'on' || giveMeDarkness === 'on' || coolingActive === 'on') {\n lastMode = 'night'\n} else {\n lastMode = 'day'\n}\n\nflow.set(\"masterBedroom.lastMode\", lastMode, \"diskCon\")\nnode.status({ fill: \"green\", shape: \"dot\", text: `Last Mode Set: ${lastMode}`})",
"outputs": 0,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1160,
"y": 160,
"wires": []
},
{
"id": "9014f9e42a6b7c54",
"type": "inject",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "300",
"crontab": "",
"once": true,
"onceDelay": "60",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 1045,
"y": 100,
"wires": [
[
"d613dbf3643d1d4a"
]
],
"l": false
},
{
"id": "abd1783e6054329c",
"type": "complete",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "",
"scope": [
"a10629857d60f774",
"ce5d8005cbf08144",
"5def5d2440e767b3",
"73c2d06e9114a0f6"
],
"uncaught": false,
"x": 990,
"y": 220,
"wires": [
[
"d613dbf3643d1d4a"
]
]
},
{
"id": "6a731b17c05f0496",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Monitor Entities",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.give_me_darkness",
"input_boolean.master_bedroom_sleeping",
"binary_sensor.early_night_mode",
"input_boolean.night_mode",
"input_boolean.goodnight",
"input_boolean.master_bedroom_cooling_on"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 980,
"y": 160,
"wires": [
[
"d613dbf3643d1d4a"
]
]
},
{
"id": "86c9f3a3185215fc",
"type": "ha-button",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Reset",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "77c0d6f8dd47a65b",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "reset",
"valueType": "str"
}
],
"x": 410,
"y": 480,
"wires": [
[
"b7ac7e6a2ad9f5df",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "b7ac7e6a2ad9f5df",
"type": "link call",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Reset",
"links": [
"ade887c45bde00f1"
],
"linkType": "static",
"timeout": "30",
"x": 505,
"y": 480,
"wires": [
[
"a10629857d60f774"
]
],
"l": false
},
{
"id": "d6c81a79393be92c",
"type": "function",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Reset",
"func": "const lastMode = flow.get('masterBedroom.lastMode', \"diskCon\")\nconst linkSource = msg._linkSource\n\nlet setTime = []\nlet setType = []\nlet setTopic = []\n\nif (lastMode === 'day') {\n setTime = 'day'\n setType = 'manual'\n setTopic = 'manual-day'\n} else if (lastMode === 'night') {\n setTime = 'night'\n setType = 'manual'\n setTopic = 'manual-night'\n} else if (lastMode === 'bedtime') {\n setTime = 'bedtime'\n setType = 'manual'\n setTopic = 'manual-bedtime'\n}\n\nlet reset = {\n \"type\": setType,\n \"time\": setTime,\n \"topic\": setTopic,\n \"_linkSource\": linkSource\n}\n\nnode.send(reset)\nnode.status({ fill: \"green\", shape: \"dot\", text: `Mode reset to ${setTopic}`})",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 755,
"y": 520,
"wires": [
[
"88b10efda9e2c047"
]
],
"l": false
},
{
"id": "ade887c45bde00f1",
"type": "link in",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MB Climate Reset - In",
"links": [],
"x": 695,
"y": 520,
"wires": [
[
"d6c81a79393be92c"
]
]
},
{
"id": "88b10efda9e2c047",
"type": "link out",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MB Climate Reset - Out",
"mode": "return",
"links": [],
"x": 815,
"y": 520,
"wires": []
},
{
"id": "92ce51a81f7bc58d",
"type": "link call",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "",
"links": [
"ade887c45bde00f1"
],
"linkType": "static",
"timeout": "30",
"x": 415,
"y": 180,
"wires": [
[
"a10629857d60f774"
]
],
"l": false
},
{
"id": "476f73cf6b540f96",
"type": "function",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Allowed?",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst overnight = states['input_boolean.kallen_overnight'].state\nconst kallenLoc = states['person.kallen_stork'].state\n\nif (vacationMode === 'off' && overnight === 'off' && kallenLoc === 'home') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n node.log(\"Kallen climate flow allowed to proceed\")\n node.send(msg)\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 880,
"wires": [
[
"d6b56cb65c2ff140"
]
]
},
{
"id": "46a1e386f7468d21",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Service Calls",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 690,
"y": 1080,
"wires": [
[]
]
},
{
"id": "292cda64df0c1c10",
"type": "api-render-template",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Speech",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{% from 'speech.jinja' import kallenSleepMsg %}\n{{ kallenSleepMsg() }}",
"resultsLocation": "payload",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 635,
"y": 1200,
"wires": [
[
"b4dbbf788c5a30d2"
]
],
"l": false
},
{
"id": "a2c9a6a52d4d2591",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Downstairs Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights",
"light.mud_room_overhead"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1210,
"y": 940,
"wires": [
[]
]
},
{
"id": "7c483301056c67a9",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Cancel Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "timer.cancel",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"timer.living_room_motion_timer"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "timer",
"service": "cancel",
"x": 1010,
"y": 940,
"wires": [
[
"a2c9a6a52d4d2591"
]
]
},
{
"id": "08335765e8c7eac0",
"type": "ha-time",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Master Bedroom Cooling",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "8e399b2a287a0905",
"entityId": "input_datetime.master_bedroom_cooling",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "night",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mrbedroom-cooling",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 170,
"y": 180,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "b5cfb253dc157cc9",
"type": "ha-time",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Master Bedroom Fan",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "314752dbc6fd170d",
"entityId": "input_datetime.master_bedroom_fan",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "night",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mrbedroom-fan",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 180,
"y": 240,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "6fb6d8041e1a4cad",
"type": "ha-time",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Master Bedroom Wakeup",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "d7261338e6b907f1",
"entityId": "input_datetime.master_bedroom_wakeup",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "day",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mrbedroom-wakeup",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 170,
"y": 300,
"wires": [
[
"a10629857d60f774",
"6f4235c9d4f6a6ea"
]
]
},
{
"id": "a0dd18613130787f",
"type": "ha-time",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Kallen Bedtime",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "d5784e5baa80a105",
"entityId": "input_datetime.kallen_bedtime",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "kallen-night",
"valueType": "str"
},
{
"property": "toggle",
"propertyType": "msg",
"value": "on",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 120,
"y": 880,
"wires": [
[
"476f73cf6b540f96"
]
]
},
{
"id": "324d56cbdc1eb170",
"type": "ha-time",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Kallen Wakeup",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "9e1418c3e9595312",
"entityId": "input_datetime.kallen_wakeup_time",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "kallen-morning",
"valueType": "str"
},
{
"property": "toggle",
"propertyType": "msg",
"value": "off",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 120,
"y": 940,
"wires": [
[
"476f73cf6b540f96"
]
]
},
{
"id": "ec4682a111a48b70",
"type": "ha-time",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Kallen Fan Time",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "308fce46bd959bce",
"entityId": "input_datetime.kallen_fan",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "kallen-fan",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 120,
"y": 1120,
"wires": [
[
"61405a43f61f3d60"
]
]
},
{
"id": "96cf0949902f8572",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "TTS Briefings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 1220,
"y": 420,
"wires": [
[]
]
},
{
"id": "6bbf7df2c43c481e",
"type": "delay",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Delay",
"pauseType": "delayv",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 695,
"y": 420,
"wires": [
[
"02f922bba32e4c71"
]
],
"l": false
},
{
"id": "5b3a0cf1ee7d06b9",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "39a7ac02f2727f1d",
"name": "Turn on Give Me Darkness",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.give_me_darkness"
],
"labelId": [],
"data": "{}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 740,
"y": 1260,
"wires": [
[]
]
},
{
"id": "02f922bba32e4c71",
"type": "api-current-state",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Do Not Disturb",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.master_bedroom_echo_dot_do_not_disturb_switch",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 820,
"y": 420,
"wires": [
[
"ffa5d38853e1360a"
],
[]
]
},
{
"id": "ffa5d38853e1360a",
"type": "api-current-state",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "People Sleeping",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.people_sleeping",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1020,
"y": 420,
"wires": [
[
"96cf0949902f8572"
],
[]
]
},
{
"id": "e0ccc1c73ecf40cb",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Meltdown Protocol",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.meltdown_protocol"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "danger",
"propertyType": "flow",
"value": "",
"valueType": "entityState"
}
],
"x": 170,
"y": 1360,
"wires": [
[
"61f25466213cb85c"
]
]
},
{
"id": "c0b160cbf7cb26d9",
"type": "ha-button",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EB Bedtime Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "6bbeae1a731c6fa2",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-bedtime",
"valueType": "str"
},
{
"property": "time",
"propertyType": "msg",
"value": "bedtime",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
}
],
"x": 170,
"y": 1420,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "2370770ce10c8a17",
"type": "ha-button",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EB Night Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "774a5097399e1169",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
},
{
"property": "time",
"propertyType": "msg",
"value": "night",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-night",
"valueType": "str"
}
],
"x": 180,
"y": 1600,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "69a01541c0c04367",
"type": "ha-button",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EB Day Mode",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "46dadc28a60d6dd8",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "day",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "manual",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "manual-day",
"valueType": "str"
}
],
"x": 190,
"y": 1660,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "4a4335e390443134",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Sleep Switch",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.emma_sleeping"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "type",
"propertyType": "msg",
"value": "sleep",
"valueType": "str"
}
],
"x": 190,
"y": 1720,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "be5db4b6e0dc6207",
"type": "ha-time",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Emma Bedroom Cooling",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "a7edd9c339d922b1",
"entityId": "input_datetime.emma_bedroom_cooling",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "night",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "emmabedroom-cooling",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 150,
"y": 1480,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "a2635913609af931",
"type": "ha-time",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Emma Bedroom Wakeup",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "a41edb9d72f72766",
"entityId": "input_datetime.emma_wakeup",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "time",
"propertyType": "msg",
"value": "day",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "emmabedroom-wakeup",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 150,
"y": 1540,
"wires": [
[
"34d7881576b29949",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "3421222c0667a9ef",
"type": "ha-button",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Reset",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "41b47b5dcb51a9c7",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "reset",
"valueType": "str"
}
],
"x": 210,
"y": 1780,
"wires": [
[
"03c668f84022cc23",
"7d50b11bbf5de8fd"
]
]
},
{
"id": "c9d1ed9d0ea401e6",
"type": "ha-button",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "A/C Fan Only",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "0295918c27c0b70b",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 650,
"y": 1720,
"wires": [
[
"a273dadf7a256af1"
]
]
},
{
"id": "34d7881576b29949",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Processing",
"func": "node.log(\"Emma Bedroom Climate: Processing Started\");\n// pull in the necessary information\n\nconst states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.emma_bedroom_climate_protocol'].state\nconst ac = global.get('emmaBedroom.aircon.installed', \"diskCon\")\nconst temp = global.get(\"outdoorTemp.tempStr\")\nconst payload = msg.payload\nconst vacation = states['input_boolean.vacation_mode'].state\nconst dayTemp = states['input_number.emma_bedroom_daytime_temp'].state\nconst nightTemp = states['input_number.emma_bedroom_night_temp'].state\nconst bedTemp = states['input_number.emma_bedroom_bedtime_temp'].state\nconst schedMode = states['input_select.scheduled_climate_mode_emma_bedroom'].state\nconst sleeping = states['input_boolean.emma_sleeping'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states[\"binary_sensor.heat_warning\"].state\nconst earlyNight = states[\"binary_sensor.early_night_mode\"].state\nconst danger = states['binary_sensor.heat_warning'].attributes.danger\nconst meltdown = states['input_boolean.meltdown_protocol'].state\nconst coolingActive = states['input_boolean.emma_bedroom_cooling_on'].state\nnode.log(\"Emma Bedroom Climate: Constants Set\")\n\n// Define reusable constants\n\nconst airconEntity = [\"climate.emma_bedroom_aircon\"]\nconst whiteNoiseEntity = [\"input_boolean.white_noise_emma_bedroom\"]\nconst validSchedModesAC = ['AC', 'Fan']\nconst peopleIDs = [\"input_boolean.emma_awake\"]\n\n// Helper function to convert a string to title case\n\nfunction convertToTitleCase(str) {\n if (!str) {\n return \"\";\n }\n return str.toLowerCase().replace(/\\b\\w/g, (s) => s.toUpperCase());\n}\n\n// init variables\n\nlet setTemp = dayTemp\nlet setAcFan = 'auto'\nlet setEco = 'turn_on'\nlet setHvac = 'cool'\nlet setCool = []\nlet setSleep = []\nlet setPeople = []\nlet setDisplay = 'turn_on'\nlet setWhiteNoise = \"turn_off\"\nlet time = []\nlet type = msg.type\nlet topic = msg.topic\nlet isWakeup = context.get(\"isWakeup\")\nnode.log(\"Emma Bedroom Climate: Variables Defined\")\n\n// Sleep Switch Handling\nif (type === 'sleep' && payload === 'off') {\n setDisplay = 'turn_on'\n setPeople = 'turn_on'\n if (coolingActive === 'on') {\n time = 'night'\n } else {\n time = 'day'\n }\n} else if (type === 'sleep' && payload === 'on') {\n setDisplay = 'turn_off'\n time = 'bedtime'\n} else {\n time = msg.time\n}\n\nif (topic === 'emmabedroom-wakeup') {\n setSleep = 'turn_off'\n}\n\n// Day Time\nif (time === 'day') {\n if (type === 'auto') {\n setCool = 'turn_off'\n }\n if (earlyNight === 'off') {\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp = nightTemp\n setEco = \"turn_on\"\n setHvac = \"cool\"\n } else if (hotDay === 'on' || heatWarning === 'on') {\n setTemp = dayTemp\n setEco = \"turn_on\"\n setHvac = \"cool\"\n } else {\n setTemp = nightTemp\n setEco = \"turn_on\"\n setHvac = \"off\"\n }\n }\n } else if (earlyNight === 'on') {\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp === bedTemp\n } else {\n setTemp = nightTemp\n }\n if (schedMode === 'AC') {\n setHvac = 'cool'\n } else if (schedMode === 'fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n if (hotDay === 'on') {\n setEco = 'turn_off'\n } else {\n setEco = 'turn_on'\n }\n }\n }\n// Night Time\n} else if (time === 'night') {\n // If this is being run at scheduled time, turn on input_boolean.emma_bedroom_cooling_on\n if (type === 'auto') {\n setCool = 'turn_on'\n }\n // Decide temperature\n if (type === 'sleep' && payload === 'off') {\n setTemp = dayTemp\n } else if (danger === 'Extreme') {\n setTemp = bedTemp\n } else {\n setTemp = nightTemp\n }\n // Decide eco mode\n if (sleeping === 'on') {\n setEco = 'turn_off'\n } else {\n setEco = 'turn_on'\n }\n // Decide HVAC mode\n if (schedMode === 'AC') {\n setHvac = 'cool'\n } else if (schedMode === 'Fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n// Bed Time\n} else if (time === 'bedtime') {\n setPeople = 'turn_off'\n if (ac === 'on') {\n setTemp = bedTemp\n setEco = 'turn_off'\n if (schedMode === 'AC') {\n setHvac = 'cool'\n setDisplay = 'turn_off'\n } else if (schedMode === 'Fan') {\n setHvac = \"fan_only\"\n setDisplay = 'turn_off'\n } else if (schedMode === 'White Noise') {\n setWhiteNoise = 'turn_on'\n if (ac === 'on') {\n setHvac = 'off'\n }\n } else {\n setHvac = \"off\"\n }\n }\n}\nnode.log(\"Emma Bedroom Climate: Decision Logic Complete\")\n\n// Define message payloads\n\nlet sendCool = {\n \"payload\": {\n \"action\": `input_boolean.${setCool}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.emma_bedroom_cooling_on\"]\n },\n \"data\": {}\n }\n}\n\nlet sendSleep = {\n \"payload\": {\n \"action\": `input_boolean.${setSleep}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.emma_sleeping\"]\n },\n \"data\": {}\n }\n}\n\nlet sendPeople = {\n \"payload\": {\n \"action\": `input_boolean.${setPeople}`,\n \"target\": {\n \"entity_id\": peopleIDs\n },\n \"data\": {}\n }\n}\n\nlet sendDisplay = {\n \"payload\": {\n \"action\": `switch.${setDisplay}`,\n \"target\": {\n \"entity_id\": [\"switch.emma_bedroom_aircon_display\"]\n },\n \"data\": {}\n }\n}\n\nlet sendWhiteNoise = {\n \"payload\": {\n \"action\": `input_boolean.${setWhiteNoise}`,\n \"target\": {\n \"entity_id\": whiteNoiseEntity\n },\n \"data\": {}\n }\n}\n\nlet notify = {\n \"topic\": topic,\n \"nighttemp\": nightTemp,\n \"schedMode\": schedMode\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.emma_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": setAcFan\n }\n }\n}\n\nnode.log(\"Emma Bedroom Climate: Message Payloads Defined\")\n\n// Send some parameters to flow context for use in other nodes\n\nif (setHvac.length > 0) {\n flow.set('emmaBedroom.airconHvacMode',setHvac,'diskCon')\n}\n\nif (setEco.length > 0) {\n flow.set('emmaBedroom.airconEco',setEco,'diskCon')\n}\n\nif (setTemp.length > 0) {\n flow.set('emmaBedroom.airconTargetTemp',setTemp,'diskCon')\n}\n\nif (setDisplay.length > 0) {\n flow.set('emmaBedroom.airconDisplay',setDisplay,'diskCon')\n}\n\nflow.set('emmaBedroom.airconFanMode',setAcFan,'diskCon')\n\n// Log the parameters that were chosen, for debugging purposes\n\nnode.log(\"----- Emma Bedroom Climate: Set Parameters -----\")\nnode.log(`setTemp: ${setTemp}`)\nnode.log(`setAcFan: ${setAcFan}`)\nnode.log(`setEco: ${setEco}`)\nnode.log(`setHvac: ${setHvac}`)\nnode.log(`setCool: ${setCool}`)\nnode.log(`setSleep: ${setSleep}`)\nnode.log(`setPeople: ${setPeople}`)\nnode.log(`setDisplay: ${setDisplay}`)\nnode.log(`time: ${time}`)\nnode.log(`type: ${type}`)\nnode.log(`topic: ${topic}`)\nnode.log(\"----- Emma Bedroom Climate: End Parameters -----\")\n\n// If this was an automated trigger, set the cooling context for the bedroom accordingly.\n\nif (type === 'auto' && time != 'bedtime') {\n node.send([null, sendCool, null])\n node.log(\"Emma Bedroom Climate: Cooling Context Set\")\n}\n\nif (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'off') {\n node.log(\"Emma Bedroom Climate: Auto\")\n if (sleeping === 'on' && topic != 'emmabedroom-wakeup') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (sleep mode)\" })\n node.log(\"Emma Bedroom Climate: Blocked (sleep mode)\")\n } else {\n if (topic === 'emmabedroom-cooling' && ac === 'on') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Cooling Schedule\" })\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Auto/Cooling\")\n } else if (topic === 'emmabedroom-bedtime') {\n node.send([null, sendPeople, null])\n node.status({ fill: \"green\", shape: \"dot\", text: \"Bedtime\" })\n node.log(\"Emma Bedroom Climate: Auto/Bedtime\")\n if (validSchedModesAC.includes(schedMode) && ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Auto/Bedtime/AC\")\n } else if (schedMode === 'White Noise') {\n node.send([null, sendWhiteNoise, null])\n node.log(\"Emma Bedroom Climate: Auto/Bedtime/White Noise\")\n }\n } else if (topic === 'emmabedroom-wakeup') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Wakeup Schedule\" })\n node.log(\"Emma Bedroom Climate: Auto/Wakeup\")\n if (sleeping === 'off') {\n context.set(\"isWakeup\", false)\n node.send([null, sendWhiteNoise, null])\n node.log(\"Emma Bedroom Climate: Auto/Wakeup/Sleep Off\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Auto/Wakeup/AC On\")\n }\n } else if (sleeping === 'on') {\n context.set(\"isWakeup\", true)\n node.send([null, sendSleep, null])\n node.log(\"Emma Bedroom Climate: Auto/Wakeup/Sleep On\")\n }\n }\n }\n// Manual Responses\n} else if (type === 'manual') {\n node.log(\"Emma Bedroom Climate: Manual\")\n if (time === 'night') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Night\" })\n node.log(\"Emma Bedroom Climate: Manual/Night\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Manual/Night/AC\")\n }\n } else if (time === 'day') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Day\" })\n node.send([null, sendWhiteNoise, null])\n node.log(\"Emma Bedroom Climate: Manual/Day\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Manual/Day/AC\")\n }\n } else if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Bedtime\" })\n node.log(\"Emma Bedroom Climate: Manual/Bedtime\")\n if (validSchedModesAC.includes(schedMode) && ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Manual/Bedtime/AC\")\n } else if (schedMode === 'White Noise') {\n node.send([null, sendWhiteNoise, null])\n node.log(\"Emma Bedroom Climate: Manual/Bedtime/White Noise\")\n }\n }\n context.set(\"isWakeup\", false)\n// Sleep Switch Responses\n} else if (type === 'sleep') {\n if (payload === 'off') {\n node.send([null, [sendPeople, sendWhiteNoise], null])\n }\n node.log(\"Emma Bedroom Climate: Sleep\")\n if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Sleep\" })\n node.send([null, [sendPeople, sendWhiteNoise], null])\n node.log(\"Emma Bedroom Climate: Sleep/Bedtime\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(\"Emma Bedroom Climate: Sleep/Bedtime/AC\")\n }\n } else {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Wakeup\" })\n node.send([null, sendWhiteNoise, null])\n node.log(\"Emma Bedroom Climate: Sleep/Day\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])\n node.log(`Emma Bedroom Climate: Sleep/${convertToTitleCase(time)}/AC`)\n }\n }\n context.set(\"isWakeup\", false)\n} else if (meltdown === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Meltdown Protocol)\" })\n node.log(\"Emma Bedroom Climate: Blocked (Meltdown Protocol)\")\n} else if (vacation === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Vacation Mode)\" })\n node.log(\"Emma Bedroom Climate: Blocked (Vacation Mode)\")\n} else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Automation Disabled)\" })\n node.log(\"Emma Bedroom Climate: Blocked (Automation Disabled)\")\n}\n\nnode.log(\"Emma Bedroom Climate: Processing Complete\")\n",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "context.set(\"isWakeup\", false)",
"finalize": "",
"libs": [],
"x": 470,
"y": 1540,
"wires": [
[
"53b440a31d30df1b"
],
[
"f5d407ee3f07dee6"
],
[
"b4f3d9fd20c0637e"
]
],
"outputLabels": [
"A/C",
"Boolean",
"Notify"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "1e2abb7eff658e81",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "AC Settings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 650,
"y": 1480,
"wires": [
[
"bb9595faa1592fd9"
]
]
},
{
"id": "f5d407ee3f07dee6",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Bool Settings",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 650,
"y": 1540,
"wires": [
[]
]
},
{
"id": "b4f3d9fd20c0637e",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Notifications",
"func": "const topic = msg.topic\nconst nightTemp = msg.nighttemp\nconst acMode = msg.acmode\n\nlet coolMsg = {\n \"payload\": `Emma bedroom AC temp has been set to ${nightTemp} °F as scheduled`,\n \"topic\": 'Emma AC Mode: Cooling'\n}\nlet fanOnlyMsg = {\n \"payload\": 'Mildly chilly outside, AC running fan only.',\n \"topic\": \"Emma AC Mode: Fan Only\"\n}\n\nif (topic === 'emmabedroom-cooling') {\n if (acMode === 'AC') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Cooling\"})\n return coolMsg\n } else if (acMode === 'Fan') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Fan Only\"})\n return fanOnlyMsg\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Notification not sent\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 1600,
"wires": [
[
"ccb3a655b7d6836b"
]
]
},
{
"id": "ccb3a655b7d6836b",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "iOS Notifications",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"parents\",\t \"title\": topic,\t \"message\": payload,\t \"type\": \"normal\",\t \"tag\": \"emma-bedroom-climate\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 840,
"y": 1600,
"wires": [
[]
]
},
{
"id": "7561647f2cdf58d3",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Set Mode",
"func": "const states = global.get(\"homeassistant.homeAssistant.states\")\nconst sleeping = states[\"input_boolean.emma_sleeping\"].state\nconst earlyNight = states[\"binary_sensor.early_night_mode\"].state\nconst giveMeDarkness = states[\"input_boolean.give_me_darkness\"].state\nconst nightMode = states[\"input_boolean.night_mode\"].state\nconst goodnight = states[\"input_boolean.goodnight\"].state\nconst coolingActive = states['input_boolean.emma_bedroom_cooling_on'].state\n\nlet lastMode = []\n\nif (sleeping === 'on' || nightMode === 'on' || goodnight === 'on') {\n lastMode = 'bedtime'\n} else if (earlyNight === 'on' || giveMeDarkness === 'on' || coolingActive === 'on') {\n lastMode = 'night'\n} else {\n lastMode = 'day'\n}\n\nflow.set(\"emmaBedroom.lastMode\", lastMode, \"diskCon\")\nnode.status({ fill: \"green\", shape: \"dot\", text: `Last Mode Set: ${lastMode}`})",
"outputs": 0,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1000,
"y": 1420,
"wires": []
},
{
"id": "8c5fb72719e1917d",
"type": "inject",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "300",
"crontab": "",
"once": true,
"onceDelay": "60",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 885,
"y": 1360,
"wires": [
[
"7561647f2cdf58d3"
]
],
"l": false
},
{
"id": "fc5cad0242d957aa",
"type": "complete",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"scope": [
"34d7881576b29949",
"4a4335e390443134",
"e0ccc1c73ecf40cb"
],
"uncaught": false,
"x": 830,
"y": 1480,
"wires": [
[
"7561647f2cdf58d3"
]
]
},
{
"id": "33d2a06ed0659a13",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Monitor Entities",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.give_me_darkness",
"binary_sensor.early_night_mode",
"input_boolean.night_mode",
"input_boolean.goodnight",
"input_boolean.emma_sleeping",
"input_boolean.emma_bedroom_cooling_on"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 820,
"y": 1420,
"wires": [
[
"7561647f2cdf58d3"
]
]
},
{
"id": "61f25466213cb85c",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Meltdown Center",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst toggle = msg.payload\nconst ac = global.get('emmaBedroom.aircon.installed', \"diskCon\")\nconst lastMode = flow.get(\"emmaBedroom.lastMode\", \"diskCon\")\nconst bedTemp = states['input_number.emma_bedroom_bedtime_temp'].state\n\nconst airconEntity = [\"climate.emma_bedroom_aircon\"]\n\nlet setTemp = bedTemp\nlet setEco = 'turn_off'\nlet setHvac = 'cool'\nlet setAcFan = 'High'\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${setEco}`,\n \"target\": {\n \"entity_id\": [\"switch.emma_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": setAcFan\n }\n }\n}\n\nlet reset = {\n \"topic\": \"Reset\"\n}\n\nif (toggle === 'on') {\n node.status({fill:\"red\",shape:\"dot\",text:\"DANGER MODE ACTIVE\"})\n if (ac === 'on') {\n node.send([[sendHvac,sendTemp,sendAcFan,sendEco],null])\n }\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Danger Mode Off\"})\n node.send([null,reset])\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 410,
"y": 1360,
"wires": [
[
"53b440a31d30df1b"
],
[
"15b160d6bfe30b15"
]
],
"outputLabels": [
"On (AC)",
"Off"
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "f6755ee93883b34d",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Reset",
"func": "const lastMode = flow.get(\"emmaBedroom.lastMode\", \"diskCon\")\nconst linkSource = msg._linkSource\n\nlet setTime = []\nlet setType = []\nlet setTopic = []\n\nif (lastMode === 'day') {\n setTime = 'day'\n setType = 'manual'\n setTopic = 'manual-day'\n} else if (lastMode === 'night') {\n setTime = 'night'\n setType = 'manual'\n setTopic = 'manual-night'\n} else if (lastMode === 'bedtime') {\n setTime = 'bedtime'\n setType = 'manual'\n setTopic = 'manual-bedtime'\n}\n\nlet reset = {\n \"type\": setType,\n \"time\": setTime,\n \"topic\": setTopic,\n \"_linkSource\": linkSource\n}\n\nnode.status({ fill: \"green\", shape: \"dot\", text: `Mode reset to ${setTopic}`})\nreturn(reset)",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 665,
"y": 1660,
"wires": [
[
"884ffbd2493411f9"
]
],
"l": false
},
{
"id": "7631b8823839f4b1",
"type": "link in",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EB Climate Reset - In",
"links": [],
"x": 595,
"y": 1660,
"wires": [
[
"f6755ee93883b34d"
]
]
},
{
"id": "884ffbd2493411f9",
"type": "link out",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EB Climate Reset - Out",
"mode": "return",
"links": [],
"x": 735,
"y": 1660,
"wires": []
},
{
"id": "15b160d6bfe30b15",
"type": "link call",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"links": [
"7631b8823839f4b1"
],
"linkType": "static",
"timeout": "30",
"x": 335,
"y": 1420,
"wires": [
[
"34d7881576b29949"
]
],
"l": false
},
{
"id": "03c668f84022cc23",
"type": "link call",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Reset",
"links": [
"7631b8823839f4b1"
],
"linkType": "static",
"timeout": "30",
"x": 315,
"y": 1780,
"wires": [
[
"34d7881576b29949"
]
],
"l": false
},
{
"id": "a273dadf7a256af1",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Set to Fan",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_hvac_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.emma_bedroom_aircon"
],
"labelId": [],
"data": "{\t \"hvac_mode\":\"fan_only\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "climate",
"service": "set_hvac_mode",
"x": 830,
"y": 1720,
"wires": [
[
"8bb8dc720af76714"
]
]
},
{
"id": "8bb8dc720af76714",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Eco Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "climate.set_preset_mode",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"climate.emma_bedroom_aircon"
],
"labelId": [],
"data": "{\t \"preset_mode\":\"none\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "climate",
"service": "set_preset_mode",
"x": 1000,
"y": 1720,
"wires": [
[]
]
},
{
"id": "ffe28978275ac1a4",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR AC Settings Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1520,
"y": 120,
"wires": []
},
{
"id": "e2c62d1cba780500",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Fan Settings Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1520,
"y": 180,
"wires": []
},
{
"id": "2d79ecea5a6f4fa8",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Boolean Settings Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1530,
"y": 240,
"wires": []
},
{
"id": "7bd9e989743a6aa2",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Notify Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1500,
"y": 300,
"wires": []
},
{
"id": "3257d2fe36755d37",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Briefing Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1510,
"y": 360,
"wires": []
},
{
"id": "74783fb85da3edbe",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Reset Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1500,
"y": 420,
"wires": []
},
{
"id": "002858f9b16ed975",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Shower Mode On Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1540,
"y": 480,
"wires": []
},
{
"id": "97f433c699d1f83e",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Shower Mode Off Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1540,
"y": 540,
"wires": []
},
{
"id": "5cce5b011ebc5d32",
"type": "catch",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "",
"scope": "group",
"uncaught": false,
"x": 1170,
"y": 660,
"wires": [
[
"1f2b0cb7e79e145a"
]
]
},
{
"id": "1f2b0cb7e79e145a",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Catch Node Output",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1520,
"y": 600,
"wires": []
},
{
"id": "62b761bce85aecb7",
"type": "debug",
"z": "72f99805df043603",
"g": "a09584861c2fe558",
"name": "MBR Triggers Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1510,
"y": 660,
"wires": []
},
{
"id": "bb9595faa1592fd9",
"type": "debug",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "AC Settings Debug",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 710,
"y": 1360,
"wires": []
},
{
"id": "ddef9ad0ac0a98a0",
"type": "poll-state",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Poll State",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "3ce4b28fb7c060b0",
"updateInterval": "60",
"updateIntervalType": "num",
"updateIntervalUnits": "seconds",
"outputInitially": false,
"outputOnChanged": true,
"entityId": "climate.emma_bedroom_aircon",
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputs": 1,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 200,
"y": 1840,
"wires": [
[
"f1f2ac113fe2b639"
]
]
},
{
"id": "71b1c6e934b85637",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Watchdog",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst sleeping = states['input_boolean.emma_sleeping'].state\n\nif (sleeping !== 'on') {\n node.status({fill:'red',shape:'ring',text:'Emma not sleeping, watchdog disabled'})\n return null\n}\n\nconst airconEntity = ['climate.emma_bedroom_aircon']\n\n// Gather relevant attributes from the aircon entity\n\nconst airconState = msg.payload.state\nconst airconAttributes = msg.payload.attributes\nconst airconEco = airconAttributes['eco_mode']\nconst airconTargetTemp = airconAttributes['temperature']\nconst airconFanMode = airconAttributes['fan_mode']\nconst airconDisplay = airconAttributes['screen_display']\n\n// Gather the last explicitly sent configuration from the context\n\nconst airconHvacCfg = flow.get('emmaBedroom.airconHvacMode', 'diskCon')\nconst airconEcoCfg = flow.get('emmaBedroom.airconEco', 'diskCon')\nconst airconTargetTempCfg = parseFloat(flow.get('emmaBedroom.airconTargetTemp', 'diskCon'))\nconst airconFanModeCfg = flow.get('emmaBedroom.airconFanMode', 'diskCon')\nconst airconDisplayCfg = flow.get('emmaBedroom.airconDisplay', 'diskCon')\n\n// Compare the current state with the last sent configuration\n\nlet ecoMatch = {}\nlet displayMatch = {}\nlet counter = 0\n\nlet sendDisplay = {\n \"payload\": {\n \"action\": `switch.${airconDisplayCfg}`,\n \"target\": {\n \"entity_id\": [\"switch.emma_bedroom_aircon_display\"]\n },\n \"data\": {}\n }\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"hvac_mode\": airconHvacCfg\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"temperature\": airconTargetTempCfg\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": `switch.${airconEcoCfg}`,\n \"target\": {\n \"entity_id\": [\"switch.emma_bedroom_aircon_eco_mode\"]\n },\n \"data\": {}\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": airconEntity\n },\n \"data\": {\n \"fan_mode\": airconFanModeCfg\n }\n }\n}\n\n// Fix hvac mode if mismatch\n\nif (airconState != airconHvacCfg) {\n node.log(`Emma Bedroom Aircon HVAC mode mismatch: ${airconState} vs ${airconHvacCfg}`)\n node.send(sendHvac)\n counter += 1\n}\n\n// Fix eco mode if mismatch\n\nif (airconEco === false && airconEcoCfg === 'turn_off') {\n ecoMatch = true\n} else if (airconEco === true && airconEcoCfg === 'turn_on') {\n ecoMatch = true\n} else {\n ecoMatch = false\n}\n\nif (ecoMatch === false) {\n node.log(`Emma Bedroom Aircon Eco mode mismatch: ${airconEco} vs ${airconEcoCfg}`)\n node.send(sendEco)\n counter += 1\n}\n\n// Fix target temperature if mismatch\n\nif (airconTargetTemp != airconTargetTempCfg) {\n node.log(`Target temperature mismatch: ${airconTargetTemp} vs ${airconTargetTempCfg}`)\n node.send(sendTemp)\n counter += 1\n}\n\n// Fix fan mode if mismatch\n\nif (airconFanMode != airconFanModeCfg) {\n node.log(`Fan mode mismatch: ${airconFanMode} vs ${airconFanModeCfg}`)\n node.send(sendAcFan)\n counter += 1\n}\n\n// Fix display mode if mismatch\n\nif (airconDisplay === false && airconDisplayCfg === 'turn_off') {\n displayMatch = true\n} else if (airconDisplay === true && airconDisplayCfg === 'turn_on') {\n displayMatch = true\n} else {\n displayMatch = false\n}\n\nif (displayMatch === false) {\n node.log(`Emma Bedroom Aircon Display mode mismatch: ${airconDisplay} vs ${airconDisplayCfg}`)\n node.send(sendDisplay)\n counter += 1\n}\n\nif (counter > 0) {\n node.log(`Emma Bedroom Aircon: ${counter} configuration(s) fixed`)\n node.status({fill:'yellow',shape:'dot',text:`${counter} config(s) fixed`})\n} else {\n node.status({fill:'green',shape:'dot',text:`No config changes`})\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 460,
"y": 1840,
"wires": [
[
"334a79e6f5f3a16a",
"b96ad84b569ac360"
]
]
},
{
"id": "334a79e6f5f3a16a",
"type": "debug",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Watchdog Debug",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 1840,
"wires": []
},
{
"id": "7472fd892bcfc621",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR AC Settings Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1280,
"y": 1360,
"wires": []
},
{
"id": "975328c94dcd31e7",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR Boolean Settings Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1290,
"y": 1420,
"wires": []
},
{
"id": "22ddbddb684f7163",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR Notify Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1260,
"y": 1480,
"wires": []
},
{
"id": "c40516c637bc1a7e",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR Reset Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1260,
"y": 1540,
"wires": []
},
{
"id": "7593f77568c03db2",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR Catch Node Output",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1280,
"y": 1600,
"wires": []
},
{
"id": "30679e01160e2e2e",
"type": "debug",
"z": "72f99805df043603",
"g": "af295df6d8fdd3ad",
"name": "EBR Triggers Output",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1270,
"y": 1660,
"wires": []
},
{
"id": "2718f2695ff412fa",
"type": "catch",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"scope": "group",
"uncaught": false,
"x": 1010,
"y": 1660,
"wires": [
[
"7593f77568c03db2"
]
]
},
{
"id": "862666f576addab8",
"type": "delay",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 645,
"y": 180,
"wires": [
[
"cbe37fd5b5fc4381"
]
],
"l": false
},
{
"id": "53b440a31d30df1b",
"type": "delay",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 545,
"y": 1480,
"wires": [
[
"1e2abb7eff658e81"
]
],
"l": false
},
{
"id": "bcef7debc9bda36c",
"type": "link in",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Master Bedroom Aircon Settings - In",
"links": [
"5ee549aa5e97d4a5"
],
"x": 635,
"y": 60,
"wires": [
[
"862666f576addab8"
]
]
},
{
"id": "5ee549aa5e97d4a5",
"type": "link out",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Shower Mode AC Settings",
"mode": "link",
"links": [
"bcef7debc9bda36c"
],
"x": 485,
"y": 660,
"wires": []
},
{
"id": "f1f2ac113fe2b639",
"type": "delay",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 325,
"y": 1840,
"wires": [
[
"71b1c6e934b85637"
]
],
"l": false
},
{
"id": "b96ad84b569ac360",
"type": "link out",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Emma Climate Watchdog",
"mode": "link",
"links": [
"894e510fd44b01e0"
],
"x": 595,
"y": 1780,
"wires": []
},
{
"id": "894e510fd44b01e0",
"type": "link in",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Emma Bedroom Aircon Settings - In",
"links": [
"b96ad84b569ac360"
],
"x": 475,
"y": 1480,
"wires": [
[
"53b440a31d30df1b"
]
]
},
{
"id": "b4d619d31ec9121d",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Turn Off Beep",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.master_bedroom_aircon_prompt_tone"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "turn_off",
"x": 960,
"y": 580,
"wires": [
[]
]
},
{
"id": "eee837a3c93b3abd",
"type": "api-call-service",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Turn Off Beep",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.emma_bedroom_aircon_prompt_tone"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "turn_off",
"x": 980,
"y": 1780,
"wires": [
[]
]
},
{
"id": "d1dd42ebc53343df",
"type": "poll-state",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "Beep Turned On",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"updateInterval": "60",
"updateIntervalType": "num",
"updateIntervalUnits": "seconds",
"outputInitially": true,
"outputOnChanged": true,
"entityId": "switch.master_bedroom_aircon_prompt_tone",
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputs": 2,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "debug",
"propertyType": "msg",
"value": "MBR Beep Fixed",
"valueType": "str"
}
],
"x": 760,
"y": 580,
"wires": [
[
"b4d619d31ec9121d",
"1fc55a133a7d82c4"
],
[]
]
},
{
"id": "2a02683008423af4",
"type": "poll-state",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Beep Turned On",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"updateInterval": "60",
"updateIntervalType": "num",
"updateIntervalUnits": "seconds",
"outputInitially": true,
"outputOnChanged": true,
"entityId": "switch.emma_bedroom_aircon_prompt_tone",
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputs": 2,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "debug",
"propertyType": "msg",
"value": "EBR Beep Fixed",
"valueType": "str"
}
],
"x": 780,
"y": 1780,
"wires": [
[
"eee837a3c93b3abd",
"057eda6b0cd976d9"
],
[]
]
},
{
"id": "1fc55a133a7d82c4",
"type": "debug",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "MBR Beep",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "debug",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 640,
"wires": []
},
{
"id": "057eda6b0cd976d9",
"type": "debug",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "EBR Beep",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "debug",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 970,
"y": 1840,
"wires": []
},
{
"id": "6f9810d3986b67d9",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Day Temp",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_number.emma_bedroom_daytime_temp"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "daytemp",
"valueType": "str"
}
],
"x": 200,
"y": 1900,
"wires": [
[
"88037340df0708d0"
]
]
},
{
"id": "15e2eb94a67c7024",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Night Temp",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_number.emma_bedroom_night_temp"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "nighttemp",
"valueType": "str"
}
],
"x": 210,
"y": 1960,
"wires": [
[
"88037340df0708d0"
]
]
},
{
"id": "77082c90f1eb9c32",
"type": "server-state-changed",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Bedtime Temp",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_number.emma_bedroom_bedtime_temp"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "bedtemp",
"valueType": "str"
}
],
"x": 210,
"y": 2020,
"wires": [
[
"88037340df0708d0"
]
]
},
{
"id": "88037340df0708d0",
"type": "function",
"z": "72f99805df043603",
"g": "5802ea32c1de36e8",
"name": "Set Temp Vars",
"func": "const topic = msg.topic\nconst payload = msg.payload\nconst lastMode = flow.get('emmaBedroom.lastMode', 'diskCon')\n\nif (topic === 'daytemp') {\n flow.set('emmaBedroom.dayTemp', payload, 'diskCon')\n} else if (topic === 'nighttemp') {\n flow.set(\"emmaBedroom.nightTemp\", payload, \"diskCon\")\n} else if (topic === 'bedtemp') {\n flow.set(\"emmaBedroom.bedTemp\", payload, \"diskCon\")\n}\n\nif (lastMode === 'day') {\n flow.set('emmaBedroom.airconTargetTemp', flow.get('emmaBedroom.dayTemp', 'diskCon'), 'diskCon')\n} else if (lastMode === 'night') {\n flow.set('emmaBedroom.airconTargetTemp', flow.get('emmaBedroom.nightTemp', 'diskCon'), 'diskCon')\n} else if (lastMode === 'bedtime') {\n flow.set('emmaBedroom.airconTargetTemp', flow.get('emmaBedroom.bedTemp', 'diskCon'), 'diskCon')\n}\n\nnode.status({fill:'green',shape:'dot',text:`Set ${topic} to ${payload}`})",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 1960,
"wires": [
[]
]
},
{
"id": "48b8af9419ed18d6",
"type": "subflow:384eaf2f63dcb5db",
"z": "b7d34d3e9d0c9486",
"name": "",
"x": 355,
"y": 420,
"wires": [
[
"54a88968618ed545"
]
],
"l": false
},
{
"id": "54a88968618ed545",
"type": "function",
"z": "b7d34d3e9d0c9486",
"name": "Processing",
"func": "// Set Constants\nconst states = global.get('homeassistant.homeAssistant.states')\nconst textAllowed = states['input_boolean.laundry_notifications_text'].state\nconst ttsAllowed = states['input_boolean.laundry_notifications_tts'].state\nconst washerCycle = flow.get(\"washerCycle\", \"diskCon\")\nconst washerFinished = flow.get(\"washerFinished\", \"diskCon\")\nconst washerTimer = flow.get(\"washerTimer\", \"diskCon\")\nconst washerDateTime = flow.get(\"washerDateTime\", \"diskCon\")\nconst dryerCycle = flow.get(\"dryerCycle\", \"diskCon\")\nconst dryerFinished = flow.get(\"dryerFinished\", \"diskCon\")\nconst dryerTimer = flow.get(\"dryerTimer\", \"diskCon\")\nconst dryerDateTime = flow.get(\"dryerDateTime\", \"diskCon\")\nconst topic = msg.topic\nconst payload = msg.payload\n\n// Init variables\nlet timerEntity = []\nlet boolFinished = []\nlet servFinished = {}\nlet dateTimeEntity = []\nlet servTimer = {}\nlet setCycle = []\nlet dateTime = []\nlet deviceName = {}\nlet notifyMsg = {}\nlet ttsMsg = {}\n\n// Set entity IDs and states\nif (topic === 'washer') {\n setCycle = washerCycle\n boolFinished = washerFinished\n dateTimeEntity = washerDateTime\n timerEntity = washerTimer\n deviceName = 'washer'\n} else if (topic === 'dryer') {\n setCycle = dryerCycle\n boolFinished = dryerFinished\n dateTimeEntity = dryerDateTime\n timerEntity = dryerTimer\n deviceName = 'dryer'\n}\n\n// Get states from the entities\n// @ts-ignore\nlet cycle = states[setCycle].state\n// @ts-ignore\nlet timerState = states[timerEntity].state\n// @ts-ignore\nlet finishedState = states[boolFinished].state\n\n// Convert minutes into seconds for the timer\nlet timerDuration = cycle * 60\nlet notifyDuration = Math.round(cycle)\n\n// Decide services\nif (payload === 'start') {\n servFinished = 'turn_off'\n notifyMsg = 'The ' + deviceName + ' has been started for a ' + notifyDuration + ' minute cycle'\n} else if (payload === 'finish') {\n dateTime = msg.datetime\n servFinished = 'turn_on'\n notifyMsg = 'The ' + deviceName + ' has finished its cycle'\n ttsMsg = 'The ' + deviceName + ' has finished its cycle. I repeat, the ' + deviceName + ' has finished its cycle.'\n} else if (payload === 'cancel') {\n notifyMsg = 'The ' + deviceName + ' cycle has been cancelled'\n}\n\n// Prepare message payloads\nlet sendTimerStart = {\n \"payload\": {\n \"action\": \"timer.start\",\n \"target\": {\n \"entity_id\": timerEntity\n },\n \"data\": {\n \"duration\": timerDuration\n }\n }\n}\n\nlet sendTimerCancel = {\n \"payload\": {\n \"action\": \"timer.cancel\",\n \"target\": {\n \"entity_id\": timerEntity\n },\n \"data\": {}\n }\n}\n\nlet sendBoolFinished = {\n \"payload\": {\n \"action\": \"input_boolean.\" + servFinished,\n \"target\": {\n \"entity_id\": boolFinished\n },\n \"data\": {}\n }\n}\n\nlet sendDateTimeFinished = {\n \"payload\": {\n \"action\": \"input_datetime.set_datetime\",\n \"target\": {\n \"entity_id\": dateTimeEntity\n },\n \"data\": {\n \"datetime\": dateTime\n }\n }\n}\n\nlet sendTextNotify = {\n \"payload\": {\n \"data\": {\n \"type\": \"normal\",\n \"who\": \"all\",\n \"title\": \"Laundry Tracking\",\n \"message\": notifyMsg\n }\n }\n}\n\nlet sendTTSNotify = {\n \"payload\": ttsMsg,\n \"type\": \"alert\",\n \"topic\": \"everywhere\"\n}\n\nif (payload === 'start') {\n node.send([sendBoolFinished,sendTimerStart,null,null])\n node.status({fill:\"green\",shape:\"dot\",text:\"Starting \" + deviceName + \" timer for \" + notifyDuration + \" minutes\"})\n node.log(\"Starting \" + deviceName + \" timer for \" + notifyDuration + \" minutes\")\n} else if (payload === 'finish') {\n node.send([[sendBoolFinished,sendDateTimeFinished],null,null])\n if (ttsAllowed === 'on') {\n node.send([null,null,null,sendTTSNotify])\n }\n node.status({fill:\"green\",shape:\"dot\",text:\"The \" + deviceName + \" has finished\"})\n node.log(\"The \" + deviceName + \" has finished\")\n} else if (payload === 'cancel') {\n node.send([null,sendTimerCancel,null,null])\n node.status({fill:\"red\",shape:\"ring\",text:\"The \" + deviceName + \" has been cancelled\"})\n node.log(\"The \" + deviceName + \" has been cancelled\")\n}\n\nif (textAllowed === 'on') {\n node.send([null,null,sendTextNotify,null])\n}",
"outputs": 4,
"timeout": 0,
"noerr": 0,
"initialize": "const washerCycle = 'input_number.washer_cycle_length'\nconst washerFinished = 'input_boolean.washer_finished'\nconst washerTimer = 'timer.washer_timer'\nconst washerDateTime = 'input_datetime.washer_finished'\nconst dryerCycle = 'input_number.dryer_cycle_length'\nconst dryerFinished = 'input_boolean.dryer_finished'\nconst dryerTimer = 'timer.dryer_timer'\nconst dryerDateTime = 'input_datetime.dryer_finished'\n\nflow.set(\"washerCycle\", washerCycle, \"diskCon\")\nflow.set(\"washerFinished\", washerFinished, \"diskCon\")\nflow.set(\"washerTimer\", washerTimer, \"diskCon\")\nflow.set(\"washerDateTime\", washerDateTime, \"diskCon\")\nflow.set(\"dryerCycle\", dryerCycle, \"diskCon\")\nflow.set(\"dryerFinished\", dryerFinished, \"diskCon\")\nflow.set(\"dryerTimer\", dryerTimer, \"diskCon\")\nflow.set(\"dryerDateTime\", dryerDateTime, \"diskCon\")",
"finalize": "",
"libs": [],
"x": 470,
"y": 140,
"wires": [
[
"7f4ccf77cb54cbf4"
],
[
"3c238eb49495cdf7"
],
[
"2f59c100baa80e72"
],
[
"8528d2306933fd61"
]
],
"outputLabels": [
"Services",
"Timers",
"Notify",
"TTS"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "1c69c3f111ae9550",
"type": "ha-button",
"z": "b7d34d3e9d0c9486",
"name": "Washer Start",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "5627513f9469cbb8",
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "washer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "start",
"valueType": "str"
}
],
"x": 190,
"y": 140,
"wires": [
[
"54a88968618ed545"
]
]
},
{
"id": "b45bbd2dbe71e041",
"type": "ha-button",
"z": "b7d34d3e9d0c9486",
"name": "Dryer Start",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "d2d7710df0394f16",
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dryer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "start",
"valueType": "str"
}
],
"x": 200,
"y": 200,
"wires": [
[
"54a88968618ed545"
]
]
},
{
"id": "e8999bcf95ae6e5e",
"type": "ha-button",
"z": "b7d34d3e9d0c9486",
"name": "Washer Cancel",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "52dccff6d2c39667",
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "washer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "cancel",
"valueType": "str"
}
],
"x": 180,
"y": 260,
"wires": [
[
"54a88968618ed545"
]
]
},
{
"id": "dffb38d3d2973f4b",
"type": "ha-button",
"z": "b7d34d3e9d0c9486",
"name": "Dryer Cancel",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "9da998d5f74df33c",
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dryer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "cancel",
"valueType": "str"
}
],
"x": 190,
"y": 320,
"wires": [
[
"54a88968618ed545"
]
]
},
{
"id": "d983ad1b9e54e1d5",
"type": "server-events",
"z": "b7d34d3e9d0c9486",
"name": "Washer Finish",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.washer_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "washer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "finish",
"valueType": "str"
}
],
"x": 190,
"y": 380,
"wires": [
[
"48b8af9419ed18d6"
]
]
},
{
"id": "74fd80d93138997a",
"type": "server-events",
"z": "b7d34d3e9d0c9486",
"name": "Dryer Finish",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "timer.finished",
"eventData": "{\"entity_id\":\"timer.dryer_timer\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "timestamp",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dryer",
"valueType": "str"
},
{
"property": "payload",
"propertyType": "msg",
"value": "finish",
"valueType": "str"
}
],
"x": 190,
"y": 440,
"wires": [
[
"48b8af9419ed18d6"
]
]
},
{
"id": "2f59c100baa80e72",
"type": "api-call-service",
"z": "b7d34d3e9d0c9486",
"name": "Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 670,
"y": 200,
"wires": [
[]
]
},
{
"id": "7f4ccf77cb54cbf4",
"type": "api-call-service",
"z": "b7d34d3e9d0c9486",
"name": "Services",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 680,
"y": 80,
"wires": [
[]
]
},
{
"id": "3c238eb49495cdf7",
"type": "api-call-service",
"z": "b7d34d3e9d0c9486",
"name": "Timers",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 670,
"y": 140,
"wires": [
[]
]
},
{
"id": "660deb40ab25fd53",
"type": "server-state-changed",
"z": "b7d34d3e9d0c9486",
"name": "Cycle Length Change",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_number.washer_cycle_length",
"input_number.dryer_cycle_length"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
}
],
"x": 220,
"y": 520,
"wires": [
[
"d5975ad76923cefc"
]
]
},
{
"id": "d5975ad76923cefc",
"type": "function",
"z": "b7d34d3e9d0c9486",
"name": "Timer Math",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst oldState = msg.data.old_state.state\nconst newState = msg.data.new_state.state\nconst entity_id = msg.data.entity_id\nconst washerCycle = flow.get(\"washerCycle\", \"diskCon\")\nconst dryerCycle = flow.get(\"dryerCycle\", \"diskCon\")\n\nconst subtract = newState - oldState\nconst multiply = subtract * 60\nconst diff = parseInt(multiply)\n\nlet machine = {}\nlet timer = {}\n\nif (entity_id === washerCycle) {\n machine = 'washer'\n} else if (entity_id === dryerCycle) {\n machine = 'dryer'\n}\n\nif (machine === 'washer') {\n timer = flow.get(\"washerTimer\", \"diskCon\")\n} else if (machine === 'dryer') {\n timer = flow.get(\"dryerTimer\", \"diskCon\")\n}\n\n// @ts-ignore\nlet running = states[timer].state\n\nlet changeMsg = {\n \"timer\": timer,\n \"change\": diff\n}\n\nif (running === 'active') {\n node.send(changeMsg)\n node.status({fill:\"green\",shape:\"dot\",text:\"Timer Changed\"})\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"})\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 430,
"y": 520,
"wires": [
[
"9c7f26df3d21c2aa"
]
]
},
{
"id": "9c7f26df3d21c2aa",
"type": "api-call-service",
"z": "b7d34d3e9d0c9486",
"name": "Timer Change",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.timer_modify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"timer\": timer,\t \"change\": change\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "timer_modify",
"x": 620,
"y": 520,
"wires": [
[]
]
},
{
"id": "8528d2306933fd61",
"type": "subflow:6429099c4571dd6b",
"z": "b7d34d3e9d0c9486",
"name": "",
"x": 700,
"y": 260,
"wires": [
[]
]
},
{
"id": "51aca04a0b99e722",
"type": "api-call-service",
"z": "b7d34d3e9d0c9486",
"name": "",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.basement_lights_alert",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "basement_lights_alert",
"x": 780,
"y": 420,
"wires": [
[]
]
},
{
"id": "85f64d70ea1ad38b",
"type": "server-state-changed",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Battery Low",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_doorbell_battery_plus_low"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
},
{
"property": "id",
"propertyType": "msg",
"value": "front_doorbell_battery_low",
"valueType": "str"
}
],
"x": 170,
"y": 140,
"wires": [
[
"977f5fdca9aaa918"
],
[
"eb4303c234c0f911"
]
]
},
{
"id": "3762233dfe00d338",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Reduce Snapshots",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"select.front_doorbell_snapshot_mode"
],
"labelId": [],
"data": "{\t \"option\":\"Interval + Ding\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "select",
"service": "select_option",
"x": 630,
"y": 100,
"wires": [
[
"0c394f2de9bd9917"
]
]
},
{
"id": "0c394f2de9bd9917",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Increase Interval",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.front_doorbell_snapshot_interval"
],
"labelId": [],
"data": "{\t \"value\": 600\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "number",
"service": "set_value",
"x": 840,
"y": 100,
"wires": [
[
"b36a4f453c2a06b2"
]
]
},
{
"id": "eb4303c234c0f911",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Increase Snapshots",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"select.front_doorbell_snapshot_mode"
],
"labelId": [],
"data": "{\t \"option\":\"All\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "select",
"service": "select_option",
"x": 420,
"y": 180,
"wires": [
[
"5173aa5c7adb827a"
]
]
},
{
"id": "5173aa5c7adb827a",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Reduce Interval",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.front_doorbell_snapshot_interval"
],
"labelId": [],
"data": "{\t \"value\": 300\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "number",
"service": "set_value",
"x": 620,
"y": 180,
"wires": [
[
"160249109f0b494a"
]
]
},
{
"id": "b36a4f453c2a06b2",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Persistent Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "persistent_notification.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"title\": title,\t \"message\": message,\t \"notification_id\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "persistent_notification",
"service": "create",
"x": 1060,
"y": 100,
"wires": [
[
"42a6971dbcdf2dd7"
]
]
},
{
"id": "977f5fdca9aaa918",
"type": "change",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Notification Setup",
"rules": [
{
"t": "set",
"p": "title",
"pt": "msg",
"to": "Front Doorbell Battery Low",
"tot": "str"
},
{
"t": "set",
"p": "message",
"pt": "msg",
"to": "The battery in the front doorbell has reached 25% or less. Activating power saving mode. We will reduce snapshots taken until the battery has a chance to charge.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 410,
"y": 100,
"wires": [
[
"3762233dfe00d338"
]
]
},
{
"id": "42a6971dbcdf2dd7",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": \"normal\",\t \"who\": \"parents\",\t \"title\": title,\t \"message\": message,\t \"tag\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "script",
"service": "text_notify",
"x": 1270,
"y": 100,
"wires": [
[]
]
},
{
"id": "160249109f0b494a",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Persistent Notification Clear",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "persistent_notification.dismiss",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"notification_id\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "persistent_notification",
"service": "dismiss",
"x": 860,
"y": 180,
"wires": [
[
"090187e752453a53"
]
]
},
{
"id": "090187e752453a53",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Text Notify Clear",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": \"alert\",\t \"who\": \"parents\",\t \"message\": \"clear_notification\",\t \"tag\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "script",
"service": "text_notify",
"x": 1100,
"y": 180,
"wires": [
[]
]
},
{
"id": "9256f78107619596",
"type": "ha-time",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Alarm Time",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "",
"entityId": "input_datetime.master_bedroom_alarm_clock",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "time",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "alarm",
"propertyType": "msg",
"value": "triggered",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 170,
"y": 80,
"wires": [
[
"fbd0b0d52ef452d5"
]
]
},
{
"id": "fbd0b0d52ef452d5",
"type": "function",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.master_bedroom_alarm_clock'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst goodnight = states['input_boolean.goodnight'].state\n\nmsg.topic = \"master_bedroom\"\nmsg.payload = \"This is your alarm clock speaking, it is time to wake up!\"\nmsg.type = \"alert\"\n\nif (enabled === 'on' && sleeping === 'on' && goodnight === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Not Sleeping\"})\n return null\n} else if (goodnight === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Goodnight On\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 80,
"wires": [
[
"1f44e8f6e98317a7"
]
]
},
{
"id": "1f44e8f6e98317a7",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Turn off sleep mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.master_bedroom_sleeping"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 560,
"y": 80,
"wires": [
[
"efec6f0b8a4ea382"
]
]
},
{
"id": "efec6f0b8a4ea382",
"type": "stoptimer",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"duration": "5",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 840,
"y": 80,
"wires": [
[
"216ebd5138f63087",
"e82fb1576245b7c7"
],
[]
]
},
{
"id": "cfcebd8452629535",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.master_bedroom_lights"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
},
{
"property": "stop-reason",
"propertyType": "msg",
"value": "lights",
"valueType": "str"
}
],
"x": 360,
"y": 140,
"wires": [
[
"67e6798433b7bc37"
],
[]
]
},
{
"id": "0bfb330d42161fe7",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Bathroom Motion",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.upstairs_bathroom_motion"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
},
{
"property": "stop-reason",
"propertyType": "msg",
"value": "bathroom",
"valueType": "str"
}
],
"x": 340,
"y": 200,
"wires": [
[
"67e6798433b7bc37"
],
[]
]
},
{
"id": "216ebd5138f63087",
"type": "subflow:6429099c4571dd6b",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "",
"x": 1100,
"y": 80,
"wires": [
[]
]
},
{
"id": "e82fb1576245b7c7",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Disable",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.master_bedroom_alarm_clock"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 1080,
"y": 140,
"wires": [
[]
]
},
{
"id": "5f4a234984a654e1",
"type": "ha-time",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Alarm Time",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "",
"entityId": "input_datetime.kallen_alarm_clock",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "time",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "alarm",
"propertyType": "msg",
"value": "triggered",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 170,
"y": 380,
"wires": [
[
"9ad1aee4f432c0da"
]
]
},
{
"id": "9ad1aee4f432c0da",
"type": "function",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.kallen_alarm_clock'].state\nconst sleeping = states['input_boolean.kallen_sleeping'].state\nconst goodnight = states['input_boolean.goodnight'].state\n\nmsg.topic = \"kallen_bedroom\"\nmsg.payload = \"This is your alarm clock speaking, it is time to wake up!\"\nmsg.type = \"alert\"\n\nif (enabled === 'on' && sleeping === 'on' && goodnight === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Not Sleeping\"})\n return null\n} else if (goodnight === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Goodnight On\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 380,
"wires": [
[
"33f1bded52754848"
]
]
},
{
"id": "33f1bded52754848",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Turn off sleep mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.kallen_sleeping"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 560,
"y": 380,
"wires": [
[
"72052e61710200f9"
]
]
},
{
"id": "72052e61710200f9",
"type": "stoptimer",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"duration": "5",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 840,
"y": 380,
"wires": [
[
"067bcc91d6a04be5",
"7f3909f76041b209"
],
[]
]
},
{
"id": "9c2ea97d481e6428",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.kallen_bedroom_lights"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"x": 360,
"y": 440,
"wires": [
[
"724f186878227dad"
],
[]
]
},
{
"id": "56140b60b6406bd7",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Lights Adaptive",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.kallen_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "Adaptive",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"x": 340,
"y": 500,
"wires": [
[
"724f186878227dad"
],
[]
]
},
{
"id": "067bcc91d6a04be5",
"type": "subflow:6429099c4571dd6b",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "",
"x": 1100,
"y": 380,
"wires": [
[]
]
},
{
"id": "7f3909f76041b209",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Disable",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.kallen_alarm_clock"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 1080,
"y": 440,
"wires": [
[]
]
},
{
"id": "724f186878227dad",
"type": "function",
"z": "458e4c0055c8c533",
"g": "a6de35af12739885",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.kallen_alarm_clock'].state\nconst sleeping = states['input_boolean.kallen_sleeping'].state\n\nif (enabled === 'on' && sleeping === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'on') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Sleeping\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 440,
"wires": [
[
"7f3909f76041b209",
"72052e61710200f9"
]
]
},
{
"id": "67e6798433b7bc37",
"type": "function",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.master_bedroom_alarm_clock'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\n\nif (enabled === 'on' && sleeping === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'on') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Sleeping\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 140,
"wires": [
[
"e82fb1576245b7c7",
"efec6f0b8a4ea382"
]
]
},
{
"id": "99c141f21de4feda",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "88f099618e56926d",
"name": "Lights Adaptive",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.master_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "Adaptive",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
},
{
"property": "stop-reason",
"propertyType": "msg",
"value": "adaptive",
"valueType": "str"
}
],
"x": 340,
"y": 260,
"wires": [
[
"67e6798433b7bc37"
],
[]
]
},
{
"id": "eff279edcac37798",
"type": "ha-time",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Alarm Time",
"server": "9e87348d.9c1c48",
"version": 4,
"exposeAsEntityConfig": "",
"entityId": "input_datetime.emma_alarm_clock",
"property": "",
"offset": "0",
"offsetType": "num",
"offsetUnits": "minutes",
"randomOffset": false,
"repeatDaily": true,
"outputProperties": [
{
"property": "time",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "alarm",
"propertyType": "msg",
"value": "triggered",
"valueType": "str"
}
],
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"ignorePastDate": false,
"x": 170,
"y": 620,
"wires": [
[
"adcce6ca1e459cd1"
]
]
},
{
"id": "adcce6ca1e459cd1",
"type": "function",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.emma_alarm_clock'].state\nconst sleeping = states['input_boolean.emma_sleeping'].state\nconst goodnight = states['input_boolean.goodnight'].state\n\nmsg.topic = \"emma_bedroom\"\nmsg.payload = \"This is your alarm clock speaking, it is time to wake up!\"\nmsg.type = \"alert\"\n\nif (enabled === 'on' && sleeping === 'on' && goodnight === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Not Sleeping\"})\n return null\n} else if (goodnight === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Goodnight On\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 620,
"wires": [
[
"49a842a41a52f8f3"
]
]
},
{
"id": "49a842a41a52f8f3",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Turn off sleep mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.emma_sleeping"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 560,
"y": 620,
"wires": [
[
"e036fd18c5d20645"
]
]
},
{
"id": "e036fd18c5d20645",
"type": "stoptimer",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"duration": "5",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 840,
"y": 620,
"wires": [
[
"53f8d279114dd476"
],
[]
]
},
{
"id": "9621d4c881da0188",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.emma_bedroom_light"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "off",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"x": 360,
"y": 680,
"wires": [
[
"4523045453de0a33"
],
[]
]
},
{
"id": "a5a387d3522f49ed",
"type": "server-state-changed",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Lights Adaptive",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.emma_bedroom_scenes"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "Adaptive",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "stop",
"valueType": "str"
}
],
"x": 340,
"y": 740,
"wires": [
[
"4523045453de0a33"
],
[]
]
},
{
"id": "53f8d279114dd476",
"type": "api-call-service",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Disable",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.emma_alarm_clock"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 1080,
"y": 680,
"wires": [
[]
]
},
{
"id": "4523045453de0a33",
"type": "function",
"z": "458e4c0055c8c533",
"g": "0804d9edeca1c9fa",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst enabled = states['input_boolean.emma_alarm_clock'].state\nconst sleeping = states['input_boolean.emma_sleeping'].state\n\nif (enabled === 'on' && sleeping === 'off') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Proceed\"})\n return msg\n} else if (enabled === 'off') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Disabled\"})\n return null\n} else if (sleeping === 'on') {\n node.status({fill:\"red\",shape:\"ring\",text:\"Sleeping\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Unknown Error\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 680,
"wires": [
[
"53f8d279114dd476",
"e036fd18c5d20645"
]
]
},
{
"id": "ba97906b7b81342c",
"type": "ha-button",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Goodnight",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "30f1658baee9378e",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mrbedroom-bedtime",
"valueType": "str"
},
{
"property": "time",
"propertyType": "msg",
"value": "bedtime",
"valueType": "str"
},
{
"property": "type",
"propertyType": "msg",
"value": "auto",
"valueType": "str"
}
],
"x": 140,
"y": 340,
"wires": [
[
"775777f1c01e424c"
]
]
},
{
"id": "d9e39b8ebb86c941",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Kallen Desktop - Shutdown",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_desktop_shutdown",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_desktop_shutdown",
"x": 1000,
"y": 400,
"wires": [
[]
]
},
{
"id": "09c7a61f7a4c4d05",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Check Security",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "disarmed",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "alarm_control_panel.nerdhome_alarm_panel",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 680,
"y": 340,
"wires": [
[
"280e2a7895ca63fb"
],
[]
]
},
{
"id": "280e2a7895ca63fb",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Arm Security",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "alarm_control_panel.alarm_arm_home",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"alarm_control_panel.nerdhome_alarm_panel"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "alarm_control_panel",
"service": "alarm_arm_home",
"x": 890,
"y": 340,
"wires": [
[]
]
},
{
"id": "60ce44747cf3e507",
"type": "link out",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Goodnight Output",
"mode": "link",
"links": [
"55e84ccb73ae9b74",
"bc592ba259667f9d"
],
"x": 615,
"y": 280,
"wires": []
},
{
"id": "50e351d1ee6108b3",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Kallen Computer Updates?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_computer_updates",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 720,
"y": 400,
"wires": [
[
"d9e39b8ebb86c941"
],
[]
],
"outputLabels": [
"Off",
"On"
]
},
{
"id": "33773b3aaa551b79",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "MB Sleep Switch",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.master_bedroom_sleeping"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 410,
"y": 340,
"wires": [
[
"09c7a61f7a4c4d05",
"60ce44747cf3e507",
"50e351d1ee6108b3",
"f30486c8e11db0e4",
"334c28e08be1db12"
]
]
},
{
"id": "f30486c8e11db0e4",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Do Not Disturb",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.basement_echo_dot_do_not_disturb_switch",
"switch.living_room_echo_dot_do_not_disturb_switch",
"switch.master_bedroom_echo_dot_do_not_disturb_switch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_on",
"x": 680,
"y": 460,
"wires": [
[
"20b3699a56b0e901"
]
]
},
{
"id": "9bd4665845af0545",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Goodnight Scripts",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "turn_on",
"x": 890,
"y": 520,
"wires": [
[]
]
},
{
"id": "20b3699a56b0e901",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Turn off Quiet/Gaming Modes",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.gaming_mode",
"input_boolean.studio_quiet"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 930,
"y": 460,
"wires": [
[]
]
},
{
"id": "f3df71ec460b7609",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Goodnight Switch",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.goodnight",
"input_boolean.night_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 410,
"y": 400,
"wires": [
[]
]
},
{
"id": "775777f1c01e424c",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Early Night Mode",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.early_night_mode",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "earlynight",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 255,
"y": 340,
"wires": [
[
"f3df71ec460b7609",
"33773b3aaa551b79"
],
[
"33773b3aaa551b79"
]
],
"outputLabels": [
"On",
"Off"
],
"l": false
},
{
"id": "334c28e08be1db12",
"type": "function",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Choose Floors",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst schoolToday = states['input_boolean.kallen_school_today'].state\nconst kallen = states['person.kallen_stork'].state\nconst morning = states['binary_sensor.morning'].state\n\nlet basement = {\n \"payload\": {\n \"action\": \"script.goodnight_in_basement\"\n }\n}\n\nlet firstFloor = {\n \"payload\": {\n \"action\": \"script.goodnight_on_first_floor\"\n }\n}\n\nlet secondFloor = {\n \"payload\": {\n \"action\": \"script.goodnight_on_second_floor\"\n }\n}\n\nif (schoolToday === 'on' && kallen === 'home' && morning === 'on') {\n node.send([[basement,secondFloor]])\n node.status({fill:'yellow',shape:'dot',text:'Kallen waiting for school bus'})\n} else {\n node.send([[basement,firstFloor,secondFloor]])\n node.status({fill:'green',shape:'dot',text:'All scripts sent'})\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 520,
"wires": [
[
"9bd4665845af0545"
]
]
},
{
"id": "de09ef54cbab864a",
"type": "link in",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Kallen Presence to Goodnight Flow",
"links": [
"547753c8de135e69"
],
"x": 145,
"y": 460,
"wires": [
[
"5c919106ebd7c9d4"
]
]
},
{
"id": "5c919106ebd7c9d4",
"type": "function",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "Filter",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst schoolToday = states['input_boolean.kallen_school_today'].state\nconst kallen = states['person.kallen_stork'].state\nconst morning = states['binary_sensor.morning'].state\nconst masterBedroomSleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst payload = msg.payload\n\nlet presence = {}\n\nif (payload === 'home') {\n presence = 'on'\n} else if (payload != 'unavailable' && payload != 'unknown') {\n presence = 'off'\n}\n\nif (schoolToday === 'on' && kallen != 'home' && morning === 'on') {\n if (presence === 'off' && masterBedroomSleeping === 'on') {\n node.send(msg)\n node.status({fill:'green',shape:'dot',text:'Kallen left, first floor lights off'})\n } else {\n return null\n }\n} else {\n return null\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 215,
"y": 460,
"wires": [
[
"75072695f27adae7"
]
],
"l": false
},
{
"id": "75072695f27adae7",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "f4057835848d0904",
"name": "First Floor Lights Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.goodnight_on_first_floor",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "goodnight_on_first_floor",
"x": 360,
"y": 460,
"wires": [
[]
]
},
{
"id": "105271e0816c6a52",
"type": "ha-button",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Good Morning",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "ad5b1d9f1ea8fea1",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "mrbedroom-wakeup",
"valueType": "str"
}
],
"x": 150,
"y": 60,
"wires": [
[
"c18d27a9438bfa08",
"ef0efdc23805d872",
"bad6373b442c58a1"
]
]
},
{
"id": "2854170262757e84",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Turn off switches",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.basement_echo_dot_do_not_disturb_switch",
"switch.living_room_echo_dot_do_not_disturb_switch",
"switch.master_bedroom_echo_dot_do_not_disturb_switch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 550,
"y": 60,
"wires": [
[
"5c9c73b7adb72896",
"3778a9f4cb80ce0b"
]
]
},
{
"id": "5c9c73b7adb72896",
"type": "link out",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Good Morning Output",
"mode": "link",
"links": [
"bc592ba259667f9d"
],
"x": 715,
"y": 60,
"wires": []
},
{
"id": "c18d27a9438bfa08",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Morning Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.morning_scene",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "morning_scene",
"x": 360,
"y": 60,
"wires": [
[
"2854170262757e84"
]
]
},
{
"id": "ef0efdc23805d872",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Morning?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.morning",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "time",
"propertyType": "msg",
"value": "morning",
"valueType": "str"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 340,
"y": 120,
"wires": [
[
"54b8bca62d27e659"
],
[]
],
"outputLabels": [
"on",
"off"
]
},
{
"id": "bad6373b442c58a1",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Late Morning?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.late_morning",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "time",
"propertyType": "msg",
"value": "late-morning",
"valueType": "str"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 360,
"y": 180,
"wires": [
[
"54b8bca62d27e659"
],
[]
],
"outputLabels": [
"on",
"off"
]
},
{
"id": "54b8bca62d27e659",
"type": "api-current-state",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Security State",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "armed_home",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "alarm_control_panel.nerdhome_alarm_panel",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "security",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 580,
"y": 180,
"wires": [
[
"bb77b36dd4d9cc96"
],
[]
],
"outputLabels": [
"armed_home",
"else"
]
},
{
"id": "708843ea29ee6626",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Disarm Security",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "alarm_control_panel.alarm_disarm",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"alarm_control_panel.nerdhome_alarm_panel"
],
"labelId": [],
"data": "{\t \"silent\": 1\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "alarm_control_panel",
"service": "alarm_disarm",
"x": 1020,
"y": 180,
"wires": [
[]
]
},
{
"id": "bb77b36dd4d9cc96",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "Disable Automations",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "automation.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"automation.scheduled_alarm_disarm",
"automation.scheduled_alarm_rearm"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "automation",
"service": "turn_off",
"x": 800,
"y": 180,
"wires": [
[
"708843ea29ee6626"
]
]
},
{
"id": "2fb85204eb56f86b",
"type": "api-call-service",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "TTS Briefing",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.morning_briefing",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"alexa_everywhere\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "morning_briefing",
"x": 830,
"y": 120,
"wires": [
[]
]
},
{
"id": "3778a9f4cb80ce0b",
"type": "delay",
"z": "9824adcf61e30734",
"g": "7d1c0a1099be4427",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 715,
"y": 120,
"wires": [
[
"2fb85204eb56f86b"
]
],
"l": false
},
{
"id": "6f84caa4bd59a747",
"type": "ha-button",
"z": "5c4ac37140a54ac9",
"name": "Weather Briefing",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "a8da4d03a2922c42",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 1200,
"y": 40,
"wires": [
[
"fa09d8a69bcbfbb5"
]
]
},
{
"id": "a58bc61a625f47af",
"type": "ha-button",
"z": "5c4ac37140a54ac9",
"name": "Daily Briefing",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "998d8d67ec377dd3",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 1190,
"y": 100,
"wires": [
[
"1d121bd0f1f5d628"
]
]
},
{
"id": "5eb7493d13b65a60",
"type": "debug",
"z": "5c4ac37140a54ac9",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1570,
"y": 100,
"wires": []
},
{
"id": "804c40c435c342fc",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"name": "Script",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.daily_briefing",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": msg.who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "daily_briefing",
"x": 1430,
"y": 100,
"wires": [
[
"5eb7493d13b65a60"
]
]
},
{
"id": "28a99bbb21540cbc",
"type": "debug",
"z": "5c4ac37140a54ac9",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1590,
"y": 40,
"wires": []
},
{
"id": "3363b9392f425a55",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"name": "Script",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.weather_briefing",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": msg.who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "weather_briefing",
"x": 1450,
"y": 40,
"wires": [
[
"28a99bbb21540cbc"
]
]
},
{
"id": "fa09d8a69bcbfbb5",
"type": "subflow:05a2d9f89e72481f",
"z": "5c4ac37140a54ac9",
"name": "",
"x": 1335,
"y": 40,
"wires": [
[
"3363b9392f425a55"
]
],
"l": false
},
{
"id": "1d121bd0f1f5d628",
"type": "subflow:05a2d9f89e72481f",
"z": "5c4ac37140a54ac9",
"name": "",
"x": 1315,
"y": 100,
"wires": [
[
"804c40c435c342fc"
]
],
"l": false
},
{
"id": "fe338e85c7419657",
"type": "ha-button",
"z": "5c4ac37140a54ac9",
"name": "Kallen School Status",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "d9da4bd707013bc5",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 1210,
"y": 160,
"wires": [
[
"ed96b2ce33128205"
]
]
},
{
"id": "ed96b2ce33128205",
"type": "subflow:05a2d9f89e72481f",
"z": "5c4ac37140a54ac9",
"name": "",
"x": 1355,
"y": 160,
"wires": [
[
"08eafe762d6146ee"
]
],
"l": false
},
{
"id": "08eafe762d6146ee",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"name": "Script",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_school_status",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": msg.who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_school_status",
"x": 1470,
"y": 160,
"wires": [
[
"e39da18ec3ecc852"
]
]
},
{
"id": "e39da18ec3ecc852",
"type": "debug",
"z": "5c4ac37140a54ac9",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1610,
"y": 160,
"wires": []
},
{
"id": "8c4d01db6f6ef33e",
"type": "ha-button",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Kallen Activities",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "503ba5fd53d97d51",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 160,
"y": 520,
"wires": [
[
"88c56b0964f9a6db"
]
]
},
{
"id": "20ede2b52515bc63",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Ask Activity",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.activate_alexa_actionable_notification",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"text\":\"<voice name='Joanna'>What activity are we timing?</voice>\",\t \"event_id\":\"actionable_notification_kallen_timer_activity\",\t \"alexa_device\": who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "activate_alexa_actionable_notification",
"x": 970,
"y": 520,
"wires": [
[
"38e168a79848fa19"
]
]
},
{
"id": "88c56b0964f9a6db",
"type": "subflow:b88bb63bb13eeb27",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "",
"x": 315,
"y": 520,
"wires": [
[
"7d53b4bd4c7ea874"
]
],
"l": false
},
{
"id": "38e168a79848fa19",
"type": "debug",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Activity",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 520,
"wires": []
},
{
"id": "86cd67e28114a585",
"type": "server-events",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Activity Response",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "alexa_actionable_notification",
"eventData": "{\"event_id\":\"actionable_notification_kallen_timer_activity\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"event_type": "",
"x": 170,
"y": 580,
"wires": [
[
"5926b0004a47dfd1"
]
]
},
{
"id": "5926b0004a47dfd1",
"type": "subflow:b88bb63bb13eeb27",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "",
"x": 315,
"y": 580,
"wires": [
[
"4726a2605a1f56cc"
]
],
"l": false
},
{
"id": "50982205a91e63c5",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Ask Duration",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.activate_alexa_actionable_notification",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"text\":\"<voice name='Joanna'>How long would you like the timer set for?</voice>\",\t \"event_id\":\"actionable_notification_kallen_timer_duration\",\t \"alexa_device\": who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "activate_alexa_actionable_notification",
"x": 970,
"y": 580,
"wires": [
[
"254ffc8e8bd1d414"
]
]
},
{
"id": "254ffc8e8bd1d414",
"type": "debug",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Duration",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 580,
"wires": []
},
{
"id": "c43b69d84deb44a4",
"type": "server-events",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Duration Response",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "alexa_actionable_notification",
"eventData": "{\"event_id\":\"actionable_notification_kallen_timer_duration\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"event_type": "",
"x": 170,
"y": 640,
"wires": [
[
"6167d4da61990bfb"
]
]
},
{
"id": "65589264d77f668d",
"type": "debug",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Location",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 640,
"wires": []
},
{
"id": "6167d4da61990bfb",
"type": "subflow:b88bb63bb13eeb27",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "",
"x": 315,
"y": 640,
"wires": [
[
"506e7e645cf06383"
]
],
"l": false
},
{
"id": "2aa8397f85a8ceed",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Set Activity",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_activities"
],
"labelId": [],
"data": "{\t \"option\": payload.event.event_response\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 730,
"y": 580,
"wires": [
[
"50982205a91e63c5"
]
]
},
{
"id": "9f1c60a822a2b550",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Set Duration",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_number.kallen_activity_duration"
],
"labelId": [],
"data": "{\t \"value\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_number",
"service": "set_value",
"x": 730,
"y": 640,
"wires": [
[
"dff1ff1e18a1bc74"
]
]
},
{
"id": "dff1ff1e18a1bc74",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Ask Location",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.activate_alexa_actionable_notification",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"text\":\"<voice name='Joanna'>Which room would you like the timer to run in?</voice>\",\t \"event_id\":\"actionable_notification_kallen_timer_location\",\t \"alexa_device\": who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "activate_alexa_actionable_notification",
"x": 970,
"y": 640,
"wires": [
[
"65589264d77f668d"
]
]
},
{
"id": "9e3c9006ff125d9b",
"type": "server-events",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Location Response",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "alexa_actionable_notification",
"eventData": "{\"event_id\":\"actionable_notification_kallen_timer_location\"}",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"event_type": "",
"x": 170,
"y": 700,
"wires": [
[
"716d4f60c2af0f2e"
]
]
},
{
"id": "efd47cbc26ed2810",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Set Location",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.kallen_activity_room"
],
"labelId": [],
"data": "{\t \"option\": payload.event.event_response\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 730,
"y": 700,
"wires": [
[
"c2212b77414c61f3"
]
]
},
{
"id": "75e1b9f265ecb4e5",
"type": "debug",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "End",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1130,
"y": 700,
"wires": []
},
{
"id": "c2212b77414c61f3",
"type": "delay",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 845,
"y": 700,
"wires": [
[
"1383f8e6ebf8ad88"
]
],
"l": false
},
{
"id": "1383f8e6ebf8ad88",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Start Timer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "button.press",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"button.kallen_timer_start"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "button",
"service": "press",
"x": 970,
"y": 700,
"wires": [
[
"75e1b9f265ecb4e5"
]
]
},
{
"id": "7d53b4bd4c7ea874",
"type": "function",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Filtering",
"func": "const who = msg.who\n\nif (who === 'media_player.master_bedroom_echo_dot') {\n msg.who = 'media_player.living_room_echo_dot'\n node.status({ fill: \"red\", shape: \"dot\", text: \"Rerouted\" });\n return msg;\n} else {\n msg.who = who\n node.status({ fill: \"green\", shape: \"dot\", text: \"Unchanged\" });\n return msg;\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 520,
"wires": [
[
"20ede2b52515bc63"
]
]
},
{
"id": "4726a2605a1f56cc",
"type": "function",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Filtering",
"func": "const who = msg.who\nconst responseType = msg.payload.event.event_response_type\n\nif (responseType != 'ResponseNone') {\n if (who === 'media_player.master_bedroom_echo_dot') {\n msg.who = 'media_player.living_room_echo_dot'\n node.status({fill:\"red\",shape:\"dot\",text:\"Rerouted\"});\n return msg;\n } else {\n msg.who = who\n node.status({fill:\"green\",shape:\"dot\",text:\"Unchanged\"});\n return msg;\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"No Response\"});\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 580,
"wires": [
[
"2aa8397f85a8ceed"
]
]
},
{
"id": "506e7e645cf06383",
"type": "function",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Filtering",
"func": "const who = msg.who\nconst responseType = msg.payload.event.event_response_type\n\nmsg.duration = (msg.payload.event.event_response / 60)\n\nif (responseType != 'ResponseNone') {\n if (who === 'media_player.master_bedroom_echo_dot') {\n msg.who = 'media_player.living_room_echo_dot'\n node.status({ fill: \"red\", shape: \"dot\", text: \"Rerouted, \" + msg.duration + \"m\" });\n return msg;\n } else {\n msg.who = who\n node.status({ fill: \"green\", shape: \"dot\", text: \"Unchanged, \" + msg.duration + \"m\" });\n return msg;\n }\n} else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"No Response\" });\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 640,
"wires": [
[
"9f1c60a822a2b550"
]
]
},
{
"id": "716d4f60c2af0f2e",
"type": "function",
"z": "5c4ac37140a54ac9",
"g": "553ecd620357c03d",
"name": "Filtering",
"func": "const responseType = msg.payload.event.event_response_type\n\nif (responseType === 'ResponseNone') {\n node.status({fill:\"red\",shape:\"ring\",text:\"No Response\"});\n return null\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Success\"});\n return msg;\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 700,
"wires": [
[
"efd47cbc26ed2810"
]
]
},
{
"id": "80761160776018a1",
"type": "ha-button",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Going Upstairs",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "8a6ada44f455b396",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "on",
"valueType": "str"
},
{
"property": "topic",
"propertyType": "msg",
"value": "going-upstairs",
"valueType": "str"
}
],
"x": 160,
"y": 60,
"wires": [
[]
]
},
{
"id": "c3b3c90a43c4481a",
"type": "link out",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Going Upstairs Output",
"mode": "link",
"links": [
"06b3f795ae9e14e6"
],
"x": 105,
"y": 280,
"wires": []
},
{
"id": "12ad9b1c6c0e05bd",
"type": "mqtt out",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "MQTT Night Mode",
"topic": "house/time/night_mode",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 430,
"y": 60,
"wires": []
},
{
"id": "28d9251be3529bfe",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Set Scenes",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.basement_studio_scenes",
"input_select.living_room_scenes",
"input_select.mud_room_scenes",
"input_select.tina_lamp_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Adaptive\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 410,
"y": 120,
"wires": [
[]
]
},
{
"id": "2b2b73eed26a4ac6",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Turn on night mode",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.night_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 430,
"y": 180,
"wires": [
[
"8d992470168b48db"
]
]
},
{
"id": "8d992470168b48db",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Turn off studio modes",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.gaming_mode",
"input_boolean.studio_quiet"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 660,
"y": 180,
"wires": [
[]
]
},
{
"id": "27862f1fd0313891",
"type": "api-current-state",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "If basement TV is not playing",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "playing",
"halt_if_type": "str",
"halt_if_compare": "is_not",
"entity_id": "media_player.basement_tv",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 355,
"y": 240,
"wires": [
[
"c7302971bce3d542"
],
[]
],
"outputLabels": [
"Not playing",
"Playing"
],
"icon": "font-awesome/fa-tv",
"l": false
},
{
"id": "c7302971bce3d542",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Turn off basement TV",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "remote.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"remote.basement_tv"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "remote",
"service": "turn_off",
"x": 500,
"y": 240,
"wires": [
[]
]
},
{
"id": "96cb27c48ddd3087",
"type": "api-current-state",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "If Kallen's computer is not updating",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.kallen_computer_updates",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 355,
"y": 300,
"wires": [
[
"adb36e61e39c7fa9"
],
[]
],
"outputLabels": [
"Not updating",
"Updating"
],
"icon": "font-awesome/fa-cloud-download",
"l": false
},
{
"id": "adb36e61e39c7fa9",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Shut down Kallen Desktop",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_desktop_shutdown",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_desktop_shutdown",
"x": 520,
"y": 300,
"wires": [
[]
]
},
{
"id": "8c4ddac65fd3b245",
"type": "subflow:b88bb63bb13eeb27",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "",
"x": 355,
"y": 360,
"wires": [
[
"56a4fbb75463258c"
]
],
"l": false
},
{
"id": "56a4fbb75463258c",
"type": "api-call-service",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Ask about shutting down main computer",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.activate_alexa_actionable_notification",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"text\": \"<voice name='Joanna'><prosody rate='150%'>Would you like me to shut down your computer?</prosody></voice>\",\t \"event_id\": \"actionable_notification_shutdown_computer\",\t \"alexa_device\": who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "activate_alexa_actionable_notification",
"x": 560,
"y": 360,
"wires": [
[
"881f3f534e5cc523",
"b077b050fad45521",
"b1f93c10edc4ff47"
]
]
},
{
"id": "881f3f534e5cc523",
"type": "ha-wait-until",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Basement Studio door open",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"binary_sensor.basement_studio_door"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "30",
"timeoutType": "num",
"timeoutUnits": "minutes",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [
{
"property": "reset",
"propertyType": "msg",
"value": "1",
"valueType": "num"
}
],
"entityLocation": "data",
"entityLocationType": "none",
"x": 880,
"y": 300,
"wires": [
[],
[]
]
},
{
"id": "b077b050fad45521",
"type": "ha-wait-until",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Goodnight turns on",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"input_boolean.goodnight"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "30",
"timeoutType": "num",
"timeoutUnits": "minutes",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [
{
"property": "reset",
"propertyType": "msg",
"value": "1",
"valueType": "num"
}
],
"entityLocation": "data",
"entityLocationType": "none",
"x": 850,
"y": 360,
"wires": [
[],
[]
]
},
{
"id": "b1f93c10edc4ff47",
"type": "ha-wait-until",
"z": "5c4ac37140a54ac9",
"g": "3e78b849c3a85b84",
"name": "Master bedroom lights on",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"entities": {
"entity": [
"light.master_bedroom_lights"
],
"substring": [],
"regex": []
},
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "30",
"timeoutType": "num",
"timeoutUnits": "minutes",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [
{
"property": "reset",
"propertyType": "msg",
"value": "1",
"valueType": "num"
}
],
"entityLocation": "data",
"entityLocationType": "none",
"x": 870,
"y": 420,
"wires": [
[],
[]
]
},
{
"id": "6a37c598ccfec0c7",
"type": "google-home",
"z": "75e98103856848a6",
"conf": "457914a2c9dc72c1",
"device": "20328",
"acknowledge": true,
"name": "",
"topic": "tester of testiness",
"x": 250,
"y": 240,
"wires": [
[
"ef99a4a89289098c"
]
]
},
{
"id": "ef99a4a89289098c",
"type": "debug",
"z": "75e98103856848a6",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 470,
"y": 240,
"wires": []
},
{
"id": "07a2f8b7e49040f8",
"type": "file in",
"z": "75e98103856848a6",
"name": "Read File",
"filename": "/config/files/weather_briefing_full.txt",
"filenameType": "str",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 480,
"y": 340,
"wires": [
[
"0249c367ffa0a6a1"
]
]
},
{
"id": "d8d284802d3ba380",
"type": "ha-button",
"z": "75e98103856848a6",
"name": "Weather Briefing Google",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "8860321096392e94",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "Kallen Bedroom",
"valueType": "str"
}
],
"x": 270,
"y": 340,
"wires": [
[
"07a2f8b7e49040f8"
]
]
},
{
"id": "0249c367ffa0a6a1",
"type": "subflow:6429099c4571dd6b",
"z": "75e98103856848a6",
"name": "",
"x": 660,
"y": 340,
"wires": [
[]
]
},
{
"id": "223a7234238933a7",
"type": "ha-button",
"z": "75e98103856848a6",
"name": "Daily Briefing Google",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "9c84afc610ced7b6",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "topic",
"propertyType": "msg",
"value": "Kallen Bedroom",
"valueType": "str"
}
],
"x": 260,
"y": 400,
"wires": [
[
"96905a317852d84e"
]
]
},
{
"id": "6059344e8c26ac8c",
"type": "ha-button",
"z": "75e98103856848a6",
"name": "Kallen School Status Google",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "2c222901ee192ba1",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
},
{
"property": "who",
"propertyType": "msg",
"value": "kallen_bedroom",
"valueType": "str"
}
],
"x": 280,
"y": 460,
"wires": [
[
"062135211ea05aee"
]
]
},
{
"id": "062135211ea05aee",
"type": "api-call-service",
"z": "75e98103856848a6",
"name": "Script",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_school_status",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_school_status",
"x": 490,
"y": 460,
"wires": [
[]
]
},
{
"id": "dc94d479f37be046",
"type": "api-call-service",
"z": "75e98103856848a6",
"name": "Speech Engine",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.speech_engine",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"kallen_bedroom\",\t \"message\": payload\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "speech_engine",
"x": 1200,
"y": 400,
"wires": [
[]
]
},
{
"id": "96905a317852d84e",
"type": "file in",
"z": "75e98103856848a6",
"name": "Read File",
"filename": "/config/templates/speech/daily_briefing.yaml",
"filenameType": "str",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 460,
"y": 400,
"wires": [
[
"293cc3018a39af5d"
]
]
},
{
"id": "293cc3018a39af5d",
"type": "change",
"z": "75e98103856848a6",
"name": "",
"rules": [
{
"t": "set",
"p": "template",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 400,
"wires": [
[
"0b5a8b6754e8ab37"
]
]
},
{
"id": "0b5a8b6754e8ab37",
"type": "api-render-template",
"z": "75e98103856848a6",
"name": "",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "",
"resultsLocation": "payload",
"resultsLocationType": "msg",
"templateLocation": "template",
"templateLocationType": "msg",
"x": 840,
"y": 400,
"wires": [
[
"c1e3cffdafae7507"
]
]
},
{
"id": "c1e3cffdafae7507",
"type": "function",
"z": "75e98103856848a6",
"name": "Formatting",
"func": "let str = msg.payload\nstr = str.replaceAll(\"<p>\", \" \")\nstr = str.replaceAll(\"</p>\", \" \")\nstr = str.replaceAll(\">\", \" \")\nstr = str.replaceAll(\"<s>\", \" \")\nstr = str.replaceAll(\"</s>\", \" \")\nstr = str.replaceAll(\"<s\", \" \")\nstr = str.replaceAll(\"</s\", \" \")\n\nmsg.payload = str\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1010,
"y": 400,
"wires": [
[
"dc94d479f37be046"
]
]
},
{
"id": "11f5f6e0f1e4da25",
"type": "server-state-changed",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Package Delivered",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.mail_amazon_packages_delivered"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "0",
"ifStateType": "str",
"ifStateOperator": "is_not",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "A package has been delivered by Amazon! I repeat, a package has been delivered by Amazon!",
"valueType": "str"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "common",
"valueType": "str"
}
],
"x": 170,
"y": 180,
"wires": [
[
"15fde8d3275b8455"
],
[]
]
},
{
"id": "3250ca66d8342dd8",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Save Light State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"amazon_package_delivered_restore\",\t \"snapshot_entities\":[\"light.basement_led_strip_1\",\"light.basement_tall_lamp\",\"light.basement_short_lamp\",\"light.basement_stairwell\",\"light.living_room_color_1\",\"light.living_room_color_2\",\"light.living_room_color_3\",\"light.tina_lamp_top\",\"light.tina_lamp_side\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 800,
"y": 140,
"wires": [
[
"02cd94391e205cd9"
]
]
},
{
"id": "6091f5e58812f97f",
"type": "api-current-state",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Studio Quiet?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.studio_quiet",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "studio-quiet",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 600,
"y": 180,
"wires": [
[
"3250ca66d8342dd8"
],
[
"32816b7834e1b318"
]
],
"outputLabels": [
"off",
"on"
]
},
{
"id": "32816b7834e1b318",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Save Light State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"amazon_package_delivered_restore\",\t \"snapshot_entities\":[\"light.living_room_color_1\",\"light.living_room_color_2\",\"light.living_room_color_3\",\"light.tina_lamp_top\",\"light.tina_lamp_side\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 800,
"y": 320,
"wires": [
[
"059eaa30829a743e"
]
]
},
{
"id": "02cd94391e205cd9",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Save Adaptive State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"amazon_package_delivered_adaptive_restore\",\t \"snapshot_entities\":[\"switch.adaptive_lighting_basement_studio\",\"switch.adaptive_lighting_living_room\",\"switch.adaptive_lighting_tina_lamp\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 1020,
"y": 140,
"wires": [
[
"1504548e7ebc3844",
"a71c61b06a3e7b0d",
"458ddfa9d748f88f"
]
]
},
{
"id": "059eaa30829a743e",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Save Adaptive State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"amazon_package_delivered_adaptive_restore\",\t \"snapshot_entities\":[\"switch.adaptive_lighting_living_room\",\"switch.adaptive_lighting_tina_lamp\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 1020,
"y": 320,
"wires": [
[
"d336afe957a65e33",
"37bdac2c9a4e2837"
]
]
},
{
"id": "a71c61b06a3e7b0d",
"type": "lifx-pulse-effect",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"api": "60eb53fb94cd64e4",
"selector": "group:Basement Studio",
"color": "blue",
"from_color": "",
"period": "0.5",
"cycles": "30",
"persist": "false",
"power_on": "true",
"x": 1250,
"y": 140,
"wires": []
},
{
"id": "1504548e7ebc3844",
"type": "delay",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"pauseType": "delay",
"timeout": "15",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1195,
"y": 80,
"wires": [
[
"ddbbde89f52be826"
]
],
"l": false
},
{
"id": "d8b6743cb853018d",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Hue Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.basement_short_lamp",
"light.basement_stairwell",
"light.basement_tall_lamp",
"light.living_room_lights",
"light.tina_lamp"
],
"labelId": [],
"data": "{\t \"color_name\":\"blue\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1430,
"y": 200,
"wires": [
[]
]
},
{
"id": "ddbbde89f52be826",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Restore State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.amazon_package_delivered_restore"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1320,
"y": 80,
"wires": [
[
"9726bd70b6b83774"
]
]
},
{
"id": "9726bd70b6b83774",
"type": "delay",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1455,
"y": 80,
"wires": [
[
"5fbac3420d43ef9d"
]
],
"l": false
},
{
"id": "5fbac3420d43ef9d",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Restore State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.amazon_package_delivered_adaptive_restore"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1600,
"y": 80,
"wires": [
[]
]
},
{
"id": "d336afe957a65e33",
"type": "delay",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"pauseType": "delay",
"timeout": "15",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1195,
"y": 320,
"wires": [
[
"398d300c5d0b6db5"
]
],
"l": false
},
{
"id": "e2f0e53daa198581",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Hue Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.living_room_lights",
"light.tina_lamp"
],
"labelId": [],
"data": "{\t \"color_name\":\"blue\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1430,
"y": 380,
"wires": [
[]
]
},
{
"id": "398d300c5d0b6db5",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Restore State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.amazon_package_delivered_restore"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1320,
"y": 320,
"wires": [
[
"d92ae2f7fd3171b5"
]
]
},
{
"id": "d92ae2f7fd3171b5",
"type": "delay",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1455,
"y": 320,
"wires": [
[
"96496719d1c09515"
]
],
"l": false
},
{
"id": "96496719d1c09515",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Restore State",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"scene.amazon_package_delivered_adaptive_restore"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1600,
"y": 320,
"wires": [
[]
]
},
{
"id": "15fde8d3275b8455",
"type": "api-current-state",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "People Present?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.people_present",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "people-present",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 390,
"y": 180,
"wires": [
[
"6091f5e58812f97f",
"fe7b309fe37cf8e2"
],
[]
],
"outputLabels": [
"yes",
"no"
]
},
{
"id": "fe7b309fe37cf8e2",
"type": "subflow:6429099c4571dd6b",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "",
"x": 600,
"y": 80,
"wires": [
[]
]
},
{
"id": "458ddfa9d748f88f",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_basement_studio",
"switch.adaptive_lighting_living_room",
"switch.adaptive_lighting_tina_lamp"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 1250,
"y": 200,
"wires": [
[
"d8b6743cb853018d"
]
]
},
{
"id": "37bdac2c9a4e2837",
"type": "api-call-service",
"z": "9a8e84bd2945505e",
"g": "0c81dfaed25d225c",
"name": "Adaptive Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_living_room",
"switch.adaptive_lighting_tina_lamp"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 1250,
"y": 380,
"wires": [
[
"e2f0e53daa198581"
]
]
},
{
"id": "14c6951746b58a38",
"type": "server-events",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "iOS Action Fired",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "ios.action_fired",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"x": 160,
"y": 340,
"wires": [
[
"533921a587f031d4"
]
]
},
{
"id": "533921a587f031d4",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "mb-climate",
"vt": "str"
},
{
"t": "eq",
"v": "Goodnight",
"vt": "str"
},
{
"t": "eq",
"v": "Give Me Darkness",
"vt": "str"
},
{
"t": "cont",
"v": "lights",
"vt": "str"
},
{
"t": "eq",
"v": "Basement On",
"vt": "str"
},
{
"t": "eq",
"v": "Basement Off",
"vt": "str"
},
{
"t": "eq",
"v": "Dinner Is Ready",
"vt": "str"
},
{
"t": "eq",
"v": "Prepare To Leave",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 8,
"x": 295,
"y": 340,
"wires": [
[
"65240dc52617459d"
],
[
"bc5f205fd5e7582e"
],
[
"1516f464e4d87c56"
],
[
"e21a948e9523bce7"
],
[
"b57e12eb73074535"
],
[
"9d1cf8af02a6c86b"
],
[
"93b718cd47747ccc"
],
[
"c8af362d48d5c0ad"
]
],
"l": false
},
{
"id": "65240dc52617459d",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Climate",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "manual-day",
"vt": "str"
},
{
"t": "cont",
"v": "manual-night",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 440,
"y": 120,
"wires": [
[
"d3763c0194214956"
],
[
"638703bd017d6e5b"
]
]
},
{
"id": "d3763c0194214956",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "MB Climate Manual Day",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "button.press",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"button.master_bedroom_day_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "button",
"service": "press",
"x": 650,
"y": 80,
"wires": [
[]
]
},
{
"id": "638703bd017d6e5b",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "MB Climate Manual Night",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "button.press",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"button.master_bedroom_night_mode"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "button",
"service": "press",
"x": 650,
"y": 140,
"wires": [
[]
]
},
{
"id": "bc5f205fd5e7582e",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Goodnight",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "button.press",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"button.goodnight"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "button",
"service": "press",
"x": 610,
"y": 200,
"wires": [
[]
]
},
{
"id": "1516f464e4d87c56",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Give Me Darkness",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.give_me_darkness",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "give_me_darkness",
"x": 630,
"y": 260,
"wires": [
[]
]
},
{
"id": "e21a948e9523bce7",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Lights",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "floor",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 430,
"y": 340,
"wires": [
[
"6ec2fd7aaaf1fc98"
],
[
"89f6119d5702185b"
]
]
},
{
"id": "6ec2fd7aaaf1fc98",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Floors",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "second",
"vt": "str"
},
{
"t": "cont",
"v": "first",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 590,
"y": 340,
"wires": [
[
"c5e9589db7e0b0bf"
],
[
"50cf93faa2e3996c"
]
]
},
{
"id": "c5e9589db7e0b0bf",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Second Floor",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.toggle",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.second_floor_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "toggle",
"x": 810,
"y": 320,
"wires": [
[]
]
},
{
"id": "50cf93faa2e3996c",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "First Floor",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.toggle",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.first_floor_lights"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "toggle",
"x": 800,
"y": 380,
"wires": [
[]
]
},
{
"id": "89f6119d5702185b",
"type": "function",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Rooms",
"func": "const room = msg.payload.event.actionName\n\nif (room === \"lights-basement-studio\") {\n msg.room = \"light.basement_studio_lights\"\n} else if (room === \"lights-living-room\") {\n msg.room = \"light.living_room_lights\"\n} else if (room === \"lights-tina-lamp\") {\n msg.room = \"light.tina_lamp\"\n} else if (room === \"lights-mud-room\") {\n msg.room = \"light.mud_room_overhead\"\n} else if (room === \"lights-upstairs-hallway\") {\n msg.room = \"light.hallway_overhead\"\n} else if (room === \"lights-upstairs-bathroom\") {\n msg.room = \"light.upstairs_bathroom_lights\"\n} else if (room === \"lights-master-bedroom\") {\n msg.room = \"light.master_bedroom_lights\"\n} else if (room === \"lights-kallen-bedroom\") {\n msg.room = \"light.kallen_bedroom_lights\"\n} else if (room === \"lights-emma_bedroom\") {\n msg.room = \"light.emma_bedroom_light\"\n} else if (room === \"lights-front-porch\") {\n msg.room = \"light.front_porch_light\"\n} else if (room === \"lights-furnace-room\") {\n msg.room = \"light.furnace_room_overhead\"\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 600,
"y": 440,
"wires": [
[
"15ae48c0b6e70f36"
]
]
},
{
"id": "15ae48c0b6e70f36",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Toggle Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.toggle",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"{{room}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "toggle",
"x": 810,
"y": 440,
"wires": [
[]
]
},
{
"id": "572b2040be874f4e",
"type": "link out",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "iOS Action - Basement On",
"mode": "link",
"links": [
"1f5808147fa975cf"
],
"x": 465,
"y": 560,
"wires": []
},
{
"id": "b57e12eb73074535",
"type": "change",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "ios",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 395,
"y": 560,
"wires": [
[
"572b2040be874f4e"
]
],
"l": false
},
{
"id": "f5aff29df4e07a4a",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "YES",
"vt": "str"
},
{
"t": "cont",
"v": "NO",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 535,
"y": 800,
"wires": [
[
"7107656a6cbecce7"
],
[]
],
"l": false
},
{
"id": "7107656a6cbecce7",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "Kallen PC On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.kallen_desktop_wake",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "kallen_desktop_wake",
"x": 680,
"y": 800,
"wires": [
[
"d8c62e34298105b4"
]
]
},
{
"id": "6bb57058f0a576e7",
"type": "server-events",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "iOS Notification Action Fired",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "ios.notification_action_fired",
"eventData": "",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"x": 210,
"y": 800,
"wires": [
[
"2a0e3a76af7ab628"
]
]
},
{
"id": "e97b782efaaf5976",
"type": "switch",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "",
"property": "payload.event.actionName",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "KALLEN_PC",
"vt": "str"
},
{
"t": "cont",
"v": "TONY_COMPUTER",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 465,
"y": 800,
"wires": [
[
"f5aff29df4e07a4a"
],
[
"53102bdc5d885602"
]
],
"l": false
},
{
"id": "93b718cd47747ccc",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Dinner Is Ready",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.dinner_is_ready",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "dinner_is_ready",
"x": 460,
"y": 620,
"wires": [
[]
]
},
{
"id": "c8af362d48d5c0ad",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Prepare To Leave",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.we_are_leaving",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "we_are_leaving",
"x": 470,
"y": 680,
"wires": [
[]
]
},
{
"id": "d8c62e34298105b4",
"type": "delay",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 815,
"y": 800,
"wires": [
[
"900c251ff10a2f5b"
]
],
"l": false
},
{
"id": "900c251ff10a2f5b",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "Clear Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": user,\t \"type\":\"alert\",\t \"message\":\"clear_notification\",\t \"tag\":\"kallen_PC\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 970,
"y": 800,
"wires": [
[]
]
},
{
"id": "2a0e3a76af7ab628",
"type": "function",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "user conversion",
"func": "const userTrigger = msg.payload.context.user_id\n\nif (userTrigger === \"c3909d27048140729f002aaef0391775\") {\n msg.user = \"tony\"\n} else if (userTrigger === \"f387a983651a4321a7411ff8cf36f949\") {\n msg.user = \"tina\"\n} else if (userTrigger === \"879b4c04e32841b3ad1d2763a11b4e70\") {\n msg.user = \"kallen\"\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 395,
"y": 800,
"wires": [
[
"e97b782efaaf5976"
]
],
"l": false
},
{
"id": "3463c4f2bf6388fe",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Basement Shutdown",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.basement_shutdown",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "basement_shutdown",
"x": 680,
"y": 500,
"wires": [
[]
]
},
{
"id": "53102bdc5d885602",
"type": "function",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "function 1",
"func": "const action = msg.payload.event.actionName\n\nif (action === 'TONY_COMPUTER_SHUTDOWN') {\n msg.action = 'shutdown'\n node.status({fill:\"green\",shape:\"dot\",text:\"Shutdown\"});\n return[msg,null]\n} else if (action === 'TONY_COMPUTER_LOCK') {\n msg.action = 'lock'\n node.status({fill:\"green\",shape:\"dot\",text:\"Shutdown\"});\n return[msg,null]\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Ignore\"});\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 535,
"y": 880,
"wires": [
[
"a169eca7f3f1df15"
],
[
"0be3c318e9e6df0a"
]
],
"l": false
},
{
"id": "a169eca7f3f1df15",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "Take Action",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tony_desktop_{{action}}",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tony_desktop_{{action}}",
"x": 670,
"y": 880,
"wires": [
[
"2b63f908be8296d0"
]
]
},
{
"id": "2b63f908be8296d0",
"type": "delay",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 815,
"y": 880,
"wires": [
[
"0be3c318e9e6df0a"
]
],
"l": false
},
{
"id": "0be3c318e9e6df0a",
"type": "api-call-service",
"z": "bb961e59e2ef86c9",
"g": "26f91eb2ef77450d",
"name": "Clear Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": user,\t \"type\":\"alert\",\t \"message\":\"clear_notification\",\t \"tag\":\"tony-pc-shutdown\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 970,
"y": 880,
"wires": [
[]
]
},
{
"id": "9d1cf8af02a6c86b",
"type": "link out",
"z": "bb961e59e2ef86c9",
"g": "f519aff597ece351",
"name": "Basement Shutdown",
"mode": "link",
"links": [
"9751c5a6a1b98b7d"
],
"x": 395,
"y": 500,
"wires": []
},
{
"id": "a4c477269b22f766",
"type": "ha-button",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "Send Button",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "f14ef3df2209e9a7",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 110,
"y": 80,
"wires": [
[
"f4bfbaca4d7fb1df"
]
]
},
{
"id": "5095d45c90d5304f",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "Reset Message",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.tts_message"
],
"labelId": [],
"data": "{\t \"value\": reset_message\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 700,
"y": 80,
"wires": [
[
"3ae21589dd88c080"
]
]
},
{
"id": "3ae21589dd88c080",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "Reset Devices List",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.tts_devices"
],
"labelId": [],
"data": "{\t \"option\": reset_who\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 910,
"y": 80,
"wires": [
[
"b2bc83c9195efe0f"
]
]
},
{
"id": "93b7bee28a7e896e",
"type": "subflow:6429099c4571dd6b",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "",
"x": 500,
"y": 80,
"wires": [
[
"5095d45c90d5304f"
]
]
},
{
"id": "b2bc83c9195efe0f",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "Reset Voice",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.announcement_voice"
],
"labelId": [],
"data": "{\t \"option\": reset_voice\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1110,
"y": 80,
"wires": [
[]
]
},
{
"id": "98626a8f2b59bde3",
"type": "ha-button",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Send Notification",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "f040a57e80fda8ee",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 120,
"y": 260,
"wires": [
[
"f44427c5a493c428"
]
]
},
{
"id": "db6d955c039873be",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": msg.priority,\t \"who\": msg.phones,\t \"title\": msg.title,\t \"message\": msg.payload\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 490,
"y": 180,
"wires": [
[]
]
},
{
"id": "d2fec32d385dae8c",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Reset Title",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.text_notification_title"
],
"labelId": [],
"data": "{\t \"value\": title\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 490,
"y": 340,
"wires": [
[
"0145961e8276c53e"
]
]
},
{
"id": "0145961e8276c53e",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Reset Body",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.text_notification"
],
"labelId": [],
"data": "{\t \"value\": payload\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 670,
"y": 340,
"wires": [
[
"fd623c46a558a01a"
]
]
},
{
"id": "fd623c46a558a01a",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Reset Options",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.select_phones",
"input_select.select_tvs"
],
"labelId": [],
"data": "{\t \"option\": options\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 860,
"y": 340,
"wires": [
[
"6b039ef7895476e2"
]
]
},
{
"id": "c52cae79eb97bcc0",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "TV Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tv_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": msg.tvs,\t \"title\": msg.title,\t \"message\": msg.payload\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tv_notify",
"x": 480,
"y": 260,
"wires": [
[]
]
},
{
"id": "6b039ef7895476e2",
"type": "api-call-service",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Reset Priority",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.text_notification_priority_level"
],
"labelId": [],
"data": "{\t \"option\": priority\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1060,
"y": 340,
"wires": [
[]
]
},
{
"id": "f4bfbaca4d7fb1df",
"type": "function",
"z": "ee67610b4a0578d2",
"g": "477e752fcd2e2a19",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst message = states['input_text.tts_message'].state\nconst who = states['input_select.tts_devices'].state\nconst voice = states['input_select.announcement_voice'].state\nconst resetMessage = 'Words go here and stuff'\nconst resetWho = 'Living Room'\nconst resetVoice = global.get(\"jarvis_voice\", \"diskCon\")\n\nmsg.payload = message\nmsg.topic = who\nmsg.voice = voice\n\nmsg.reset_message = resetMessage\nmsg.reset_who = resetWho\nmsg.reset_voice = resetVoice\n\nnode.status({fill:\"green\",shape:\"dot\",text:voice + \" speaking in \" + who});\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 290,
"y": 80,
"wires": [
[
"93b7bee28a7e896e"
]
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "f44427c5a493c428",
"type": "function",
"z": "ee67610b4a0578d2",
"g": "5595964c8367c984",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst title = states['input_text.text_notification_title'].state\nconst message = states['input_text.text_notification'].state\nconst priority = states['input_select.text_notification_priority_level'].state\nconst phones = states['input_select.select_phones'].state.toLowerCase()\nconst tvs = states['input_select.select_tvs'].state.toLowerCase()\n\nlet phoneMsg = {\n \"title\": title,\n \"payload\": message,\n \"priority\": priority,\n \"phones\": phones\n}\nlet tvsMsg = {\n \"title\": title,\n \"payload\": message,\n \"priority\": priority,\n \"tvs\": tvs\n}\n\nlet resetMsg = {\n \"title\":\"Type your title here\",\n \"payload\":\"Type your notification here\",\n \"priority\":\"Normal\",\n \"options\":\"None\"\n}\n\nif (phones != 'none') {\n node.send([phoneMsg,null,null])\n}\n\nif (tvs != 'none') {\n node.send([null,tvsMsg,null])\n}\n\nif (phones === 'none' && tvs === 'none') {\n node.status({fill:\"red\",shape:\"ring\",text:\"No devices selected\"})\n} else {\n node.send([null, null, resetMsg])\n node.status({fill:\"green\",shape:\"dot\",text:\"Message sent\"})\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 310,
"y": 260,
"wires": [
[
"db6d955c039873be"
],
[
"c52cae79eb97bcc0"
],
[
"d2fec32d385dae8c"
]
],
"outputLabels": [
"Phones",
"TVs",
"Reset"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "f803c6af3a30eb66",
"type": "ha-button",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Send Report",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "675dd216a61c575b",
"outputProperties": [
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"x": 130,
"y": 60,
"wires": [
[
"c66df253518a4507",
"6d9c53b7dd7b0cf3"
]
]
},
{
"id": "a6234b2047ba3116",
"type": "function",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst text = states['input_text.report_system'].state\nconst type = states['input_select.report_type'].state\nconst resetText = 'Type your report here'\nconst resetType = 'Bug Report'\n\nmsg.text = text\nmsg.type = type\n\nmsg.reset_text = resetText\nmsg.reset_type = resetType\n\nif (type === \"New Idea\") {\n node.status({fill:\"green\",shape:\"dot\",text:\"New Idea\"})\n} else if (type === \"Bug Report\") {\n node.status({fill:\"green\",shape:\"dot\",text:\"Bug Report\"})\n} else if (type === \"Adjustment\") {\n node.status({fill:\"green\",shape:\"dot\",text:\"Adjustment\"})\n}\n\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "const needsReponseLabel = 213\nconst typeBugLabel = 196\nconst typeEnhancementLabel = 198\nconst typeAdjustmentLabel = 208\n\nflow.set(\"needsReponseLabel\", needsReponseLabel, \"diskCon\")\nflow.set(\"typeBugLabel\", typeBugLabel, \"diskCon\")\nflow.set(\"typeEnhancementLabel\", typeEnhancementLabel, \"diskCon\")\nflow.set(\"typeAdjustmentLabel\", typeAdjustmentLabel, \"diskCon\")",
"finalize": "",
"libs": [],
"x": 530,
"y": 60,
"wires": [
[
"9e43408e18883dfe",
"d31d41f3e474e0c1",
"7674185d1e5ee489"
]
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "427cc2991454bbf0",
"type": "api-call-service",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Reset Type",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.report_type"
],
"labelId": [],
"data": "{\t \"option\": reset_type\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 890,
"y": 60,
"wires": [
[]
]
},
{
"id": "7674185d1e5ee489",
"type": "api-call-service",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Reset Text",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_text.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_text.report_system"
],
"labelId": [],
"data": "{\t \"value\": reset_text\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_text",
"service": "set_value",
"x": 710,
"y": 60,
"wires": [
[
"427cc2991454bbf0"
]
]
},
{
"id": "9e43408e18883dfe",
"type": "function",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Prep API data",
"func": "const needsReponseLabel = flow.get(\"needsReponseLabel\", \"diskCon\")\nconst typeBugLabel = flow.get(\"typeBugLabel\", \"diskCon\")\nconst typeEnhancementLabel = flow.get(\"typeEnhancementLabel\", \"diskCon\")\nconst typeAdjustmentLabel = flow.get(\"typeAdjustmentLabel\", \"diskCon\")\nconst title = msg.text\nconst type = msg.type\nconst user = msg.user\n\nlet labels = [needsReponseLabel]\nlet formatType = {}\n\nif (type === 'Bug Report') {\n labels.push(typeBugLabel)\n formatType = \"[Bug]\"\n} else if (type === 'New Idea') {\n labels.push(typeEnhancementLabel)\n formatType = \"[Feature Request]\"\n} else if (type === 'Adjustment') {\n labels.push(typeAdjustmentLabel)\n formatType = \"[Adjustment Request]\"\n}\n\nlet newTitle = `${formatType}: ${title}`\n\nmsg.payload = {\n \"title\": newTitle,\n \"body\": `This issue was submitted by ${user.firstName} ${user.lastName}, using the automated form on the main Home Assistant dashboard`,\n \"assignees\":[\"tm24fan8\"],\n \"labels\": labels\n}\n\nnode.status({fill:'green',shape:'dot',text:'API data prepped'})\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 120,
"wires": [
[
"f8330684e1ccac8d",
"84c8fd3cc1ab7cf1"
]
]
},
{
"id": "84c8fd3cc1ab7cf1",
"type": "http request",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Gitea HTTP Request",
"method": "POST",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://gitea.nerdhomeinc.com/api/v1/repos/home_automation/Home-Assistant-Configs/issues",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [],
"x": 940,
"y": 120,
"wires": [
[
"ea0bab7efe2d570d",
"a64cee24cd3523c5"
]
]
},
{
"id": "c66df253518a4507",
"type": "subflow:ea629141206d5343",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "",
"x": 330,
"y": 60,
"wires": [
[
"a6234b2047ba3116",
"c5e85490ce1d4a57"
]
]
},
{
"id": "ea0bab7efe2d570d",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "HTTP Request",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1160,
"y": 200,
"wires": []
},
{
"id": "d31d41f3e474e0c1",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Processing Data",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 720,
"y": 200,
"wires": []
},
{
"id": "f8330684e1ccac8d",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "API Data",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 940,
"y": 200,
"wires": []
},
{
"id": "6d9c53b7dd7b0cf3",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Button",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 290,
"y": 200,
"wires": []
},
{
"id": "2b6f06b27b6deb92",
"type": "api-call-service",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": \"alert\",\t \"who\": \"tony\",\t \"title\": title,\t \"message\": message,\t \"actions\": actions\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 1370,
"y": 120,
"wires": [
[]
]
},
{
"id": "a64cee24cd3523c5",
"type": "function",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Notification Setup",
"func": "const statusCode = msg.statusCode\nconst issueNumber = msg.payload.number\nconst issueTitle = msg.payload.title\nconst url = msg.payload.html_url\nconst user = msg.user\n\nlet notification = {\n \"title\": \"Issue Submitted\",\n \"message\": `${user.firstName} ${user.lastName} submitted a new issue: #${issueNumber} - ${issueTitle}`,\n \"actions\": [\n {\n \"action\": \"URI\",\n \"uri\": url,\n \"title\": \"View Issue\"\n }\n ]\n}\n\nnode.send(notification)\nnode.status({fill:'green',shape:'dot',text:`Issue #${issueNumber} notification sent`})",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1170,
"y": 120,
"wires": [
[
"2b6f06b27b6deb92",
"e2e2d2fb7277cde3"
]
]
},
{
"id": "e2e2d2fb7277cde3",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "Notification",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1370,
"y": 200,
"wires": []
},
{
"id": "c5e85490ce1d4a57",
"type": "debug",
"z": "873eb2575d6e9014",
"g": "50e4d951ee7b3e54",
"name": "User",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 510,
"y": 200,
"wires": []
},
{
"id": "5d7c63526234945e",
"type": "api-render-template",
"z": "ebd5561c4f077718",
"g": "b9ffa3fa5af46ec3",
"name": "",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{% from 'formatting.jinja' import cleanup %}\n\n{%- macro getReport() -%}\n\n {{ states('sensor.current_conditions_detail') }}\n {{ states('sensor.tomorrow_forecast_detail') }}\n {{ states('sensor.clothing_forecast_detail') }}\n\n {% if states('sensor.weatheralerts_active_alerts') > '0' %}\n Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weather_alerts_active_corrected') }}. They are as follows.\n {{ states('sensor.weather_alert_string') }}.\n {% endif %}\n\n{%- endmacro -%}\n{{- cleanup(getReport()) -}}",
"resultsLocation": "payload",
"resultsLocationType": "msg",
"templateLocation": "template",
"templateLocationType": "msg",
"x": 320,
"y": 80,
"wires": [
[
"6b5d3e550ad76528"
]
]
},
{
"id": "7aaddacf84721c78",
"type": "inject",
"z": "ebd5561c4f077718",
"g": "b9ffa3fa5af46ec3",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "300",
"crontab": "",
"once": true,
"onceDelay": "1",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 80,
"wires": [
[
"5d7c63526234945e"
]
]
},
{
"id": "6b5d3e550ad76528",
"type": "file",
"z": "ebd5561c4f077718",
"g": "b9ffa3fa5af46ec3",
"name": "",
"filename": "/homeassistant/files/weather_briefing_full.txt",
"filenameType": "str",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 590,
"y": 80,
"wires": [
[]
]
},
{
"id": "d7c2eec75c6063ea",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Backup Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"lightning_alert_restore_firstfloor\",\t \"snapshot_entities\": backup\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 540,
"y": 240,
"wires": [
[
"75c4dc9367328035"
]
]
},
{
"id": "75c4dc9367328035",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Turn off Adaptive",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.adaptive_lighting_tina_lamp"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 750,
"y": 240,
"wires": [
[
"abb24271518ddd9b"
]
]
},
{
"id": "abb24271518ddd9b",
"type": "delay",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "",
"pauseType": "delay",
"timeout": "500",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 945,
"y": 240,
"wires": [
[
"6f29823ba252aef8",
"b6e069ac0ebfe31a",
"6c529210810a63a8"
]
],
"l": false
},
{
"id": "6f29823ba252aef8",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Red Lights",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.tina_lamp_side",
"light.tina_lamp_top"
],
"labelId": [],
"data": "{\t \"color_name\":\"red\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 1070,
"y": 300,
"wires": [
[]
]
},
{
"id": "b6e069ac0ebfe31a",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Red Alert",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.living_room_lights_alert",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"red\",\t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "living_room_lights_alert",
"x": 1060,
"y": 240,
"wires": [
[
"f260e2410571356a"
]
]
},
{
"id": "6c529210810a63a8",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Announce",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.status_annc",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": who,\t \"type\":\"weather\",\t \"call_interruption\": 1,\t \"call_lightning_alert\": 1\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "status_annc",
"x": 1060,
"y": 360,
"wires": [
[]
]
},
{
"id": "b4b80e91a535923e",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Restore Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"{{scenes}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "turn_on",
"x": 1420,
"y": 240,
"wires": [
[]
]
},
{
"id": "1180e4c40c3ec0fa",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Clear Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"alert\",\t \"who\":\"all\",\t \"message\":\"clear_notification\",\t \"tag\":\"lightning-warning\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 550,
"y": 440,
"wires": [
[
"7809c760322bf72a"
]
]
},
{
"id": "b64b61c5bfd91293",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"alert\",\t \"who\":\"all\",\t \"title\":\"Lightning Detected!\",\t \"message\": notification,\t \"tag\":\"lightning-warning\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 510,
"y": 180,
"wires": [
[]
]
},
{
"id": "70f795fb061cbfef",
"type": "api-render-template",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{% set ltgdist = (states('sensor.blitzortung_lightning_distance') | int) / 1.609 | round %}\nLightning has been detected within 20 miles of the house. Nearest storm is {{ ltgdist }} miles away.\n",
"resultsLocation": "notification",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 340,
"y": 180,
"wires": [
[
"b64b61c5bfd91293"
]
]
},
{
"id": "7809c760322bf72a",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Announce",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.status_annc",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\": who,\t \"type\":\"weather\",\t \"call_interruption\": 1,\t \"call_lightning_clear\": 1\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "status_annc",
"x": 740,
"y": 440,
"wires": [
[
"8ffd3e28319fc173"
]
]
},
{
"id": "8ffd3e28319fc173",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"alert\",\t \"who\":\"all\",\t \"title\":\"Lightning Clear!\",\t \"message\": \"The lightning threat has passed. It is safe to resume normal activities.\",\t \"tag\":\"lightning-clear\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "text_notify",
"x": 910,
"y": 440,
"wires": [
[]
]
},
{
"id": "be9ebf6d2f7e18d0",
"type": "comment",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Work on media scene interaction",
"info": "",
"x": 190,
"y": 520,
"wires": []
},
{
"id": "b2c0d6629b2603b7",
"type": "function",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states[\"binary_sensor.audible_weather_alerts_allowed\"].state\nconst occupied = states[\"binary_sensor.basement_occupied\"].state\nconst quiet = states[\"input_boolean.studio_quiet\"].state\nconst deskState = states[\"light.tina_desk_lights\"].state\nconst livingRoomState = states[\"light.living_room_lights\"].state\nconst basementState = states[\"light.basement_studio_lights\"].state\nconst who = states[\"binary_sensor.audible_weather_alerts_allowed\"].attributes.location\nconst duration = msg.duration\nconst payload = msg.payload\n\nlet firstFloorLights = []\nlet basementLights = []\n\nif (deskState === 'on') {\n firstFloorLights.push('light.tina_lamp_top','light.tina_lamp_side')\n}\n\nif (livingRoomState === 'on') {\n firstFloorLights.push('light.living_room_color_1','light.living_room_color_2','light.living_room_color_3','light.living_room_led_strip')\n}\n\nif (basementState === 'on') {\n basementLights.push('light.basement_tall_lamp','light.basement_short_lamp','light.basement_stairwell','light.basement_led_strip_1')\n}\n\nflow.set(\"deskState\", deskState)\nflow.set(\"livingRoomState\", livingRoomState)\nflow.set(\"basementState\", basementState)\n\nlet firstFloorMsg = {\n \"payload\": payload,\n \"duration\": duration,\n \"backup\": firstFloorLights,\n \"who\": who\n}\n\nlet basementMsg = {\n \"payload\": payload,\n \"duration\": duration,\n \"backup\": basementLights\n}\n\nif (allowed === 'on') {\n if (occupied === 'on' && quiet === 'off') {\n flow.set(\"basementTrigger\",\"true\")\n node.status({fill:\"green\",shape:\"dot\",text:\"Both\"})\n return[firstFloorMsg,basementMsg]\n } else {\n flow.set(\"basementTrigger\",\"false\")\n node.status({fill:\"green\",shape:\"dot\",text:\"Living Room\"})\n return[firstFloorMsg,null]\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"})\n return null\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 300,
"wires": [
[
"d7c2eec75c6063ea"
],
[
"c268e2512a503e2a"
]
],
"outputLabels": [
"Living Room",
"Basement"
]
},
{
"id": "c268e2512a503e2a",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Backup Scene",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "scene.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"lightning_alert_restore_basement\",\t \"snapshot_entities\": backup\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "scene",
"service": "create",
"x": 540,
"y": 360,
"wires": [
[
"1e79cbc1d6e8f507"
]
]
},
{
"id": "1e79cbc1d6e8f507",
"type": "delay",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "",
"pauseType": "delay",
"timeout": "500",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 665,
"y": 360,
"wires": [
[
"dbfb74297b6ecd61"
]
],
"l": false
},
{
"id": "dbfb74297b6ecd61",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Red Alert",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.basement_lights_alert",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\":\"red\",\t \"duration\": duration\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "basement_lights_alert",
"x": 780,
"y": 360,
"wires": [
[]
]
},
{
"id": "81c14eac4de9dd9d",
"type": "function",
"z": "ebd5561c4f077718",
"d": true,
"g": "4329e464360d0afa",
"name": "Media?",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst mediaLivingRoom = states['input_boolean.living_room_entertainment_mode'].state\nconst mediaBasement = states['input_boolean.basement_studio_entertainment_mode'].state\n\nif (mediaLivingRoom === 'on' || mediaBasement === 'on') {\n msg.payload = 'on'\n msg.alert = 'on'\n node.status({fill:\"green\",shape:\"dot\",text:\"Media App Running\"})\n return[msg,null]\n} else {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Otherwise\"})\n return[null,msg]\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 860,
"y": 520,
"wires": [
[],
[]
],
"outputLabels": [
"media app running",
"otherwise"
]
},
{
"id": "a586df67c15b0914",
"type": "link out",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "link out 1",
"mode": "link",
"links": [
"27b2c22907382e6d",
"8146f43fea5aec03"
],
"x": 975,
"y": 520,
"wires": []
},
{
"id": "4738fd26d0e16bd4",
"type": "comment",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Living Room",
"info": "",
"x": 370,
"y": 240,
"wires": []
},
{
"id": "84f3e5a7cf5cdfc7",
"type": "comment",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Basement",
"info": "",
"x": 380,
"y": 360,
"wires": []
},
{
"id": "50a2a473686b0445",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Lights Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"{{lightsoff}}"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 1400,
"y": 300,
"wires": [
[]
]
},
{
"id": "33fcb96a4c2c2541",
"type": "delay",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1415,
"y": 180,
"wires": [
[
"8a84615173fd7e97"
]
],
"l": false
},
{
"id": "a4d27381bd614fd1",
"type": "switch",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Desk?",
"property": "deskState",
"propertyType": "flow",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 1355,
"y": 180,
"wires": [
[
"33fcb96a4c2c2541"
]
],
"l": false
},
{
"id": "8a84615173fd7e97",
"type": "api-call-service",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Reset Desk",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_select.tina_desk_scenes"
],
"labelId": [],
"data": "{\t \"option\":\"Reset\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_select",
"service": "select_option",
"x": 1530,
"y": 180,
"wires": [
[]
]
},
{
"id": "f260e2410571356a",
"type": "function",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst deskState = flow.get(\"deskState\")\nconst livingRoomState = flow.get(\"livingRoomState\")\nconst basementState = flow.get(\"basementState\")\nconst basementTrigger = flow.get(\"basementTrigger\")\nlet lightsOff = []\nlet scenesReset = []\n\nscenesReset.push('scene.lightning_alert_restore_firstfloor')\n\nif (deskState === 'off') {\n lightsOff.push('light.tina_desk_lights')\n}\n\nif (livingRoomState === 'off') {\n lightsOff.push('light.living_room_lights')\n}\n\nif (basementTrigger === 'true') {\n if (basementState === 'off') {\n lightsOff.push('light.basement_studio_lights')\n } else {\n scenesReset.push('scene.lightning_alert_restore_basement')\n }\n}\n\nlet size = lightsOff.length\n\nlet resetMsg = {\n \"scenes\": scenesReset\n}\n\nlet lightsMsg = {\n \"lightsoff\": lightsOff\n}\n\nif (size > 0) {\n node.send([null,lightsMsg])\n}\n\nnode.send([resetMsg,null])",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1230,
"y": 240,
"wires": [
[
"b4b80e91a535923e",
"a4d27381bd614fd1"
],
[
"50a2a473686b0445"
]
],
"outputLabels": [
"Scene Reset",
"Lights Off"
]
},
{
"id": "b497fe229c8f2eea",
"type": "function",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Routing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst who = states[\"binary_sensor.audible_weather_alerts_allowed\"].attributes.location\nconst payload = msg.payload\n\nlet newMsg = {\n \"payload\": payload,\n \"who\": who\n}\n\nnode.send(newMsg)\nnode.status({fill:\"green\",shape:\"dot\",text: payload + \", \" + who})",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 440,
"wires": [
[
"1180e4c40c3ec0fa"
]
]
},
{
"id": "f47a0d107875d550",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"g": "4329e464360d0afa",
"name": "Lightning Warning",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "7cc6440f2cdd8a6b",
"entities": {
"entity": [
"binary_sensor.lightning_warning"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": true,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "duration",
"propertyType": "msg",
"value": "10",
"valueType": "num"
}
],
"x": 150,
"y": 360,
"wires": [
[
"70f795fb061cbfef",
"b2c0d6629b2603b7"
],
[
"b497fe229c8f2eea"
]
]
},
{
"id": "8f8450555dd6ac73",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Severe Thunderstorm Warning",
"topic": "weather/alerts/defiance/severe_thunderstorm_warning",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 190,
"y": 620,
"wires": [
[
"c8a8f9eb6f370ae2"
]
]
},
{
"id": "c8a8f9eb6f370ae2",
"type": "function",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Processing",
"func": "let count = msg.payload.count\nlet newState = {}\n\nif (count > 0) {\n newState = \"on\"\n} else {\n newState = \"off\"\n}\n\nmsg.new_state = newState\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 375,
"y": 620,
"wires": [
[
"ad598f14adf7a284"
]
],
"l": false
},
{
"id": "ad598f14adf7a284",
"type": "ha-binary-sensor",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Severe Thunderstorm Warning",
"entityConfig": "d8ea9407aa2cf6a5",
"version": 0,
"state": "new_state",
"stateType": "msg",
"attributes": [
{
"property": "tornado_possible",
"value": "payload.tornado_possible",
"valueType": "msg"
},
{
"property": "considerable_destructive",
"value": "payload.considerable_destructive",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 570,
"y": 620,
"wires": [
[]
]
},
{
"id": "ca1f406359324108",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d96ff91f5f860dcc",
"name": "Severe Thunderstorm Warning - National",
"topic": "weather/alerts/general/severe_thunderstorm_warning",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 220,
"y": 900,
"wires": [
[
"9825ebb82719c364"
]
]
},
{
"id": "9825ebb82719c364",
"type": "ha-sensor",
"z": "ebd5561c4f077718",
"g": "d96ff91f5f860dcc",
"name": "National Severe Thunderstorm Warnings",
"entityConfig": "3983b0de296263e9",
"version": 0,
"state": "payload.count",
"stateType": "msg",
"attributes": [
{
"property": "alerts",
"value": "payload.alerts",
"valueType": "msg"
},
{
"property": "tornado_possible",
"value": "payload.tornado_possible",
"valueType": "msg"
},
{
"property": "considerable_destructive",
"value": "payload.considerable_destructive",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 580,
"y": 900,
"wires": [
[]
]
},
{
"id": "10ca3d9808f3da42",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d96ff91f5f860dcc",
"name": "Tornado Warning - National",
"topic": "weather/alerts/general/tornado_warning",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 170,
"y": 960,
"wires": [
[
"6e65ea4c68e8520c"
]
]
},
{
"id": "6e65ea4c68e8520c",
"type": "ha-sensor",
"z": "ebd5561c4f077718",
"g": "d96ff91f5f860dcc",
"name": "National Tornado Warnings",
"entityConfig": "450c0778c403dffc",
"version": 0,
"state": "payload.count",
"stateType": "msg",
"attributes": [
{
"property": "alerts",
"value": "payload.alerts",
"valueType": "msg"
},
{
"property": "confirmed",
"value": "payload.confirmed",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 540,
"y": 960,
"wires": [
[]
]
},
{
"id": "895863cc6c4cc732",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Tornado Warning",
"topic": "weather/alerts/defiance/tornado_warning",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 680,
"wires": [
[
"724bd8b20f6442fd"
]
]
},
{
"id": "724bd8b20f6442fd",
"type": "function",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Processing",
"func": "let count = msg.payload.count\nlet newState = {}\n\nif (count > 0) {\n newState = \"on\"\n} else {\n newState = \"off\"\n}\n\nmsg.new_state = newState\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 375,
"y": 680,
"wires": [
[
"26c646de6e0b35d7"
]
],
"l": false
},
{
"id": "26c646de6e0b35d7",
"type": "ha-binary-sensor",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Tornado Warning",
"entityConfig": "294b242ba5cfb3fb",
"version": 0,
"state": "new_state",
"stateType": "msg",
"attributes": [
{
"property": "alerts",
"value": "payload.alerts",
"valueType": "msg"
},
{
"property": "confirmed",
"value": "payload.confirmed",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 530,
"y": 680,
"wires": [
[]
]
},
{
"id": "b3e4269945739cfd",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Tornado Watch",
"topic": "weather/alerts/defiance/tornado_watch",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 740,
"wires": [
[
"b004375f406eccef"
]
]
},
{
"id": "90a129b1d1a3f1c0",
"type": "mqtt in",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Severe Thunderstorm Watch",
"topic": "weather/alerts/defiance/severe_thunderstorm_watch",
"qos": "2",
"datatype": "json",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 180,
"y": 800,
"wires": [
[
"86435078e9067a09"
]
]
},
{
"id": "b004375f406eccef",
"type": "function",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Processing",
"func": "let count = msg.payload.count\nlet newState = {}\n\nif (count > 0) {\n newState = \"on\"\n} else {\n newState = \"off\"\n}\n\nmsg.new_state = newState\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 375,
"y": 740,
"wires": [
[
"a2af8db4d82d572c"
]
],
"l": false
},
{
"id": "86435078e9067a09",
"type": "function",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Processing",
"func": "let count = msg.payload.count\nlet newState = {}\n\nif (count > 0) {\n newState = \"on\"\n} else {\n newState = \"off\"\n}\n\nmsg.new_state = newState\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 375,
"y": 800,
"wires": [
[
"9958da4d6712625b"
]
],
"l": false
},
{
"id": "a2af8db4d82d572c",
"type": "ha-binary-sensor",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Tornado Watch",
"entityConfig": "920ee00b5ff0ba8b",
"version": 0,
"state": "new_state",
"stateType": "msg",
"attributes": [
{
"property": "alerts",
"value": "payload.alerts",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 520,
"y": 740,
"wires": [
[]
]
},
{
"id": "9958da4d6712625b",
"type": "ha-binary-sensor",
"z": "ebd5561c4f077718",
"g": "d782e62a03a086e0",
"name": "Severe Thunderstorm Watch",
"entityConfig": "e7ae774638e7cc11",
"version": 0,
"state": "new_state",
"stateType": "msg",
"attributes": [
{
"property": "alerts",
"value": "payload.alerts",
"valueType": "msg"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 560,
"y": 800,
"wires": [
[]
]
},
{
"id": "de16ad92780444f2",
"type": "inject",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 620,
"wires": [
[
"2d06a77584e4e574",
"ff5f40842aabee0c"
]
]
},
{
"id": "2d06a77584e4e574",
"type": "api-current-state",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "Forecast Sensor",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "sensor.weather_com_daily_weather_forecast",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1080,
"y": 620,
"wires": [
[
"9e7ed6a540af8244",
"a6ab36701f1cf2b1"
]
]
},
{
"id": "9e7ed6a540af8244",
"type": "debug",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "Forecast Sensor Debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1330,
"y": 620,
"wires": []
},
{
"id": "ff5f40842aabee0c",
"type": "api-current-state",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "Weather Entity",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "weather.iron_nerd_weather_station",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1080,
"y": 740,
"wires": [
[
"f8902210998462c9",
"f9a0ba239938c0d5"
]
]
},
{
"id": "f8902210998462c9",
"type": "debug",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "Weather Entity Debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1320,
"y": 740,
"wires": []
},
{
"id": "a6ab36701f1cf2b1",
"type": "file",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "",
"filename": "/homeassistant/files/weather_sensor_debug.json",
"filenameType": "str",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 1400,
"y": 680,
"wires": [
[]
]
},
{
"id": "f9a0ba239938c0d5",
"type": "file",
"z": "ebd5561c4f077718",
"g": "47549405aaedc6f1",
"name": "",
"filename": "/homeassistant/files/weather_entity_debug.json",
"filenameType": "str",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 1400,
"y": 800,
"wires": [
[]
]
},
{
"id": "f29d1570059ecc92",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"name": "Precipitation Type",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_precipitation_type"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "precip_type",
"valueType": "str"
},
{
"property": "local",
"propertyType": "msg",
"value": "true",
"valueType": "bool"
}
],
"x": 250,
"y": 1180,
"wires": [
[]
]
},
{
"id": "f73f117b33aa309d",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"name": "Precipitation Intensity",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_cloud_sensors_precipitation_intensity"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "precip_intensity",
"valueType": "str"
},
{
"property": "local",
"propertyType": "msg",
"value": "false",
"valueType": "bool"
}
],
"x": 240,
"y": 1240,
"wires": [
[]
]
},
{
"id": "1d01ca915d4759ec",
"type": "function",
"z": "ebd5561c4f077718",
"name": "Processing",
"func": "\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "const states = global.get('homeassistant.homeAssistant.states')\nconst precipType = states['sensor.home_tempest_precipitation_type'].state\nconst precipIntensity = states['sensor.home_tempest_cloud_sensors_precipitation_intensity'].state\n\nconst typeStatesRaining = ['rain','hail','rain_hail']\nconst intensityStatesRaining = ['very_light','light','moderate','heavy','very_heavy','extreme']\n\nconst isTypeRaining = typeStatesRaining.includes(precipType)\nconst isIntensityRaining = intensityStatesRaining.includes(precipIntensity)\n\nconst isRaining = isTypeRaining || isIntensityRaining\n\nflow.set('typeStatesRaining', typeStatesRaining)\nflow.set('intensityStatesRaining', intensityStatesRaining)\nflow.set('isRaining', isRaining)\n\nreturn null",
"finalize": "",
"libs": [],
"x": 610,
"y": 1180,
"wires": [
[]
]
},
{
"id": "82d975bc07cc9d37",
"type": "context-monitor",
"z": "ebd5561c4f077718",
"name": "",
"monitoring": [
{
"scope": "flow",
"flow": ".",
"node": "7fc67fc156c0f4be",
"key": "test"
}
],
"tostatus": false,
"x": 470,
"y": 1300,
"wires": [
[
"cc522baf847df753"
],
[
"e3e3313d0d169d31"
]
]
},
{
"id": "cc522baf847df753",
"type": "debug",
"z": "ebd5561c4f077718",
"name": "Context Monitor 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 1260,
"wires": []
},
{
"id": "e3e3313d0d169d31",
"type": "debug",
"z": "ebd5561c4f077718",
"name": "Context Monitor 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 1340,
"wires": []
},
{
"id": "e8dbc16027e1addb",
"type": "function",
"z": "ebd5561c4f077718",
"g": "f5eea6eac47f79a8",
"name": "Pressure Conversion",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst temp_F = states['sensor.home_tempest_temperature'].state\nconst elevation_ft = 693\n\n// Get the pressure from the payload\nlet pressure_inHg = msg.payload\n\nif (isNaN(pressure_inHg)) {\n node.error(\"Invalid pressure value in msg.payload: \" + msg.payload)\n msg.payload = null\n return null\n}\n\n// Convert pressure from inHg to hPa\nlet pressure_hPa = pressure_inHg * 33.8639\n\n// Convert temperature to °C\nlet temp_C = (temp_F - 32) * (5 / 9)\n\n// Convert elevation from feet to meters\nlet elevation_m = elevation_ft / 3.28084\n\n// Apply the barometric formula\nlet slp = pressure_hPa * Math.pow(\n 1 - ((0.0065 * elevation_m) / (temp_C + (0.0065 * elevation_m) + 273.15)),\n -5.257\n)\n\n// Optional: Convert back to inHg\nlet slp_inHg = slp / 33.8639\n\n// Round both values\nslp = Math.round(slp * 100) / 100\nslp_inHg = Math.round(slp_inHg * 100) / 100\n\n// Return the SLP value\nmsg.payload = slp_inHg\n\nnode.status({fill:'Success',shape:'dot',text:'green'})\n\nreturn msg\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1120,
"y": 900,
"wires": [
[
"7da31d8bd0d544bd"
]
]
},
{
"id": "350e11750f05c353",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"g": "f5eea6eac47f79a8",
"name": "Station Pressure",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_air_pressure"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 900,
"y": 900,
"wires": [
[
"e8dbc16027e1addb"
]
]
},
{
"id": "7da31d8bd0d544bd",
"type": "ha-sensor",
"z": "ebd5561c4f077718",
"g": "f5eea6eac47f79a8",
"name": "Home Tempest Local SLP",
"entityConfig": "8f61788e0c4471e1",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1370,
"y": 900,
"wires": [
[]
]
},
{
"id": "1f7af146c06b8b85",
"type": "ha-select",
"z": "fc6801ef8637d652",
"name": "Active Sporting Event",
"version": 1,
"debugenabled": false,
"inputs": 0,
"outputs": 1,
"entityConfig": "95180a63dc83b944",
"mode": "listen",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "#:(diskCon)::activeEvent",
"propertyType": "flow",
"value": "",
"valueType": "value"
},
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 260,
"y": 380,
"wires": [
[
"e2e55a6db871e124"
]
]
},
{
"id": "8e7bb3461773c5b9",
"type": "ha-switch",
"z": "fc6801ef8637d652",
"name": "Watching Sports",
"version": 0,
"debugenabled": false,
"inputs": 0,
"outputs": 2,
"entityConfig": "dc557449c40eba5e",
"enableInput": false,
"outputOnStateChange": true,
"outputProperties": [
{
"property": "watching",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 280,
"y": 320,
"wires": [
[
"e2e55a6db871e124"
],
[
"e2e55a6db871e124"
]
]
},
{
"id": "c0e5b488ed073f56",
"type": "ha-number",
"z": "fc6801ef8637d652",
"name": "Team Score",
"version": 1,
"debugenabled": false,
"inputs": 0,
"outputs": 1,
"entityConfig": "c7a23a2b967375ec",
"mode": "listen",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "teamScore",
"propertyType": "msg",
"value": "",
"valueType": "value"
},
{
"property": "teamPreviousScore",
"propertyType": "msg",
"value": "",
"valueType": "previousValue"
}
],
"x": 290,
"y": 500,
"wires": [
[
"04829df5b7dfb2c2"
]
]
},
{
"id": "77affe81dadd8a64",
"type": "ha-number",
"z": "fc6801ef8637d652",
"name": "Opponent Score",
"version": 1,
"debugenabled": false,
"inputs": 0,
"outputs": 1,
"entityConfig": "f64cc18b786d7352",
"mode": "listen",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "oppScore",
"propertyType": "msg",
"value": "",
"valueType": "value"
},
{
"property": "oppPreviousScore",
"propertyType": "msg",
"value": "",
"valueType": "previousValue"
}
],
"x": 280,
"y": 560,
"wires": [
[
"103231f89b894205"
]
]
},
{
"id": "99c8d72f9eb4be38",
"type": "function",
"z": "fc6801ef8637d652",
"name": "Init",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst team = flow.get(\"activeEvent\", \"diskCon\")\nconst room = flow.get(\"activeRoom\", \"diskCon\")\n\nif (team === 'No events today') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"No events today\" })\n node.done\n} else {\n const lowerTeam = team.toLowerCase()\n const convertTeam = lowerTeam.replaceAll(\" \", \"_\")\n const sensor = \"sensor.\" + convertTeam\n const getInhibitSensor = \"binary_sensor.\" + convertTeam + \"_inhibit\"\n const inhibit = states[getInhibitSensor].state\n const teamSensor = states[sensor]\n const lowerRoom = room.toLowerCase()\n const convertRoom = lowerRoom.replaceAll(\" \",\"_\")\n const teamColors = teamSensor.attributes.team_colors\n const oppColors = teamSensor.attributes.opponent_colors\n\n flow.set(\"team\", convertTeam, \"diskCon\")\n flow.set(\"inhibit\", inhibit, \"diskCon\")\n flow.set(\"teamSensor\", teamSensor, \"diskCon\")\n flow.set(\"room\", convertRoom, \"diskCon\")\n flow.set(\"teamColors\", teamColors, \"diskCon\")\n flow.set(\"oppColors\", oppColors, \"diskCon\")\n\n let sendTeam = {\n \"payload\": teamColors,\n \"topic\": \"teamColors\"\n }\n\n let sendOpp = {\n \"payload\": oppColors,\n \"topic\": \"oppColors\"\n }\n\n node.send([[sendTeam,sendOpp]])\n \n node.status({fill:\"green\",shape:\"dot\",text:\"Team: \" + team})\n node.log(\"Active sports team changed to \" + team)\n}",
"outputs": 1,
"noerr": 0,
"initialize": "const teams = [\"michigan_wolverines\",\n \"ohio_state_buckeyes\",\n \"toledo_rockets\",\n \"minnesota_vikings\",\n \"san_francisco_49ers\",\n \"cleveland_guardians\",\n \"minnesota_twins\",\n \"los_angeles_dodgers\"]\n\nconst michigan_wolverines = ['sensor.michigan_wolverines', 'binary_sensor.michigan_wolverines_inhibit']\nconst ohio_state_buckeyes = ['sensor.ohio_state_buckeyes', 'binary_sensor.ohio_state_buckeyes_inhibit']\nconst toledo_rockets = ['sensor.toledo_rockets', 'binary_sensor.toledo_rockets_inhibit']\nconst minnesota_vikings = ['sensor.minnesota_vikings', 'binary_sensor.minnesota_vikings_inhibit']\nconst san_francisco_49ers = ['sensor.san_francisco_49ers', 'binary_sensor.san_francisco_49ers_inhibit']\nconst cleveland_guardians = ['sensor.cleveland_guardians', 'binary_sensor.cleveland_guardians_inhibit']\nconst minnesota_twins = ['sensor.minnesota_twins', 'binary_sensor.minnesota_twins_inhibit']\nconst los_angeles_dodgers = ['sensor.los_angeles_dodgers', 'binary_sensor.los_angeles_dodgers_inhibit']\n\nflow.set(\"teams\", teams, \"diskCon\")\nflow.set(\"michigan_wolverines\", michigan_wolverines, \"diskCon\")\nflow.set(\"ohio_state_buckeyes\", ohio_state_buckeyes, \"diskCon\")\nflow.set(\"toledo_rockets\", toledo_rockets, \"diskCon\")\nflow.set(\"minnesota_vikings\", minnesota_vikings, \"diskCon\")\nflow.set(\"san_francisco_49ers\", san_francisco_49ers, \"diskCon\")\nflow.set(\"cleveland_guardians\", cleveland_guardians, \"diskCon\")\nflow.set(\"minnesota_twins\", minnesota_twins, \"diskCon\")\nflow.set(\"los_angeles_dodgers\", los_angeles_dodgers, \"diskCon\")",
"finalize": "",
"libs": [],
"x": 810,
"y": 380,
"wires": [
[
"e0eb2dc4c1035407"
]
],
"icon": "font-awesome/fa-hourglass-start"
},
{
"id": "eee6c6f985bbcc1e",
"type": "comment",
"z": "fc6801ef8637d652",
"name": "Reliably catch score changes",
"info": "",
"x": 240,
"y": 680,
"wires": []
},
{
"id": "aedcd3658f94590d",
"type": "inject",
"z": "fc6801ef8637d652",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "300",
"crontab": "",
"once": true,
"onceDelay": "30",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 175,
"y": 60,
"wires": [
[
"518b1bb6954c11d2"
]
],
"l": false
},
{
"id": "44f65019901cd6c8",
"type": "ha-update-config",
"z": "fc6801ef8637d652",
"name": "Update Dropdown",
"server": "9e87348d.9c1c48",
"entityConfig": "95180a63dc83b944",
"version": 0,
"outputProperties": [],
"x": 510,
"y": 60,
"wires": [
[]
]
},
{
"id": "518b1bb6954c11d2",
"type": "function",
"z": "fc6801ef8637d652",
"name": "Events Today",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst teams = flow.get(\"teams\", \"diskCon\")\nlet teamsToday = []\nlet options = []\n\nfor (let index = 0; index < teams.length; index++) {\n const element = teams[index];\n let sensor = \"sensor.\" + element\n let binary_today = \"binary_sensor.\" + element + \"_event_today\"\n let binary_inhibit = \"binary_sensor.\" + element + \"_inhibit\"\n let today = states[binary_today].state\n let inhibit = states[binary_inhibit].state\n let teamName = states[sensor].attributes.friendly_name\n if (today === 'on' && inhibit === 'off') {\n teamsToday.push(teamName)\n }\n}\n\nflow.set(\"teamsToday\", teamsToday, \"diskCon\")\n\nif (teamsToday.length > 0) {\n options = teamsToday\n node.status({fill:\"green\",shape:\"dot\",text:\"Events today: \" + teamsToday.length})\n} else {\n options = ['No events today']\n node.status({fill:\"red\",shape:\"ring\",text:\"No events today\"});\n}\n\nmsg.payload = {\n \"options\": options\n}\n\nnode.send(msg)\nnode.done",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 60,
"wires": [
[
"44f65019901cd6c8"
]
]
},
{
"id": "0105c3f26dc03946",
"type": "inject",
"z": "fc6801ef8637d652",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "30",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 115,
"y": 260,
"wires": [
[
"cfe0ade2b0e3be21",
"1a397d63067f9bac"
]
],
"l": false
},
{
"id": "cfe0ade2b0e3be21",
"type": "api-current-state",
"z": "fc6801ef8637d652",
"name": "Watching Sports?",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.watching_sports",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "watching",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 270,
"y": 260,
"wires": [
[
"e2e55a6db871e124"
],
[
"e2e55a6db871e124"
]
]
},
{
"id": "ab1e0278165f7fd1",
"type": "function",
"z": "fc6801ef8637d652",
"name": "Scores",
"func": "// Get sensor\nconst states = global.get('homeassistant.homeAssistant.states')\nconst active = states['switch.watching_sports'].state\n\nif (active === 'on') {\n // Get scores\n const team = flow.get(\"team\", \"diskCon\")\n const teamSensor = states[\"sensor.\" + team]\n const status = teamSensor.state\n if (status === 'IN') {\n const teamScore = teamSensor.attributes.team_score\n const oppScore = teamSensor.attributes.opponent_score\n msg = {\n \"teamscore\": teamScore,\n \"oppscore\": oppScore\n }\n node.status({ fill: \"green\", shape: \"dot\", text: \"Score: \" + teamScore + \"-\" + oppScore })\n node.send(msg)\n } else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Not in game\" })\n }\n} else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Inactive\" })\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 200,
"wires": [
[
"5017d392b30ac710",
"3d982dc8b2247951"
]
]
},
{
"id": "364a58744d93b5bb",
"type": "inject",
"z": "fc6801ef8637d652",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "5",
"crontab": "",
"once": true,
"onceDelay": "35",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 290,
"y": 200,
"wires": [
[
"ab1e0278165f7fd1"
]
]
},
{
"id": "e2e55a6db871e124",
"type": "api-call-service",
"z": "fc6801ef8637d652",
"name": "Reset Scores",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.opponent_score",
"number.team_score"
],
"labelId": [],
"data": "{\t \"value\": 0\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "number",
"service": "set_value",
"x": 500,
"y": 220,
"wires": [
[
"ea6939832ebe09cf"
]
]
},
{
"id": "5017d392b30ac710",
"type": "api-call-service",
"z": "fc6801ef8637d652",
"name": "Team Score",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.team_score"
],
"labelId": [],
"data": "{\t \"value\": teamscore\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "number",
"service": "set_value",
"x": 930,
"y": 140,
"wires": [
[]
]
},
{
"id": "3d982dc8b2247951",
"type": "api-call-service",
"z": "fc6801ef8637d652",
"name": "Opponent Score",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.opponent_score"
],
"labelId": [],
"data": "{\t \"value\": oppscore\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "number",
"service": "set_value",
"x": 940,
"y": 240,
"wires": [
[]
]
},
{
"id": "04829df5b7dfb2c2",
"type": "debug",
"z": "fc6801ef8637d652",
"name": "team score",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 490,
"y": 500,
"wires": []
},
{
"id": "103231f89b894205",
"type": "debug",
"z": "fc6801ef8637d652",
"name": "opp score",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 560,
"wires": []
},
{
"id": "ea6939832ebe09cf",
"type": "delay",
"z": "fc6801ef8637d652",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 615,
"y": 220,
"wires": [
[
"ab1e0278165f7fd1"
]
],
"l": false
},
{
"id": "4c7a405055e38678",
"type": "ha-select",
"z": "fc6801ef8637d652",
"name": "Active Room",
"version": 1,
"debugenabled": false,
"inputs": 0,
"outputs": 1,
"entityConfig": "39198b07403764b1",
"mode": "listen",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "#:(diskCon)::activeRoom",
"propertyType": "flow",
"value": "",
"valueType": "value"
},
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 290,
"y": 440,
"wires": [
[]
]
},
{
"id": "e0eb2dc4c1035407",
"type": "subflow:17510314e84badd9",
"z": "fc6801ef8637d652",
"name": "",
"x": 1040,
"y": 380,
"wires": []
},
{
"id": "4d93e5b1e81ce569",
"type": "inject",
"z": "fc6801ef8637d652",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"options\":[\"Cleveland Guardians\",\"Los Angeles Dodgers\"]}",
"payloadType": "json",
"x": 330,
"y": 20,
"wires": [
[
"44f65019901cd6c8"
]
]
},
{
"id": "1a397d63067f9bac",
"type": "ha-select",
"z": "fc6801ef8637d652",
"name": "Active Room",
"version": 1,
"debugenabled": false,
"inputs": 1,
"outputs": 1,
"entityConfig": "39198b07403764b1",
"mode": "get",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "#:(diskCon)::activeRoom",
"propertyType": "flow",
"value": "",
"valueType": "value"
},
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 290,
"y": 120,
"wires": [
[
"4e193132ac06af56"
]
]
},
{
"id": "4e193132ac06af56",
"type": "ha-select",
"z": "fc6801ef8637d652",
"name": "Active Sporting Event",
"version": 1,
"debugenabled": false,
"inputs": 1,
"outputs": 1,
"entityConfig": "95180a63dc83b944",
"mode": "get",
"value": "payload",
"valueType": "msg",
"outputProperties": [
{
"property": "#:(diskCon)::activeEvent",
"propertyType": "flow",
"value": "",
"valueType": "value"
},
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 520,
"y": 120,
"wires": [
[]
]
},
{
"id": "ea686c71f041c78b",
"type": "complete",
"z": "fc6801ef8637d652",
"name": "Watching?",
"scope": [
"8e7bb3461773c5b9",
"cfe0ade2b0e3be21"
],
"uncaught": false,
"x": 120,
"y": 120,
"wires": [
[
"1a397d63067f9bac"
]
]
},
{
"id": "e563dd31b4750c0e",
"type": "complete",
"z": "fc6801ef8637d652",
"name": "Event/Room Change",
"scope": [
"1f7af146c06b8b85",
"4c7a405055e38678",
"1a397d63067f9bac",
"4e193132ac06af56"
],
"uncaught": false,
"x": 590,
"y": 380,
"wires": [
[
"99c8d72f9eb4be38",
"2c2bb571085c5a90"
]
]
},
{
"id": "2c2bb571085c5a90",
"type": "debug",
"z": "fc6801ef8637d652",
"name": "catch",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 440,
"wires": []
},
{
"id": "077ae8dc789e9089",
"type": "comment",
"z": "fc6801ef8637d652",
"name": "Figuring out how to smoothly handle event and room changes",
"info": "Need to be able to update context with necessary info\n\n- Team\n- Opponent\n- Colors\n- Room\n\netc",
"x": 900,
"y": 540,
"wires": []
},
{
"id": "1031080bdf3b95bf",
"type": "server-state-changed",
"z": "789ba711dc04fad2",
"name": "Twitch Stream Status",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.twitch_ironnerd24"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 140,
"y": 220,
"wires": [
[
"4a51b2cf2fe4c02c"
]
],
"outputLabels": [
"Live",
"Offline"
]
},
{
"id": "dcf595a3aeb025a4",
"type": "api-call-service",
"z": "789ba711dc04fad2",
"name": "Turn on booleans",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.gaming_mode",
"input_boolean.studio_quiet"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_on",
"x": 610,
"y": 200,
"wires": [
[]
]
},
{
"id": "21deb99e77dfa74d",
"type": "api-call-service",
"z": "789ba711dc04fad2",
"name": "Turn off boolean",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "input_boolean.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"input_boolean.studio_quiet"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "input_boolean",
"service": "turn_off",
"x": 600,
"y": 320,
"wires": [
[]
]
},
{
"id": "e6aea47391a1f784",
"type": "api-call-service",
"z": "789ba711dc04fad2",
"name": "Basement DnD On",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.basement_echo_dot_do_not_disturb_switch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_on",
"x": 610,
"y": 260,
"wires": [
[]
]
},
{
"id": "3f97e618415f37c5",
"type": "api-call-service",
"z": "789ba711dc04fad2",
"name": "Basement DnD Off",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "switch.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.basement_echo_dot_do_not_disturb_switch"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "switch",
"service": "turn_off",
"x": 610,
"y": 380,
"wires": [
[]
]
},
{
"id": "dc05476aa4d90974",
"type": "api-call-service",
"z": "789ba711dc04fad2",
"name": "TV Notifications",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.tv_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"who\":\"all\",\t \"title\": \"Stream Starting\",\t \"message\": \"Tony has started a live stream in the studio!\",\t \"data\": {\t \"fontsize\": \"large\",\t \"duration\": 3,\t \"transparency\": \"30%\",\t \"color\": \"indigo\"\t }\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "script",
"service": "tv_notify",
"x": 600,
"y": 140,
"wires": [
[]
]
},
{
"id": "efade953371aa59e",
"type": "mqtt out",
"z": "789ba711dc04fad2",
"name": "MQTT Publish",
"topic": "house/studio/live",
"qos": "1",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 600,
"y": 80,
"wires": []
},
{
"id": "3eef2b6b25a9b04f",
"type": "mqtt out",
"z": "789ba711dc04fad2",
"name": "MQTT Publish",
"topic": "house/studio/live",
"qos": "1",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 600,
"y": 440,
"wires": []
},
{
"id": "596e7ae95bf50ffd",
"type": "link in",
"z": "789ba711dc04fad2",
"name": "Cleanup - Twitch",
"links": [
"619d1474239faf58"
],
"x": 95,
"y": 320,
"wires": [
[
"f5e5f17c682ddb8c"
]
]
},
{
"id": "f5e5f17c682ddb8c",
"type": "api-current-state",
"z": "789ba711dc04fad2",
"name": "State",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "sensor.twitch_ironnerd24",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 190,
"y": 320,
"wires": [
[
"4a51b2cf2fe4c02c"
]
],
"outputLabels": [
"Live",
"Offline"
]
},
{
"id": "4a51b2cf2fe4c02c",
"type": "function",
"z": "789ba711dc04fad2",
"name": "Processing",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst peoplePresent = states['binary_sensor.people_present'].state\nconst streamLive = msg.payload\n\nif (vacationMode === 'off' && peoplePresent === 'on') {\n if (streamLive === 'streaming') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Stream Live\"});\n return[msg,null]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Stream Offline\"});\n return[null,msg]\n }\n} else {\n node.status({fill:\"grey\",shape:\"dot\",text:\"Skipped\"});\n return null\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 260,
"wires": [
[
"e6aea47391a1f784",
"dcf595a3aeb025a4",
"dc05476aa4d90974",
"efade953371aa59e"
],
[
"21deb99e77dfa74d",
"3f97e618415f37c5",
"3eef2b6b25a9b04f"
]
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "b109c8db1c2cd259",
"type": "ha-button",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "Restart AppDaemon",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "04976a7418728aa3",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "date"
}
],
"x": 150,
"y": 360,
"wires": [
[
"75a50e8dac7af692"
]
]
},
{
"id": "75a50e8dac7af692",
"type": "api-call-service",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "hassio.addon_restart",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"addon\":\"a0d7b954_appdaemon\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "hassio",
"service": "addon_restart",
"x": 380,
"y": 360,
"wires": [
[]
]
},
{
"id": "baae5d6f53900594",
"type": "ha-button",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "Cleanup",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "a11aaf0288452997",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "cleanup",
"valueType": "str"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"x": 120,
"y": 420,
"wires": [
[
"619d1474239faf58"
]
]
},
{
"id": "619d1474239faf58",
"type": "link out",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "Cleanup",
"mode": "link",
"links": [
"6a1cecedd6ef4b44",
"596e7ae95bf50ffd"
],
"x": 235,
"y": 420,
"wires": []
},
{
"id": "ce8a6bb6e9460f13",
"type": "server-state-changed",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "Tony Desktop Power",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.tony_desktop_power"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 150,
"y": 80,
"wires": [
[
"ce5a2ea26f26e421"
]
]
},
{
"id": "ce5a2ea26f26e421",
"type": "mqtt out",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "",
"topic": "house/power/basement/tony_desktop",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 470,
"y": 80,
"wires": []
},
{
"id": "abb6e16585d7fe61",
"type": "server-state-changed",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "Kallen Desktop Power",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.kallen_desktop_power"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 160,
"y": 140,
"wires": [
[
"aa9b2f0ddc5b77d3"
]
]
},
{
"id": "aa9b2f0ddc5b77d3",
"type": "mqtt out",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "",
"topic": "house/power/basement/kallen_desktop",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 470,
"y": 140,
"wires": []
},
{
"id": "0a8426dd99cbaeec",
"type": "server-state-changed",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "Basement Server Power",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.basement_server_power"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 170,
"y": 260,
"wires": [
[
"8813b152ed76b96c"
]
]
},
{
"id": "8813b152ed76b96c",
"type": "mqtt out",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "",
"topic": "house/power/basement/basement_server",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 480,
"y": 260,
"wires": []
},
{
"id": "9833b2aff0f97ea9",
"type": "server-state-changed",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "Tina Desktop Power",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.tina_desktop_power"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 150,
"y": 200,
"wires": [
[
"51d05298561cfddb"
]
]
},
{
"id": "51d05298561cfddb",
"type": "mqtt out",
"z": "ffa6a885ac41a5ed",
"g": "6504d94aaaf9b8d9",
"name": "",
"topic": "house/power/first_floor/tina_desk/tina_desktop",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 500,
"y": 200,
"wires": []
},
{
"id": "ca88f85ba00a6744",
"type": "inject",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "Reboot",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "reboot",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 480,
"wires": [
[
"619d1474239faf58",
"1d84f0da59682160"
]
]
},
{
"id": "939abd584ee8580a",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 1min",
"topic": "$SYS/broker/load/messages/received/1min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 840,
"y": 80,
"wires": [
[
"6b17d7fa4de2b620"
]
]
},
{
"id": "6b17d7fa4de2b620",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 4",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 80,
"wires": [
[
"e2a8c8b2638be79f"
]
],
"l": false
},
{
"id": "e2a8c8b2638be79f",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 1min",
"entityConfig": "b78174a1b561ea3f",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 80,
"wires": [
[]
]
},
{
"id": "96baea4b0d08d151",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 5min",
"topic": "$SYS/broker/load/messages/received/5min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 840,
"y": 140,
"wires": [
[
"8357b66291d6f498"
]
]
},
{
"id": "8357b66291d6f498",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 5",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 140,
"wires": [
[
"76eb43f2c84142f8"
]
],
"l": false
},
{
"id": "76eb43f2c84142f8",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 5min",
"entityConfig": "acbe15cbb8457f35",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 140,
"wires": [
[]
]
},
{
"id": "1dc56852c1691e89",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 15min",
"topic": "$SYS/broker/load/messages/received/15min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 840,
"y": 200,
"wires": [
[
"b2a69c7d24c170ad"
]
]
},
{
"id": "b2a69c7d24c170ad",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 6",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 200,
"wires": [
[
"0f107a6c4d46cdc8"
]
],
"l": false
},
{
"id": "0f107a6c4d46cdc8",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Received 15min",
"entityConfig": "e023cc05d1c0cecb",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 200,
"wires": [
[]
]
},
{
"id": "79822e9d0a97457c",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 1min",
"topic": "$SYS/broker/load/messages/sent/1min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 820,
"y": 260,
"wires": [
[
"ef26acc3d75b5b93"
]
]
},
{
"id": "ef26acc3d75b5b93",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 7",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 260,
"wires": [
[
"d790797e62163c2b"
]
],
"l": false
},
{
"id": "d790797e62163c2b",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 1min",
"entityConfig": "7f5c52481ee5041b",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1120,
"y": 260,
"wires": [
[]
]
},
{
"id": "463eb1286393993a",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 5min",
"topic": "$SYS/broker/load/messages/sent/5min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 820,
"y": 320,
"wires": [
[
"396cee5f3aa5255f"
]
]
},
{
"id": "396cee5f3aa5255f",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 8",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 320,
"wires": [
[
"af22ad5de7f824ed"
]
],
"l": false
},
{
"id": "af22ad5de7f824ed",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 5min",
"entityConfig": "b1afb202ae5b94cf",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1120,
"y": 320,
"wires": [
[]
]
},
{
"id": "cb37ef0a4c6a0d4b",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 15min",
"topic": "$SYS/broker/load/messages/sent/15min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 830,
"y": 380,
"wires": [
[
"538a80f1ef807ce5"
]
]
},
{
"id": "538a80f1ef807ce5",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 9",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 380,
"wires": [
[
"8bc88748bdc7fec8"
]
],
"l": false
},
{
"id": "8bc88748bdc7fec8",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Sent 15min",
"entityConfig": "608fb2f833106a54",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1130,
"y": 380,
"wires": [
[]
]
},
{
"id": "ca36c535f62a938b",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 1min",
"topic": "$SYS/broker/load/publish/dropped/1min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 830,
"y": 440,
"wires": [
[
"fe5a9d13c3acdf8a"
]
]
},
{
"id": "fe5a9d13c3acdf8a",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 10",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 440,
"wires": [
[
"704c78f0839b0cbf"
]
],
"l": false
},
{
"id": "704c78f0839b0cbf",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 1min",
"entityConfig": "3a3de00eeef75917",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 440,
"wires": [
[]
]
},
{
"id": "a98df8034046bdc1",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 5min",
"topic": "$SYS/broker/load/publish/dropped/5min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 830,
"y": 500,
"wires": [
[
"fe27369f5d336321"
]
]
},
{
"id": "fe27369f5d336321",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 11",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 500,
"wires": [
[
"1812eb70af41b475"
]
],
"l": false
},
{
"id": "1812eb70af41b475",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 5min",
"entityConfig": "01b4bc2b7f492cac",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 500,
"wires": [
[]
]
},
{
"id": "6e7294be1430b43a",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 15min",
"topic": "$SYS/broker/load/publish/dropped/15min",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 840,
"y": 560,
"wires": [
[
"60b562a91a724301"
]
]
},
{
"id": "60b562a91a724301",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "function 12",
"func": "let payload = msg.payload\n\nmsg.payload = Math.round(payload)\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 560,
"wires": [
[
"ed548a3f33ed2137"
]
],
"l": false
},
{
"id": "ed548a3f33ed2137",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Dropped 15min",
"entityConfig": "58b262f448b7831a",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 560,
"wires": [
[]
]
},
{
"id": "9df778270aff32c7",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Uptime",
"topic": "$SYS/broker/uptime",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 810,
"y": 620,
"wires": [
[
"5486cc70a2a83cd0"
]
]
},
{
"id": "5f6468dc8b022b6b",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Uptime",
"entityConfig": "63b391b64c920d72",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1120,
"y": 620,
"wires": [
[]
]
},
{
"id": "5486cc70a2a83cd0",
"type": "function",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Formatting",
"func": "const payload = msg.payload\nconst numbersOnly = payload.replace(/\\D/g, \"\")\n\nmsg.payload = numbersOnly\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 985,
"y": 620,
"wires": [
[
"5f6468dc8b022b6b"
]
],
"l": false
},
{
"id": "c95f5ac879cfef5d",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Received",
"topic": "$SYS/broker/messages/received",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 830,
"y": 740,
"wires": [
[
"ccebc1def6a944d9"
]
]
},
{
"id": "ccebc1def6a944d9",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Received",
"entityConfig": "06c585be926ee13b",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1140,
"y": 740,
"wires": [
[]
]
},
{
"id": "a675ad54d1ec36fa",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Sent",
"topic": "$SYS/broker/messages/sent",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 820,
"y": 800,
"wires": [
[
"0723c20ffd541ca7"
]
]
},
{
"id": "0723c20ffd541ca7",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Sent",
"entityConfig": "20642905379cffe9",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1120,
"y": 800,
"wires": [
[]
]
},
{
"id": "6596ad2f0c91a78c",
"type": "ha-sensor",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Stored",
"entityConfig": "3e54ec9fa6f987bc",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1130,
"y": 680,
"wires": [
[]
]
},
{
"id": "bb4ca3d4e66d87a5",
"type": "mqtt in",
"z": "ffa6a885ac41a5ed",
"g": "23b02b1256dfd302",
"name": "Msg Stored",
"topic": "$SYS/broker/messages/stored",
"qos": "1",
"datatype": "auto-detect",
"broker": "fd29421fc00140a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 830,
"y": 680,
"wires": [
[
"6596ad2f0c91a78c"
]
]
},
{
"id": "1d84f0da59682160",
"type": "mqtt out",
"z": "ffa6a885ac41a5ed",
"g": "46275dd0f9461013",
"name": "",
"topic": "services/homeassistant/reboot",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 410,
"y": 480,
"wires": []
},
{
"id": "e8d2135bb5564a4a",
"type": "server-state-changed",
"z": "3e4ba157b540d183",
"g": "6e83103b5c5311e9",
"name": "Voice Change",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_select.jarvis_voice"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 150,
"y": 60,
"wires": [
[
"a75651492e779bfc"
]
]
},
{
"id": "4d724735025b0ed8",
"type": "server-state-changed",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Work Today",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.work_today"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 130,
"y": 340,
"wires": [
[
"6ec62f6cf4fcf994"
]
]
},
{
"id": "6ec62f6cf4fcf994",
"type": "switch",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 430,
"y": 340,
"wires": [
[
"486bca43ddc48fb8"
]
]
},
{
"id": "31ce8ad28dd41226",
"type": "api-render-template",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Offset Before",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ (state_attr('input_datetime.tina_workday_end', 'timestamp') - 5400) | timestamp_custom('%H:%M', false) }}",
"resultsLocation": "start",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 410,
"y": 240,
"wires": [
[
"20271b0662a4d5df"
]
]
},
{
"id": "20271b0662a4d5df",
"type": "api-render-template",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Offset After",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ (state_attr('input_datetime.tina_workday_end', 'timestamp') + 7200) | timestamp_custom('%H:%M', false) }}",
"resultsLocation": "stop",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 590,
"y": 240,
"wires": [
[
"16bf625c802d7910"
]
]
},
{
"id": "16bf625c802d7910",
"type": "function",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Times",
"func": "msg.payload = {\n \"start\": msg.start,\n \"stop\": msg.stop,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n}\nmsg.topic = \"override\"\nnode.status({fill:\"green\",shape:\"dot\",text:msg.start + \" - \" + msg.stop});\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 760,
"y": 240,
"wires": [
[
"b6cb206d9cb34610"
]
],
"icon": "font-awesome/fa-clock-o"
},
{
"id": "a32c37ccf0102258",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Workday on Reboot",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 400,
"wires": [
[
"d5c6b45df763e57e"
]
]
},
{
"id": "d5c6b45df763e57e",
"type": "api-current-state",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Work Today",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.work_today",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 410,
"y": 400,
"wires": [
[
"486bca43ddc48fb8"
]
]
},
{
"id": "6f011420f6bb15a7",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Schedule on Reboot",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 280,
"wires": [
[
"31ce8ad28dd41226"
]
]
},
{
"id": "f6f45d3e3cf9aeab",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "6e83103b5c5311e9",
"name": "Set Voice on Reboot",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 120,
"wires": [
[
"40c9c33453179a21"
]
]
},
{
"id": "40c9c33453179a21",
"type": "api-current-state",
"z": "3e4ba157b540d183",
"g": "6e83103b5c5311e9",
"name": "Jarvis Voice",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_select.jarvis_voice",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 390,
"y": 120,
"wires": [
[
"a75651492e779bfc"
]
]
},
{
"id": "74bb3d48dd17bef9",
"type": "mqtt out",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "MQTT Publish",
"topic": "house/scheduling/tina/work_today",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 1000,
"y": 340,
"wires": []
},
{
"id": "b49f0642ce0153c6",
"type": "mqtt out",
"z": "3e4ba157b540d183",
"g": "6e83103b5c5311e9",
"name": "MQTT Publish",
"topic": "house/jarvis/voice",
"qos": "2",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "fd29421fc00140a8",
"x": 840,
"y": 60,
"wires": []
},
{
"id": "486bca43ddc48fb8",
"type": "change",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "",
"rules": [
{
"t": "set",
"p": "tinawork",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 340,
"wires": [
[
"74bb3d48dd17bef9"
]
]
},
{
"id": "a75651492e779bfc",
"type": "change",
"z": "3e4ba157b540d183",
"g": "6e83103b5c5311e9",
"name": "",
"rules": [
{
"t": "set",
"p": "#:(diskCon)::jarvis_voice",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 620,
"y": 60,
"wires": [
[
"b49f0642ce0153c6"
]
]
},
{
"id": "a09f10883f07aad0",
"type": "server-state-changed",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "MB Aircon Installed",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.master_bedroom_aircon_installed"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 170,
"y": 620,
"wires": [
[
"a8d7f5e5d4f549b0"
]
]
},
{
"id": "464e9271285f8450",
"type": "api-current-state",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "MB Aircon Installed",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.master_bedroom_aircon_installed",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 350,
"y": 700,
"wires": [
[
"a8d7f5e5d4f549b0"
]
]
},
{
"id": "9c8056404bfcafed",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 700,
"wires": [
[
"464e9271285f8450"
]
]
},
{
"id": "a8d7f5e5d4f549b0",
"type": "change",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "",
"rules": [
{
"t": "set",
"p": "#:(diskCon)::masterBedroom.aircon.installed",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 620,
"wires": [
[]
]
},
{
"id": "04fdddae578ee136",
"type": "alexa-remote-event",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "",
"account": "be975ce229701797",
"event": "ws-device-activity",
"x": 150,
"y": 1000,
"wires": [
[
"266634bf3c6019c8",
"f9bc4d36a0df7947"
]
]
},
{
"id": "266634bf3c6019c8",
"type": "function",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "Set Global Variables",
"func": "const name = msg.payload.name\nconst serial = msg.payload.deviceSerialNumber\nlet entityId = '{}'\n\nif (name === 'Basement Echo Dot') {\n entityId = 'media_player.basement_echo_dot'\n} else if (name === 'Living Room Echo Dot') {\n entityId = 'media_player.living_room_echo_dot'\n} else if (name === 'Master Bedroom Echo Dot') {\n entityId = 'media_player.master_bedroom_echo_dot'\n}\n\nlet nameMsg = {\n \"payload\": name\n}\nlet serialMsg = {\n \"payload\": serial\n}\nlet entityMsg = {\n \"payload\": entityId\n}\n\nglobal.set('lastAlexaName',name)\nglobal.set('lastAlexaEntityId',entityId)\nglobal.set('lastAlexaSerial',serial)\n\nnode.status({fill:\"green\",shape:\"dot\",text:name});\n\nreturn[nameMsg,serialMsg,entityMsg];",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 1000,
"wires": [
[
"4560584de593b5c1"
],
[
"488e4f61d16705d4"
],
[
"1f3142828a586d08"
]
],
"outputLabels": [
"Name",
"Serial",
"Entity ID"
],
"icon": "font-awesome/fa-globe"
},
{
"id": "4560584de593b5c1",
"type": "ha-sensor",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "Name",
"entityConfig": "4118a859da3ae01f",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 610,
"y": 940,
"wires": [
[]
]
},
{
"id": "488e4f61d16705d4",
"type": "ha-sensor",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "Serial",
"entityConfig": "790a5433342e7eb5",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 610,
"y": 1000,
"wires": [
[]
]
},
{
"id": "1f3142828a586d08",
"type": "ha-sensor",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "Entity ID",
"entityConfig": "4d3001dabc174efe",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 620,
"y": 1060,
"wires": [
[]
]
},
{
"id": "f9bc4d36a0df7947",
"type": "debug",
"z": "3e4ba157b540d183",
"g": "931cc27100c9317e",
"name": "Alexa Activities",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 360,
"y": 1080,
"wires": []
},
{
"id": "d2c017d8f8c1dc68",
"type": "subflow:7cc13ada.b6712c",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "",
"env": [
{
"name": "start",
"value": "15:00",
"type": "str"
},
{
"name": "stop",
"value": "17:00",
"type": "str"
}
],
"x": 920,
"y": 500,
"wires": [
[
"5f0f296e4f242dfe"
],
[
"80fcb34c004369e7"
]
]
},
{
"id": "7a6299413cbbbdcf",
"type": "api-render-template",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Offset Before",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 5400) | timestamp_custom('%H:%M', false) }}",
"resultsLocation": "start",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 410,
"y": 460,
"wires": [
[
"92c97bdd3ffb345d"
]
]
},
{
"id": "92c97bdd3ffb345d",
"type": "api-render-template",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Offset After",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') + 900) | timestamp_custom('%H:%M', false) }}",
"resultsLocation": "stop",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 590,
"y": 460,
"wires": [
[
"1fd2518454b8b8a1"
]
]
},
{
"id": "1fd2518454b8b8a1",
"type": "function",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Times",
"func": "msg.payload = {\n \"start\": msg.start,\n \"stop\": msg.stop,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n}\nmsg.topic = \"override\"\nnode.status({fill:\"green\",shape:\"dot\",text:msg.start + \" - \" + msg.stop});\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 760,
"y": 460,
"wires": [
[
"d2c017d8f8c1dc68"
]
],
"icon": "font-awesome/fa-clock-o"
},
{
"id": "cc54107a01eca8c2",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Schedule on Reboot",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 520,
"wires": [
[
"7a6299413cbbbdcf"
]
]
},
{
"id": "80fcb34c004369e7",
"type": "change",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Off",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1035,
"y": 500,
"wires": [
[
"d2d529b327823c22"
]
],
"l": false
},
{
"id": "5f0f296e4f242dfe",
"type": "change",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "On",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "on",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1035,
"y": 440,
"wires": [
[
"d2d529b327823c22"
]
],
"l": false
},
{
"id": "d2d529b327823c22",
"type": "ha-binary-sensor",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Tina Work Start Zone",
"entityConfig": "3577b1d6ba521c18",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1200,
"y": 480,
"wires": [
[]
]
},
{
"id": "b6cb206d9cb34610",
"type": "subflow:7cc13ada.b6712c",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "",
"env": [
{
"name": "start",
"value": "15:00",
"type": "str"
},
{
"name": "stop",
"value": "17:00",
"type": "str"
}
],
"x": 920,
"y": 280,
"wires": [
[
"149704b9f6497881"
],
[
"1e1eb662bad16e38"
]
]
},
{
"id": "1e1eb662bad16e38",
"type": "change",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Off",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1035,
"y": 280,
"wires": [
[
"8fe032f757ed2b62"
]
],
"l": false
},
{
"id": "149704b9f6497881",
"type": "change",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "On",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "on",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1035,
"y": 220,
"wires": [
[
"8fe032f757ed2b62"
]
],
"l": false
},
{
"id": "8fe032f757ed2b62",
"type": "ha-binary-sensor",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Tina Work End Zone",
"entityConfig": "e5f345a03a1ef184",
"version": 0,
"state": "payload",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1200,
"y": 260,
"wires": [
[]
]
},
{
"id": "15f7382daddb4b3e",
"type": "function",
"z": "3e4ba157b540d183",
"g": "385f03591bc34bcc",
"name": "Set Global Variables",
"func": "const temp = msg.temperature\nconst tempInt = parseInt(temp)\nconst tempFloat = parseFloat(temp).toFixed(1)\n\nglobal.set('outdoorTemp.tempInt',tempInt)\nglobal.set('outdoorTemp.tempFloat',tempFloat)\nglobal.set('outdoorTemp.tempStr',temp)\n\nnode.status({fill:\"green\",shape:\"dot\",text:`Int: ${tempInt} | Float: ${tempFloat} | Str: ${temp}`})",
"outputs": 0,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 540,
"y": 1180,
"wires": []
},
{
"id": "ec5628079748bafe",
"type": "function",
"z": "3e4ba157b540d183",
"name": "Constants",
"func": "// Set options here\nconst dynamicRooms = [\"living_room\",\"basement_studio\"]\nconst tvRooms = [\"living_room\",\"basement\",\"basement_studio\",\"master_bedroom\"]\n\n// Commit those options to global context\nglobal.set(\"dynamicRooms\", dynamicRooms, \"diskCon\")\nglobal.set(\"tvRooms\", tvRooms, \"diskCon\")\n\nnode.status({fill:\"green\",shape:\"dot\",text:\"Saved\"});",
"outputs": 0,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1200,
"y": 620,
"wires": []
},
{
"id": "430d9054095580f1",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "fc9cdd0818afd119",
"name": "",
"props": [
{
"p": "tony",
"v": "c3909d27048140729f002aaef0391775",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "30",
"topic": "",
"x": 130,
"y": 1280,
"wires": [
[
"7b2670a81b8d3967"
]
]
},
{
"id": "7b2670a81b8d3967",
"type": "function",
"z": "3e4ba157b540d183",
"g": "fc9cdd0818afd119",
"name": "User ID List",
"func": "let userIDList = {\n \"c3909d27048140729f002aaef0391775\": {\n \"shortName\": \"tony\",\n \"firstName\": \"Tony\",\n \"lastName\": \"Stork\",\n \"hassUser\": \"tonystork\"\n },\n \"f387a983651a4321a7411ff8cf36f949\": {\n \"shortName\": \"tina\",\n \"firstName\": \"Christina\",\n \"lastName\": \"Stork\",\n \"hassUser\": \"christinastork\"\n },\n \"879b4c04e32841b3ad1d2763a11b4e70\": {\n \"shortName\": \"kallen\",\n \"firstName\": \"Kallen\",\n \"lastName\": \"Stork\",\n \"hassUser\": \"kallenstork\"\n }\n}\n\nglobal.set(\"userIDList\",userIDList,\"diskCon\")",
"outputs": 0,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 1280,
"wires": [],
"icon": "font-awesome/fa-user"
},
{
"id": "274be2385ae894ce",
"type": "api-render-template",
"z": "3e4ba157b540d183",
"g": "385f03591bc34bcc",
"name": "",
"server": "9e87348d.9c1c48",
"version": 0,
"template": "{% set temps = [\n states.sensor.home_tempest_temperature,\n states.sensor.kdfi_temperature,\n states.sensor.pirateweather_temperature,\n states.sensor.openweathermap_temperature,\n states.sensor.home_temperature\n] %}\n{% set sensor = temps | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}\n{{ states(sensor) | float }}\n",
"resultsLocation": "temperature",
"resultsLocationType": "msg",
"templateLocation": "",
"templateLocationType": "none",
"x": 320,
"y": 1180,
"wires": [
[
"15f7382daddb4b3e"
]
]
},
{
"id": "706c517f3575c162",
"type": "server-state-changed",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "Emma Aircon Installed",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"input_boolean.emma_bedroom_aircon_installed"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 180,
"y": 760,
"wires": [
[
"738e35a2f51ff0e0"
]
]
},
{
"id": "4a507797422a5369",
"type": "api-current-state",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "Emma Aircon Installed",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.emma_bedroom_aircon_installed",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 360,
"y": 840,
"wires": [
[
"738e35a2f51ff0e0"
]
]
},
{
"id": "a232c2f584013596",
"type": "inject",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "120",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 840,
"wires": [
[
"4a507797422a5369"
]
]
},
{
"id": "738e35a2f51ff0e0",
"type": "change",
"z": "3e4ba157b540d183",
"g": "265593f442864b6a",
"name": "",
"rules": [
{
"t": "set",
"p": "#:(diskCon)::emmaBedroom.aircon.installed",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 760,
"wires": [
[]
]
},
{
"id": "cc6386853b678420",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "385f03591bc34bcc",
"name": "Every Minute",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "minute",
"topic": "minute",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 */1 * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 150,
"y": 1180,
"wires": [
[
"274be2385ae894ce"
]
]
},
{
"id": "b3ff9d6b11d09cc9",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Schedule",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "morning",
"topic": "work_schedule",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 58 3 * * ? *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 150,
"y": 460,
"wires": [
[
"7a6299413cbbbdcf"
]
]
},
{
"id": "1e11dbd040532f1b",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "off",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "work_off",
"topic": "work_off",
"payloadType": "str",
"payload": "off",
"expressionType": "cron",
"expression": "0 0 1 * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 610,
"y": 400,
"wires": [
[
"486bca43ddc48fb8"
]
]
},
{
"id": "2a12efb509915160",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Every Minute",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "minute",
"topic": "minute",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 */1 * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 750,
"y": 300,
"wires": [
[
"b6cb206d9cb34610"
]
]
},
{
"id": "b8ee23476d011484",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Every Minute",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "minute",
"topic": "minute",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 */1 * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 750,
"y": 520,
"wires": [
[
"d2c017d8f8c1dc68"
]
]
},
{
"id": "38adc9ec21c2287d",
"type": "cronplus",
"z": "3e4ba157b540d183",
"name": "Update",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "hour",
"topic": "hour",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 0 * * * ? *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 960,
"y": 620,
"wires": [
[
"ec5628079748bafe"
]
]
},
{
"id": "edb4d8fcc9fe02e0",
"type": "cronplus",
"z": "3e4ba157b540d183",
"g": "5c50443a84910fb7",
"name": "Set Schedule",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "set_schedule",
"topic": "set_schedule",
"payloadType": "date",
"payload": "",
"expressionType": "cron",
"expression": "0 0 6 * * ? *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 150,
"y": 240,
"wires": [
[
"31ce8ad28dd41226"
]
]
},
{
"id": "e038489eca14b1dd",
"type": "discordMessage",
"z": "d3dcbe534743b01d",
"name": "",
"token": "fd929ec3bfbeef1a",
"x": 180,
"y": 200,
"wires": [
[
"a8a7658145e92c1d",
"e05ecd981929376b"
]
]
},
{
"id": "e5f2798df4bf16d6",
"type": "debug",
"z": "d3dcbe534743b01d",
"name": "debug-pass",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 530,
"y": 60,
"wires": []
},
{
"id": "a8a7658145e92c1d",
"type": "switch",
"z": "d3dcbe534743b01d",
"name": "",
"property": "member.roles",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "1002314506271203509",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": true,
"outputs": 2,
"x": 350,
"y": 200,
"wires": [
[
"e5f2798df4bf16d6",
"8a2f04665191a1a7"
],
[
"7742083919fb7b59"
]
]
},
{
"id": "7742083919fb7b59",
"type": "debug",
"z": "d3dcbe534743b01d",
"name": "debug-fail",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 520,
"y": 100,
"wires": []
},
{
"id": "c2b9267e3ea81cd4",
"type": "discordMessageManager",
"z": "d3dcbe534743b01d",
"d": true,
"name": "",
"channel": "",
"token": "fd929ec3bfbeef1a",
"x": 750,
"y": 280,
"wires": [
[]
]
},
{
"id": "8a2f04665191a1a7",
"type": "change",
"z": "d3dcbe534743b01d",
"d": true,
"name": "",
"rules": [
{
"t": "set",
"p": "channel",
"pt": "msg",
"to": "1002320534614323260",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Farts are fun",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 520,
"y": 260,
"wires": [
[
"c2b9267e3ea81cd4"
]
]
},
{
"id": "d777145b11649c65",
"type": "debug",
"z": "d3dcbe534743b01d",
"name": "debug-lights",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1470,
"y": 320,
"wires": []
},
{
"id": "e05ecd981929376b",
"type": "switch",
"z": "d3dcbe534743b01d",
"name": "Permissions",
"property": "member.roles",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "1002314506271203509",
"vt": "str"
}
],
"checkall": "true",
"repair": true,
"outputs": 1,
"x": 370,
"y": 420,
"wires": [
[
"76d4b57e3b98e799"
]
]
},
{
"id": "76d4b57e3b98e799",
"type": "change",
"z": "d3dcbe534743b01d",
"name": "Prepare service data",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$split($trim($lowercase(payload)), \" \", 3)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 420,
"wires": [
[
"64a02909ab4707e0"
]
]
},
{
"id": "64a02909ab4707e0",
"type": "switch",
"z": "d3dcbe534743b01d",
"name": "Service selection",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "light",
"vt": "str"
},
{
"t": "eq",
"v": "temperature",
"vt": "str"
},
{
"t": "eq",
"v": "humidity",
"vt": "str"
},
{
"t": "eq",
"v": "help",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 810,
"y": 420,
"wires": [
[
"97bc11edf2480435"
],
[],
[],
[]
]
},
{
"id": "97bc11edf2480435",
"type": "change",
"z": "d3dcbe534743b01d",
"name": "Prepare light entity",
"rules": [
{
"t": "set",
"p": "payload[1]",
"pt": "msg",
"to": "$string(payload[0]) & \" \" & $string(payload[1]) & \" \" & $string(payload[2])",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload[0]",
"pt": "msg",
"to": "light",
"tot": "str"
},
{
"t": "change",
"p": "payload[1]",
"pt": "msg",
"from": "studio",
"fromt": "str",
"to": "basement_studio_lights",
"tot": "str"
},
{
"t": "change",
"p": "payload[2]",
"pt": "msg",
"from": "off",
"fromt": "str",
"to": "turn_off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1030,
"y": 380,
"wires": [
[
"c56e681e1210b7fb"
]
]
},
{
"id": "c56e681e1210b7fb",
"type": "template",
"z": "d3dcbe534743b01d",
"name": "Format service data",
"field": "payload",
"fieldType": "msg",
"format": "json",
"syntax": "mustache",
"template": "{\n \"action\": \"{{payload.0}}.{{payload.2}}\",\n \"data\": {\"entity_id\":\"{{payload.1}}\"}\n}",
"output": "json",
"x": 1260,
"y": 380,
"wires": [
[
"34bfc4d501d21f17",
"d777145b11649c65"
]
]
},
{
"id": "34bfc4d501d21f17",
"type": "api-call-service",
"z": "d3dcbe534743b01d",
"name": "Call light service",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 1480,
"y": 380,
"wires": [
[]
]
},
{
"id": "6a28a84de488e39d",
"type": "debug",
"z": "d3dcbe534743b01d",
"name": "fs22status",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 560,
"wires": []
},
{
"id": "229adf0d8b27fd7c",
"type": "server-state-changed",
"z": "d3dcbe534743b01d",
"name": "FS22 Server Status",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.win10_vm_processactive"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": true,
"ignorePrevStateUnavailable": true,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 190,
"y": 560,
"wires": [
[
"305cc8b15072569c"
]
]
},
{
"id": "305cc8b15072569c",
"type": "switch",
"z": "d3dcbe534743b01d",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "0",
"vt": "str"
},
{
"t": "eq",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 370,
"y": 560,
"wires": [
[
"69b1f5484ee668b9"
],
[
"d8ace9a59d21cad0"
]
],
"outputLabels": [
"Up",
"Down"
]
},
{
"id": "d9170dbc46fa2c0b",
"type": "discordMessageManager",
"z": "d3dcbe534743b01d",
"name": "Send Message",
"channel": "",
"token": "fd929ec3bfbeef1a",
"x": 740,
"y": 560,
"wires": [
[
"6a28a84de488e39d"
]
]
},
{
"id": "69b1f5484ee668b9",
"type": "change",
"z": "d3dcbe534743b01d",
"name": "Up message",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Farming Simulator 22 server is up and running!",
"tot": "str"
},
{
"t": "set",
"p": "channel",
"pt": "msg",
"to": "912503253973999617",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 530,
"y": 520,
"wires": [
[
"d9170dbc46fa2c0b"
]
]
},
{
"id": "d8ace9a59d21cad0",
"type": "change",
"z": "d3dcbe534743b01d",
"name": "Down message",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Farming Simulator 22 server is down!",
"tot": "str"
},
{
"t": "set",
"p": "channel",
"pt": "msg",
"to": "912503253973999617",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 580,
"wires": [
[
"d9170dbc46fa2c0b"
]
]
},
{
"id": "bf2ad73a.23bdb8",
"type": "change",
"z": "d49b385d8b582b20",
"name": "Save Secret",
"rules": [
{
"t": "set",
"p": "#:(secrets)::secret_id",
"pt": "global",
"to": "secret_value",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1070,
"y": 140,
"wires": [
[]
]
},
{
"id": "5c5c19b4.549de8",
"type": "inject",
"z": "d49b385d8b582b20",
"name": "Press",
"props": [
{
"p": "payload",
"v": "",
"vt": "date"
},
{
"p": "topic",
"v": "",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 910,
"y": 140,
"wires": [
[
"bf2ad73a.23bdb8"
]
]
},
{
"id": "635934334d5cf6a5",
"type": "http request",
"z": "d49b385d8b582b20",
"name": "Get Todoist API Info",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.todoist.com/sync/v9/sync?sync_token='*'&resource_types=[\"all\"]",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "bearer",
"senderr": false,
"headers": [],
"x": 1090,
"y": 80,
"wires": [
[
"c4b9e44cd5ad6448"
]
]
},
{
"id": "c821804b2468d585",
"type": "inject",
"z": "d49b385d8b582b20",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 80,
"wires": [
[
"635934334d5cf6a5"
]
]
},
{
"id": "c4b9e44cd5ad6448",
"type": "debug",
"z": "d49b385d8b582b20",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1270,
"y": 80,
"wires": []
},
{
"id": "2a6fe7c07c6b34e1",
"type": "subflow:3aa2aec226246753",
"z": "d49b385d8b582b20",
"name": "",
"x": 1070,
"y": 200,
"wires": []
},
{
"id": "942304b8743cdd40",
"type": "inject",
"z": "d49b385d8b582b20",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 200,
"wires": [
[
"2a6fe7c07c6b34e1"
]
]
},
{
"id": "59892c31142ac295",
"type": "file",
"z": "d49b385d8b582b20",
"name": "Write to overwolf.txt",
"filename": "/homeassistant/files/overwolf.txt",
"filenameType": "str",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 1150,
"y": 260,
"wires": [
[]
]
},
{
"id": "c80bec9a15b703f6",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 800,
"wires": [
[
"8687551e01cd2045"
]
]
},
{
"id": "8687551e01cd2045",
"type": "function",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "msg_1",
"func": "global.set(\"msg_1\",\"test\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 800,
"wires": [
[]
]
},
{
"id": "103b03c39c8d9cae",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "debug 29",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 500,
"y": 960,
"wires": []
},
{
"id": "c043cba9f34ba574",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 840,
"wires": [
[
"e674c706437cc0f3"
]
]
},
{
"id": "e674c706437cc0f3",
"type": "function",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "msg_2 ",
"func": "global.set(\"msg_2\",\"hello\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 840,
"wires": [
[]
]
},
{
"id": "11f8fb75d4c4e6c0",
"type": "inject",
"z": "d49b385d8b582b20",
"d": true,
"g": "395da9d5d5f7e232",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 960,
"wires": [
[
"1346e34e8c83b2dc"
]
]
},
{
"id": "1346e34e8c83b2dc",
"type": "function",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "check if 2 msg set",
"func": "const msg1 = global.get(\"msg_1\");\nconst msg2 = global.get(\"msg_2\");\n\nif(msg1 && msg2){\n msg.payload=\"both message arrived!\";\n}\nelse{\n msg.payload=\"Nope. Not yet.\";\n}\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 960,
"wires": [
[
"103b03c39c8d9cae"
]
]
},
{
"id": "62d522a844321ef9",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 540,
"y": 800,
"wires": [
[
"6d109daff443dade"
]
]
},
{
"id": "6d109daff443dade",
"type": "function",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "reset",
"func": "global.set(\"msg_1\",null);\nglobal.set(\"msg_2\",null);\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 690,
"y": 800,
"wires": [
[]
]
},
{
"id": "4e1848c867860d5f",
"type": "comment",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "Here gonna auto-run",
"info": "",
"x": 170,
"y": 920,
"wires": []
},
{
"id": "3102e176923a8fad",
"type": "comment",
"z": "d49b385d8b582b20",
"g": "395da9d5d5f7e232",
"name": "Check what if both inject clicked",
"info": "",
"x": 210,
"y": 760,
"wires": []
},
{
"id": "5848c6edf2bd06fe",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "MB Bedtime Mode",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "manual",
"vt": "str"
},
{
"p": "time",
"v": "bedtime",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "manual-bedtime",
"payload": "",
"payloadType": "date",
"x": 250,
"y": 240,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "3bb9755d18f517d6",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Master Bedroom Cooling",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "auto",
"vt": "str"
},
{
"p": "time",
"v": "night",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "mrbedroom-cooling",
"payload": "",
"payloadType": "date",
"x": 230,
"y": 300,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "c52f61fa427a773c",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Master Bedroom Fan",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "auto",
"vt": "str"
},
{
"p": "time",
"v": "night",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "mrbedroom-fan",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 360,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "d71d65c0e52926b1",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Master Bedroom Wakeup",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "auto",
"vt": "str"
},
{
"p": "time",
"v": "day",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "mrbedroom-wakeup",
"payload": "",
"payloadType": "date",
"x": 230,
"y": 420,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "84b00411dee5fc6a",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "MB Night Mode",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "manual",
"vt": "str"
},
{
"p": "time",
"v": "night",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "manual-night",
"payload": "",
"payloadType": "date",
"x": 260,
"y": 480,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "8a4b246d2356d8f4",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "MB Day Mode",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "type",
"v": "manual",
"vt": "str"
},
{
"p": "time",
"v": "day",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "manual-day",
"payload": "",
"payloadType": "date",
"x": 270,
"y": 540,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "d275a12c1817925e",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "AC",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 280,
"wires": []
},
{
"id": "4d9e5c1bade281af",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Fan",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 340,
"wires": []
},
{
"id": "330eaf3afee1c405",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Boolean",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 680,
"y": 400,
"wires": []
},
{
"id": "c59db4f3f0112244",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Notify",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 600,
"wires": []
},
{
"id": "8846ee22051b92cc",
"type": "function",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Meltdown Center",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst toggle = msg.payload\nconst ac = global.get('mb_aircon_installed', \"diskCon\")\nconst lastMode = flow.get(\"lastMode\", \"diskCon\")\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\n\nlet setTemp = bedTemp\nlet setEco = 'none'\nlet setHvac = 'cool'\nlet setAcFan = 'High'\nlet setFan = 'turn_off'\n\nlet sendFan = {\n \"payload\": {\n \"action\": `fan.${setFan}`,\n \"target\": {\n \"entity_id\": [\"fan.master_bedroom_fan\"]\n },\n \"data\": {}\n }\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": \"climate.set_preset_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"preset_mode\": setEco\n }\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"fan_mode\": setAcFan\n }\n }\n}\n\nlet reset = {\n \"topic\": \"Reset\"\n}\n\nif (toggle === 'on') {\n node.status({fill:\"red\",shape:\"dot\",text:\"DANGER MODE ACTIVE\"})\n node.send([null,sendFan,null])\n if (ac === 'on') {\n node.send([[sendHvac,sendTemp,sendEco,sendTemp],null,null])\n }\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Danger Mode Off\"})\n node.send([null,null,reset])\n}",
"outputs": 3,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 120,
"wires": [
[
"d275a12c1817925e",
"34c4939c3dd1f7d1"
],
[
"4d9e5c1bade281af",
"71f5f2a1557b28ea"
],
[
"b233bf44f92d413d",
"514057723d9662e0"
]
],
"outputLabels": [
"On (AC)",
"On (Fan)",
"Off"
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "4731a08756c9235f",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "on",
"payloadType": "str",
"x": 130,
"y": 100,
"wires": [
[
"8846ee22051b92cc"
]
]
},
{
"id": "62f2704dca41ea4b",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "off",
"payloadType": "str",
"x": 130,
"y": 160,
"wires": [
[
"8846ee22051b92cc"
]
]
},
{
"id": "93072f995377775b",
"type": "function",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Notifications",
"func": "const topic = msg.topic\nconst nightTemp = msg.nighttemp\nconst acMode = msg.acmode\nconst fanMode = msg.fanmode\n\nlet coolMsg = {\n \"payload\": `Master bedroom AC temp has been set to ${nightTemp} °F as scheduled`,\n \"topic\": 'AC Mode: Cooling'\n}\nlet fanOnlyMsg = {\n \"payload\": 'Too cold outside, AC running fan only.',\n \"topic\": \"AC Mode: Fan Only\"\n}\nlet fanSchedMsg = {\n \"payload\": 'Master bedroom fan has been activated as scheduled.',\n \"topic\": 'Fan Schedule Activated'\n}\n\nif (topic === 'mrbedroom-cooling') {\n if (acMode === 'AC') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Cooling\"})\n return coolMsg\n } else if (acMode === 'Fan') {\n node.status({fill:\"green\",shape:\"dot\",text:\"AC Fan Only\"})\n return fanOnlyMsg\n }\n} else if (topic === 'mrbedroom-fan' && fanMode === 'Fan') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Fan Schedule\"})\n return fanSchedMsg\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Notification not sent\"})\n return null\n}",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 690,
"y": 460,
"wires": [
[
"c59db4f3f0112244"
]
]
},
{
"id": "34c4939c3dd1f7d1",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Meltdown AC",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 60,
"wires": []
},
{
"id": "71f5f2a1557b28ea",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Meltdown Fan",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 120,
"wires": []
},
{
"id": "b233bf44f92d413d",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Meltdown Off",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 180,
"wires": []
},
{
"id": "a1020d4eaab8a8e5",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Sleep On",
"props": [
{
"p": "payload"
},
{
"p": "type",
"v": "sleep",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "on",
"payloadType": "str",
"x": 280,
"y": 600,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "7aa9383895c46e30",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Sleep Off",
"props": [
{
"p": "payload"
},
{
"p": "type",
"v": "sleep",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "off",
"payloadType": "str",
"x": 280,
"y": 660,
"wires": [
[
"14181143d23aa423"
]
]
},
{
"id": "401d1612749a4d86",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Reset",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "reset",
"payload": "",
"payloadType": "date",
"x": 290,
"y": 200,
"wires": [
[
"514057723d9662e0"
]
]
},
{
"id": "514057723d9662e0",
"type": "link call",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Reset",
"links": [
"192260163c49816a"
],
"linkType": "static",
"timeout": "30",
"x": 395,
"y": 200,
"wires": [
[
"14181143d23aa423"
]
],
"l": false
},
{
"id": "1df32d98b498c875",
"type": "function",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Reset",
"func": "const lastMode = flow.get('lastMode', \"diskCon\")\nconst linkSource = msg._linkSource\n\nlet setTime = []\nlet setType = []\nlet setTopic = []\n\nif (lastMode === 'day') {\n setTime = 'day'\n setType = 'manual'\n setTopic = 'manual-day'\n} else if (lastMode === 'night') {\n setTime = 'night'\n setType = 'manual'\n setTopic = 'manual-night'\n} else if (lastMode === 'bedtime') {\n setTime = 'bedtime'\n setType = 'manual'\n setTopic = 'manual-bedtime'\n}\n\nlet reset = {\n \"type\": setType,\n \"time\": setTime,\n \"topic\": setTopic,\n \"_linkSource\": linkSource\n}\n\nnode.send(reset)\nnode.status({ fill: \"green\", shape: \"dot\", text: `Mode reset to ${setTopic}`})",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 635,
"y": 640,
"wires": [
[
"79f3ceee718cd7cb"
]
],
"l": false
},
{
"id": "192260163c49816a",
"type": "link in",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "MB Climate Test Reset - In",
"links": [],
"x": 575,
"y": 640,
"wires": [
[
"1df32d98b498c875"
]
]
},
{
"id": "79f3ceee718cd7cb",
"type": "link out",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "MB Climate Test Reset - Out",
"mode": "return",
"links": [],
"x": 695,
"y": 640,
"wires": []
},
{
"id": "c92edf73327c1a2a",
"type": "server-events",
"z": "d49b385d8b582b20",
"name": "Overwolf Events Dump",
"server": "9e87348d.9c1c48",
"version": 3,
"exposeAsEntityConfig": "77ba0ad52b2a9e2e",
"eventType": "overwolf_game_event",
"eventData": "",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"event_type": "",
"x": 920,
"y": 260,
"wires": [
[
"59892c31142ac295"
]
]
},
{
"id": "14181143d23aa423",
"type": "function",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Processing",
"func": "node.log(\"Master Bedroom Climate: Processing Started\")\n// pull in the necessary information\n\nconst states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.master_bedroom_climate_protocol'].state\nconst ac = global.get('mb_aircon_installed', \"diskCon\")\nconst temp = global.get(\"outdoorTemp.tempStr\")\nconst payload = msg.payload\nconst vacation = states['input_boolean.vacation_mode'].state\nconst dayTemp = states['input_number.master_bedroom_daytime_temp'].state\nconst nightTemp = states['input_number.master_bedroom_night_temp'].state\nconst bedTemp = states['input_number.master_bedroom_bedtime_temp'].state\nconst showerMode = states['input_boolean.shower_mode'].state\nconst nightVolume = states['input_number.master_bedroom_echo_dot_night_volume'].state\nconst fanMode = states['input_select.scheduled_climate_mode_master_bedroom_fan'].state\nconst acMode = states['input_select.scheduled_climate_mode_master_bedroom_aircon'].state\nconst sleeping = states['input_boolean.master_bedroom_sleeping'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states[\"binary_sensor.heat_warning\"].state\nconst showerCooldown = states[\"timer.shower_mode_cooldown\"].state\nconst earlyNight = states[\"binary_sensor.early_night_mode\"].state\nconst danger = states['binary_sensor.heat_warning'].attributes.danger\nconst meltdown = states['input_boolean.meltdown_protocol'].state\nconst coolingActive = states['input_boolean.master_bedroom_cooling_on'].state\nconst echoDotDND = 'switch.basement_echo_dot_do_not_disturb_switch'\nnode.log(\"Master Bedroom Climate: Constants Set\")\n\n// Helper function to convert a string to title case\n\nfunction convertToTitleCase(str) {\n if (!str) {\n return \"\";\n }\n return str.toLowerCase().replace(/\\b\\w/g, (s) => s.toUpperCase());\n}\n\n// init variables\n\nlet setTemp = []\nlet setEco = []\nlet setHvac = []\nlet setFan = []\nlet setCool = []\nlet setSleep = []\nlet setPeople = []\nlet setDisplay = []\nlet time = []\nlet echoDotService = []\nlet setBriefing = []\nlet setBriefingDelay = []\nlet type = msg.type\nlet topic = msg.topic\nlet isWakeup = context.get(\"isWakeup\")\nnode.log(\"Master Bedroom Climate: Variables Defined\")\n\n// Sleep Switch Handling\nif (type === 'sleep' && payload === 'off') {\n setDisplay = 'turn_on'\n echoDotService = 'turn_off'\n setPeople = 'turn_on'\n if (coolingActive === 'on') {\n time = 'night'\n } else {\n time = 'day'\n }\n} else if (type === 'sleep' && payload === 'on') {\n setDisplay = 'turn_off'\n echoDotService = 'turn_on'\n time = 'bedtime'\n} else {\n time = msg.time\n}\n\nif (topic === 'mrbedroom-wakeup') {\n setSleep = 'turn_off'\n}\n\n// Setup TTS briefing\nif (topic === 'mrbedroom-wakeup') {\n setBriefing = \"master_bedroom_wakeup_briefing\"\n setBriefingDelay = 60000\n} else if (type === 'sleep' && payload === 'off') {\n setBriefing = \"master_bedroom_wakeup_briefing\"\n setBriefingDelay = 15000\n}\n\n// Day Time\nif (time === 'day') {\n if (type === 'auto') {\n setCool = 'turn_off'\n }\n if (earlyNight === 'off') {\n setFan = \"turn_off\"\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp = nightTemp\n setEco = \"eco\"\n setHvac = \"cool\"\n } else if (hotDay === 'on' || heatWarning === 'on') {\n setTemp = dayTemp\n setEco = \"eco\"\n setHvac = \"cool\"\n } else {\n setTemp = nightTemp\n setEco = \"eco\"\n setHvac = \"off\"\n }\n }\n } else if (earlyNight === 'on') {\n if (ac === 'on') {\n if (danger === 'Extreme') {\n setTemp === bedTemp\n } else {\n setTemp = nightTemp\n }\n if (fanMode === 'Fan') {\n setFan = 'turn_on'\n } else {\n setFan = 'turn_off'\n }\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n if (hotDay === 'on') {\n setEco = 'none'\n } else {\n setEco = 'eco'\n }\n }\n }\n// Night Time\n} else if (time === 'night') {\n // If this is being run at scheduled time, turn on input_boolean.master_bedroom_cooling_on\n if (type === 'auto') {\n setCool = 'turn_on'\n }\n // Decide temperature\n if (type === 'sleep' && payload === 'off') {\n setTemp = dayTemp\n } else if (danger === 'Extreme') {\n setTemp = bedTemp\n } else {\n setTemp = nightTemp\n }\n // Decide eco mode\n if (sleeping === 'on') {\n setEco = 'none'\n } else {\n setEco = 'eco'\n }\n // Decide HVAC mode\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'Fan') {\n setHvac = 'fan_only'\n } else {\n setHvac = 'off'\n }\n // Decide fan on/off\n if (type === 'sleep' && payload === 'off') {\n setFan = 'turn_off'\n } else if (fanMode === 'Fan') {\n setFan = 'turn_on'\n }\n// Bed Time\n} else if (time === 'bedtime') {\n setPeople = 'turn_off'\n if (ac === 'on') {\n setTemp = bedTemp\n setEco = 'none'\n if (acMode === 'AC') {\n setHvac = 'cool'\n } else if (acMode === 'Fan') {\n setHvac = \"fan_only\"\n } else {\n setHvac = \"off\"\n }\n }\n if (fanMode === 'Fan') {\n setFan = 'turn_on'\n } else {\n setFan = 'turn_off'\n }\n}\nnode.log(\"Master Bedroom Climate: Decision Logic Complete\")\n\n// Define message payloads\n\nlet sendFan = {\n \"payload\": {\n \"action\": `fan.${setFan}`,\n \"target\": {\n \"entity_id\": [\"fan.master_bedroom_fan\"]\n },\n \"data\": {}\n }\n}\n\nlet sendCool = {\n \"payload\": {\n \"action\": `input_boolean.${setCool}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.master_bedroom_cooling_on\"]\n },\n \"data\": {}\n }\n}\n\nlet sendSleep = {\n \"payload\": {\n \"action\": `input_boolean.${setSleep}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.master_bedroom_sleeping\"]\n },\n \"data\": {}\n }\n}\n\nlet sendPeople = {\n \"payload\": {\n \"action\": `input_boolean.${setPeople}`,\n \"target\": {\n \"entity_id\": [\"input_boolean.tony_awake\",\"input_boolean.tina_awake\"]\n },\n \"data\": {}\n }\n}\n\nlet sendDisplay = {\n \"payload\": {\n \"action\": `switch.${setDisplay}`,\n \"target\": {\n \"entity_id\": [\"switch.master_bedroom_aircon_display\"]\n },\n \"data\": {}\n }\n}\n\nlet notify = {\n \"topic\": topic,\n \"nighttemp\": nightTemp,\n \"acmode\": acMode,\n \"fanmode\": fanMode\n}\n\nlet sendBriefing = {\n \"payload\": {\n \"action\": `script.${setBriefing}`,\n },\n \"delay\": setBriefingDelay\n}\n\nlet sendHvac = {\n \"payload\": {\n \"action\": \"climate.set_hvac_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"hvac_mode\": setHvac\n }\n }\n}\n\nlet sendTemp = {\n \"payload\": {\n \"action\": \"climate.set_temperature\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"temperature\": setTemp\n }\n }\n}\n\nlet sendEco = {\n \"payload\": {\n \"action\": \"climate.set_preset_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"preset_mode\": setEco\n }\n }\n}\n\nlet sendAcFan = {\n \"payload\": {\n \"action\": \"climate.set_fan_mode\",\n \"target\": {\n \"entity_id\": [\"climate.master_bedroom_aircon\"]\n },\n \"data\": {\n \"fan_mode\": \"auto\"\n }\n }\n}\n\nlet sendEchoDotDND = {\n \"payload\": {\n \"action\": `switch.${echoDotService}`,\n \"target\": {\n \"entity_id\": [\"switch.basement_echo_dot_do_not_disturb_switch\"]\n },\n \"data\": {}\n }\n}\n\nnode.log(\"Master Bedroom Climate: Message Payloads Defined\")\n\n// Log the parameters that were chosen, for debugging purposes\n\nnode.log(\"----- Master Bedroom Climate: Set Parameters -----\")\nnode.log(`setTemp: ${setTemp}`)\nnode.log(`setEco: ${setEco}`)\nnode.log(`setHvac: ${setHvac}`)\nnode.log(`setFan: ${setFan}`)\nnode.log(`setCool: ${setCool}`)\nnode.log(`setSleep: ${setSleep}`)\nnode.log(`setPeople: ${setPeople}`)\nnode.log(`setDisplay: ${setDisplay}`)\nnode.log(`setBriefing: ${setBriefing}`)\nnode.log(`setBriefingDelay: ${setBriefingDelay}`)\nnode.log(`time: ${time}`)\nnode.log(`type: ${type}`)\nnode.log(`topic: ${topic}`)\nnode.log(\"----- Master Bedroom Climate: End Parameters -----\")\n\n// If this was an automated trigger, set the cooling context for the bedroom accordingly.\n\nif (type === 'auto' && time != 'bedtime') {\n node.send([null, null, sendCool, null, null])\n node.log(\"Master Bedroom Climate: Cooling Context Set\")\n}\n\n// Automated responses\nif (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'off') {\n node.log(\"Master Bedroom Climate: Auto\")\n if (sleeping === 'on' && topic != 'mrbedroom-wakeup') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (sleep mode)\" })\n node.log(\"Master Bedroom Climate: Blocked (sleep mode)\")\n } else {\n if (topic === 'mrbedroom-cooling' && ac === 'on') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Cooling Schedule\" })\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Cooling\")\n } else if (topic === 'mrbedroom-bedtime') {\n node.send([null, null, sendPeople, null, null])\n node.status({ fill: \"green\", shape: \"dot\", text: \"Bedtime\" })\n node.log(\"Master Bedroom Climate: Auto/Bedtime\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Bedtime/AC\")\n }\n if (fanMode === 'fan') {\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Bedtime/Fan\")\n }\n } else if (topic === 'mrbedroom-fan' && fanMode === 'Fan') {\n node.status({ fill: \"green\", shape: \"dot\", text: \"Fan Schedule\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Fan\")\n } else if (topic === 'mrbedroom-wakeup') {\n node.send([null, null, null, null, sendBriefing])\n node.status({ fill: \"green\", shape: \"dot\", text: \"Wakeup Schedule\" })\n node.log(\"Master Bedroom Climate: Auto/Wakeup\")\n if (sleeping === 'off') {\n context.set(\"isWakeup\", false)\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/Sleep Off\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/AC On\")\n }\n } else if (sleeping === 'on') {\n context.set(\"isWakeup\", true)\n node.send([null, null, sendSleep, null, null])\n node.log(\"Master Bedroom Climate: Auto/Wakeup/Sleep On\")\n }\n }\n }\n// Manual Responses\n} else if (type === 'manual') {\n node.log(\"Master Bedroom Climate: Manual\")\n if (time === 'night') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Night\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Night\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Night/AC\")\n }\n } else if (time === 'day') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Day\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Day\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Day/AC\")\n }\n } else if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Manual Bedtime\" })\n node.send([null, sendFan, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Bedtime\")\n if (ac === 'on') {\n node.send([[sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Manual/Bedtime/AC\")\n }\n }\n context.set(\"isWakeup\", false)\n// Sleep Switch Responses\n} else if (type === 'sleep') {\n if (payload === 'off') {\n node.send([null, null, sendPeople, null, null])\n }\n node.log(\"Master Bedroom Climate: Sleep\")\n if (time === 'bedtime') {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Sleep\" })\n node.send([null, sendFan, [sendEchoDotDND,sendPeople], null, null])\n node.log(\"Master Bedroom Climate: Sleep/Bedtime\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(\"Master Bedroom Climate: Sleep/Bedtime/AC\")\n }\n } else {\n node.status({ fill: \"blue\", shape: \"dot\", text: \"Wakeup\" })\n node.send([null, sendFan, sendEchoDotDND, null, null])\n node.log(\"Master Bedroom Climate: Sleep/Day\")\n if (ac === 'on') {\n node.send([[sendDisplay, sendHvac, sendTemp, sendEco, sendAcFan], null, null, null, null])\n node.log(`Master Bedroom Climate: Sleep/${convertToTitleCase(time)}/AC`)\n }\n if (time === 'day' && isWakeup === false) {\n node.send([null, null, null, null, sendBriefing])\n }\n }\n context.set(\"isWakeup\", false)\n} else if (meltdown === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Meltdown Protocol)\" })\n node.log(\"Master Bedroom Climate: Blocked (Meltdown Protocol)\")\n} else if (vacation === 'on') {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Vacation Mode)\" })\n node.log(\"Master Bedroom Climate: Blocked (Vacation Mode)\")\n} else {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Blocked (Automation Disabled)\" })\n node.log(\"Master Bedroom Climate: Blocked (Automation Disabled)\")\n}\n\nnode.log(\"Master Bedroom Climate: Processing Complete\")\n",
"outputs": 5,
"timeout": "",
"noerr": 0,
"initialize": "context.set(\"isWakeup\", false)",
"finalize": "",
"libs": [],
"x": 490,
"y": 380,
"wires": [
[
"d275a12c1817925e"
],
[
"4d9e5c1bade281af"
],
[
"330eaf3afee1c405"
],
[
"93072f995377775b"
],
[
"f9e1aec6c25f6480"
]
],
"outputLabels": [
"A/C",
"Fan",
"Boolean",
"Notify",
"Briefing"
],
"icon": "node-red-contrib-cpu/cpu.png"
},
{
"id": "f9e1aec6c25f6480",
"type": "delay",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "Delay",
"pauseType": "delayv",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 575,
"y": 520,
"wires": [
[
"0693239363c59c3e"
]
],
"l": false
},
{
"id": "0693239363c59c3e",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "TTS",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 520,
"wires": []
},
{
"id": "44b7eabdec8197a3",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c3dc29879117218b",
"name": "reset",
"props": [
{
"p": "reset",
"v": "",
"vt": "date"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 470,
"y": 580,
"wires": [
[
"f9e1aec6c25f6480"
]
]
},
{
"id": "1a2b9228fd8343b7",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "c098aadcd6f83f58",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 360,
"wires": [
[
"f614d201285aac68"
]
]
},
{
"id": "f614d201285aac68",
"type": "function",
"z": "d49b385d8b582b20",
"g": "c098aadcd6f83f58",
"name": "Get Context",
"func": "const testContext = global.get(\"outdoorTemp.tempStr\")\nconst activeScene = global.get(\"activeScene\",\"diskCon\")\n\nmsg.payload = testContext\n\n// Debugging: Log the structure of activeScene\nnode.warn(`activeScene: ${JSON.stringify(activeScene)}`)\n\nif (activeScene && activeScene.hasOwnProperty('basement_studio')) {\n msg.basement = activeScene.basement_studio\n} else {\n msg.basement = null // or provide a default value\n node.warn(\"basement_studio is undefined or not present in activeScene\")\n}\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1070,
"y": 360,
"wires": [
[
"9e59e83b39d1ce29"
]
]
},
{
"id": "9e59e83b39d1ce29",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "c098aadcd6f83f58",
"name": "Context Tester Output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1280,
"y": 360,
"wires": []
},
{
"id": "d812ee2f617dd583",
"type": "api-get-history",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "",
"server": "9e87348d.9c1c48",
"version": 1,
"startDate": "",
"endDate": "",
"entityId": "input_select.basement_studio_scenes",
"entityIdType": "equals",
"useRelativeTime": true,
"relativeTime": "8 hours",
"flatten": true,
"outputType": "array",
"outputLocationType": "msg",
"outputLocation": "payload",
"x": 1060,
"y": 460,
"wires": [
[
"d8facf95084f1638"
]
]
},
{
"id": "d417bebd83c3e0fe",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 460,
"wires": [
[
"d812ee2f617dd583"
]
]
},
{
"id": "a89d872a45eae06c",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "Get History Tester Output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1430,
"y": 460,
"wires": []
},
{
"id": "d8facf95084f1638",
"type": "function",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "Filter",
"func": "let states = msg.payload\n\nlet filteredStates = states.filter(function(item) {\n if (item.state) {\n let itemState = item.state\n return itemState != 'Select'\n }\n})\n\nmsg.filtered = filteredStates\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1210,
"y": 460,
"wires": [
[
"a89d872a45eae06c"
]
]
},
{
"id": "3696700bebc8823a",
"type": "cronplus",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "fanOut",
"defaultLocation": "41.28173561740492 -84.36918631196022",
"defaultLocationType": "fixed",
"outputs": 4,
"options": [
{
"name": "schedule1",
"topic": "topic1",
"payloadType": "global",
"payload": "outdoorTemp",
"expressionType": "cron",
"expression": "*/30 * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
},
{
"name": "schedule2",
"topic": "topic2",
"payloadType": "default",
"payload": "",
"expressionType": "solar",
"expression": "0 * * * * * *",
"location": "",
"offset": "0",
"solarType": "selected",
"solarEvents": "sunriseEnd,sunsetStart"
}
],
"x": 920,
"y": 660,
"wires": [
[
"ed094c20ad524768"
],
[
"cafa8a6b489484b7"
],
[
"2f01ee1169769867"
],
[
"4d4d04563f14bf1e"
]
]
},
{
"id": "ed094c20ad524768",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "debug 1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 560,
"wires": []
},
{
"id": "cafa8a6b489484b7",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "debug 2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 620,
"wires": []
},
{
"id": "2f01ee1169769867",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "debug 3",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 680,
"wires": []
},
{
"id": "4d4d04563f14bf1e",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "debug 4",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 740,
"wires": []
},
{
"id": "ac3afbb7.56f7a8",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "describe 0 */5 * * * MON *",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"command\":\"describe\",\"expression\":\"0 */5 * * * MON *\"}",
"payloadType": "json",
"x": 1230,
"y": 840,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "65892a57.612d44",
"type": "cronplus",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output2",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 2,
"options": [
{
"name": "e15",
"topic": "Every 15",
"payloadType": "default",
"payload": "",
"expressionType": "cron",
"expression": "0 15,30,45 * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
},
{
"name": "noon",
"topic": "noon",
"payloadType": "default",
"payload": "",
"expressionType": "cron",
"expression": "0 0 12 * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 1260,
"y": 1140,
"wires": [
[
"8a452815.9ceb68"
],
[
"e60daf12.48c83"
]
]
},
{
"id": "e55fda59.f37f18",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Get list of schedules",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "list-all",
"payload": "",
"payloadType": "date",
"x": 1210,
"y": 920,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "8a452815.9ceb68",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Sched Trigger",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 1100,
"wires": []
},
{
"id": "e60daf12.48c83",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Control Reply",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 1140,
"wires": []
},
{
"id": "16c930f5.ec3a9f",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "add every 6 (maxCount 3)",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "add",
"payload": "{\"command\":\"add\",\"name\":\"every 6\",\"expression\":\"*/6 * * * * * *\",\"type\":\"default\",\"limit\":3}",
"payloadType": "json",
"x": 950,
"y": 980,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "ad104abb.fc4a28",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "remove every 6",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "remove every 6",
"payload": "{\"command\": \"remove\", \"name\":\"every 6\"}",
"payloadType": "json",
"x": 920,
"y": 1020,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "9126a056.6de91",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "stop every 6",
"props": [
{
"p": "payload",
"v": "{\"command\": \"stop\", \"name\":\"every 6\"}",
"vt": "json"
},
{
"p": "topic",
"v": "",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"command\": \"stop\", \"name\":\"every 6\"}",
"payloadType": "json",
"x": 910,
"y": 1060,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "e8abe66.6a0aa18",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "pause every 6",
"props": [
{
"p": "payload",
"v": "{\"command\": \"pause\", \"name\":\"every 6\"}",
"vt": "json"
},
{
"p": "topic",
"v": "",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"command\": \"pause\", \"name\":\"every 6\"}",
"payloadType": "json",
"x": 910,
"y": 1100,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "9e8a3202.ae3d9",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "add every 8",
"props": [
{
"p": "payload",
"v": "{\"command\":\"add\",\"name\":\"every 8\",\"expression\":\"*/8 * * * * * *\",\"payload\":\"hi every 8\",\"type\":\"str\"}",
"vt": "json"
},
{
"p": "topic",
"v": "_ignore_",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "_ignore_",
"payload": "{\"command\":\"add\",\"name\":\"every 8\",\"expression\":\"*/8 * * * * * *\",\"payload\":\"hi every 8\",\"type\":\"str\"}",
"payloadType": "json",
"x": 910,
"y": 840,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "276fbb6f.b78e94",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "remove every 8",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "remove",
"payload": "every 8",
"payloadType": "str",
"x": 920,
"y": 880,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "540f9bdc.808cf4",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "start every 6",
"props": [
{
"p": "payload",
"v": "every 6",
"vt": "str"
},
{
"p": "topic",
"v": "start",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "start",
"payload": "every 6",
"payloadType": "str",
"x": 910,
"y": 1140,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "f7509f08.69bb9",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "remove-all-dynamic",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "remove-all-dynamic",
"payload": "",
"payloadType": "date",
"x": 930,
"y": 1240,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "e057de86.30bfa",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "pause-all",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"command\": \"pause-all\"}",
"payloadType": "json",
"x": 900,
"y": 1300,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "b247f14a.cf2f",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "start-all",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "start-all",
"payload": "",
"payloadType": "date",
"x": 890,
"y": 1460,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "6ea9b27a.04bf6c",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "stop-all",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "stop-all",
"payload": "{\"command\": \"stop-all\"}",
"payloadType": "json",
"x": 900,
"y": 1340,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "4a1dc32e.9dbf1c",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "add 3 schedules",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "add",
"payload": "[{\"command\":\"add\",\"name\":\"every 5 mins on monday\",\"expression\":\"0 */5 * * * MON *\",\"payload\":\"hi every 5 - it must be monday\",\"type\":\"str\",\"limit\":3},{\"command\":\"add\",\"name\":\"every 10 mins on tuesday\",\"expression\":\"0 */10 * * * TUE *\",\"payload\":\"It must be tuesday\",\"type\":\"str\",\"limit\":3},{\"command\":\"add\",\"name\":\"every 20s Wed~Sun\",\"expression\":\"*/20 * * * * 3-7 *\",\"payload\":\"Hi wed~sun\",\"type\":\"default\",\"limit\":3}]",
"payloadType": "json",
"x": 920,
"y": 1200,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "6dde0693.66ed08",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "describe array of expressions",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "[{\"command\":\"describe\",\"expression\":\"0 0 2 29 FEB * 2020-2040\"},{\"command\":\"describe\",\"expression\":\"4 */7 * * * 1-4 *\"},{\"command\":\"describe\",\"expression\":\"0/20 * * * * MON *\"}]",
"payloadType": "json",
"x": 1240,
"y": 880,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "27e00c01.1fd474",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Get status of \"every 8\"",
"props": [
{
"p": "payload",
"v": "every 8",
"vt": "str"
},
{
"p": "topic",
"v": "status",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "status",
"payload": "every 8",
"payloadType": "str",
"x": 940,
"y": 920,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "221cb0d1.2321f",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "export all dynamic schedules",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"command\":\"export-all-dynamic\"}",
"payloadType": "json",
"x": 960,
"y": 1580,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "482be49c.66898c",
"type": "comment",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Fully dynamic example demonstrating many functions of CRON-PLUS - see built in help for more info",
"info": "",
"x": 1160,
"y": 800,
"wires": []
},
{
"id": "3c39c8ac.e11a08",
"type": "cronplus",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Tokyo 8am & 4:30pm, Mon ~ Fri",
"outputField": "payload",
"timeZone": "Asia/Tokyo",
"persistDynamic": false,
"storeName": "",
"commandResponseMsgOutput": "output1",
"outputs": 1,
"options": [
{
"name": "schedule1",
"topic": "Start-of-shift",
"payloadType": "str",
"payload": "Start work now Tokyo",
"expressionType": "cron",
"expression": "0 0 8 * * 1-5",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
},
{
"name": "schedule2",
"topic": "End-of-shift",
"payloadType": "str",
"payload": "Go home Tokyo",
"expressionType": "cron",
"expression": "0 30 16 * * 1-5",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 1330,
"y": 1380,
"wires": [
[
"7945501b.3547"
]
]
},
{
"id": "7945501b.3547",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "true",
"targetType": "full",
"x": 1530,
"y": 1380,
"wires": []
},
{
"id": "7ad3fa7f.e3acd4",
"type": "cronplus",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Simple every hour Mon ~ Fri",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "schedule1",
"topic": "hourly",
"payloadType": "str",
"payload": "Every hour, mon-fri",
"expressionType": "cron",
"expression": "0 0 * * * MON-FRI",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 1320,
"y": 1280,
"wires": [
[
"5f323eb9.e9f7d"
]
]
},
{
"id": "5f323eb9.e9f7d",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1550,
"y": 1280,
"wires": []
},
{
"id": "48b74cdb.647ea4",
"type": "comment",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Demonstrating 2 schedules & timezone",
"info": "",
"x": 1350,
"y": 1340,
"wires": []
},
{
"id": "94553308.0c403",
"type": "comment",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "Simple example. Only 1 UI entry so inject button appears",
"info": "",
"x": 1410,
"y": 1240,
"wires": []
},
{
"id": "2db145e3.78f78a",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "stop-all-dynamic",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "stop-all-dynamic",
"payload": "",
"payloadType": "date",
"x": 920,
"y": 1380,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "9ac1b61.86b6d48",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "stop-all-static",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "stop-all-static",
"payload": "",
"payloadType": "date",
"x": 910,
"y": 1420,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "81b4094b.d0d778",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "start-all-dynamic",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "start-all-dynamic",
"payload": "",
"payloadType": "date",
"x": 920,
"y": 1500,
"wires": [
[
"65892a57.612d44"
]
]
},
{
"id": "b3512276.df97c",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "ac8b0a46f1caa685",
"name": "start-all-static",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "start-all-static",
"payload": "",
"payloadType": "date",
"x": 910,
"y": 1540,
"wires": [
[
"65892a57.612d44"
]
]
}
]