diff --git a/flows.json b/flows.json index 048eb7c..bb1c8d9 100644 --- a/flows.json +++ b/flows.json @@ -870,9 +870,7 @@ "ec4682a111a48b70" ], "x": 14, - "y": 839, - "w": 1552, - "h": 402 + "y": 839 }, { "id": "e065b1ed4938b477", @@ -931,9 +929,7 @@ "6bbf7df2c43c481e" ], "x": 14, - "y": 11.5, - "w": 1252, - "h": 809.5 + "y": 11.5 }, { "id": "5c50443a84910fb7", @@ -1158,9 +1154,7 @@ "f5fb96bf1a33b3cd" ], "x": 54, - "y": 19, - "w": 1492, - "h": 282 + "y": 19 }, { "id": "0c81dfaed25d225c", @@ -1437,9 +1431,7 @@ "99c141f21de4feda" ], "x": 74, - "y": 39, - "w": 1132, - "h": 262 + "y": 39 }, { "id": "a6de35af12739885", @@ -1461,9 +1453,7 @@ "724f186878227dad" ], "x": 74, - "y": 339, - "w": 1132, - "h": 202 + "y": 339 }, { "id": "0804d9edeca1c9fa", @@ -1484,9 +1474,7 @@ "4523045453de0a33" ], "x": 74, - "y": 579, - "w": 1092, - "h": 202 + "y": 579 }, { "id": "385f03591bc34bcc", @@ -1583,9 +1571,7 @@ "6b5d3e550ad76528" ], "x": 34, - "y": 39, - "w": 752, - "h": 82 + "y": 39 }, { "id": "4329e464360d0afa", @@ -1628,9 +1614,7 @@ "f47a0d107875d550" ], "x": 34, - "y": 139, - "w": 1592, - "h": 422 + "y": 139 }, { "id": "395da9d5d5f7e232", @@ -13824,6 +13808,7 @@ "id": "7611921cadb91b1e", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Lamp Off", "server": "9e87348d.9c1c48", @@ -13854,6 +13839,7 @@ "id": "3a29cecbefa6cbe2", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Reset Living Room", "server": "9e87348d.9c1c48", @@ -13884,6 +13870,7 @@ "id": "4a2031f363418db1", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Set Scene", "server": "9e87348d.9c1c48", @@ -13912,6 +13899,7 @@ "id": "984386fa0a6369d6", "type": "server-state-changed", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Living Room TV Current App", "server": "9e87348d.9c1c48", @@ -13960,6 +13948,7 @@ "id": "0beae13503166379", "type": "function", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Processing", "func": "const appList = global.get(\"appListLivingRoom\", \"diskCon\")\nvar states = global.get('homeassistant.homeAssistant.states')\nvar lampState = states['light.dining_room_lamp'].state\nvar app = msg.payload\nvar toggle = msg.toggle\nvar 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}", @@ -13989,6 +13978,7 @@ "id": "6c77ade442a47a30", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Entertainment Mode On", "server": "9e87348d.9c1c48", @@ -14017,6 +14007,7 @@ "id": "6392f2f0586d988a", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Entertainment Mode Off", "server": "9e87348d.9c1c48", @@ -14045,6 +14036,7 @@ "id": "e505e9f24bf919dd", "type": "server-state-changed", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Entertainment Mode State", "server": "9e87348d.9c1c48", @@ -14096,6 +14088,7 @@ "id": "9efd5346a1ca1972", "type": "server-state-changed", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Detect Pause", "server": "9e87348d.9c1c48", @@ -14142,6 +14135,7 @@ "id": "8b53b9f4d5ba0bf0", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Dynamic On", "server": "9e87348d.9c1c48", @@ -14173,6 +14167,7 @@ "id": "cc8f6ab710549be2", "type": "stoptimer", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "duration": "15", "units": "Second", @@ -14192,6 +14187,7 @@ "id": "346379575efad516", "type": "function", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Processing", "func": "var states = global.get('homeassistant.homeAssistant.states')\nvar allowed = states['input_boolean.living_room_entertainment_control'].state\nvar active = states['input_boolean.living_room_entertainment_mode'].state\nvar currentApp = global.get('tvAppLivingRoom');\nvar lights = states['light.living_room_lights'].state\nvar selectedScene = states['input_text.living_room_selected_scene'].state\nvar lamp = flow.get(\"lampState\")\nvar alert = msg.alert\nvar payload = msg.payload\n\nif (currentApp === 'YouTube' || currentApp === 'Jellyfin') {\n var hueScene = 'Tokyo'\n var lifxScene = 'intense'\n} else if (currentApp === 'Twitch') {\n var hueScene = 'Twitch'\n var lifxScene = 'party'\n} else if (currentApp === 'Hulu') {\n var hueScene = 'Forest Adventure'\n var lifxScene = 'relaxing'\n} else if (currentApp === 'Netflix') {\n var hueScene = 'Netflix'\n var lifxScene = 'love'\n} else if (currentApp === 'MLB') {\n var hueScene = 'MLB'\n var 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}", @@ -14224,6 +14220,7 @@ "id": "8b0b39deb5142557", "type": "function", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Processing", "func": "var states = global.get('homeassistant.homeAssistant.states')\nvar allowed = states['input_boolean.living_room_entertainment_control'].state\nvar lights = states['light.living_room_lights'].state\nvar active = states['input_boolean.living_room_entertainment_mode'].state\nvar selectedScene = states['input_text.living_room_selected_scene'].state\nvar payload = msg.payload\nvar stopMsg = {\n \"payload\":\"stop\"\n}\nvar 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}", @@ -14256,6 +14253,7 @@ "id": "7cb8056b3b41a9e8", "type": "function", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Check", "func": "var states = global.get('homeassistant.homeAssistant.states')\nvar active = states['input_boolean.living_room_entertainment_mode'].state\nvar lights = states['light.living_room_lights'].state\nvar lamp = flow.get('lampState')\n\nif (active === 'on' && lights === 'on') {\n if (lamp === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sent (Both)\"});\n return[msg,msg]\n } else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Sent (Living Room)\"});\n return[msg,null]\n }\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n}", @@ -14284,6 +14282,7 @@ "id": "d2390789a8b3101a", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "LIFX", "server": "9e87348d.9c1c48", @@ -14312,6 +14311,7 @@ "id": "d961ffeaea408909", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "LIFX Stop", "server": "9e87348d.9c1c48", @@ -14340,6 +14340,7 @@ "id": "107f2c88924975fe", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Adaptive Off", "server": "9e87348d.9c1c48", @@ -14371,6 +14372,7 @@ "id": "ed2e0f4f214ad76c", "type": "delay", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "", "pauseType": "delay", @@ -14398,6 +14400,7 @@ "id": "d09061428e9c694d", "type": "api-call-service", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Turn On Lamp", "server": "9e87348d.9c1c48", @@ -14426,6 +14429,7 @@ "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\"});", @@ -14443,6 +14447,7 @@ "id": "e5af55b177f37c65", "type": "inject", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Update", "props": [ @@ -15065,6 +15070,7 @@ "id": "27b2c22907382e6d", "type": "link in", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Media Scenes Input - Living Room", "links": [ @@ -15083,6 +15089,7 @@ "id": "f111c40459e27629", "type": "comment", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Figure out why alerts aren't resetting to media scenes properly", "info": "", @@ -15112,6 +15119,7 @@ "id": "33903d3f8f53dadd", "type": "server-state-changed", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "Media Scenes Toggle", "server": "9e87348d.9c1c48", @@ -15160,6 +15168,7 @@ "id": "f463df7e17e045e9", "type": "delay", "z": "b0286fae9f2ce547", + "d": true, "g": "ff6d8150e8d5e606", "name": "", "pauseType": "delay",