[ { "id": "68ee181e9defa139", "type": "tab", "label": "K.Scene", "disabled": false, "info": "", "env": [] }, { "id": "fed2a5ee0a71e88f", "type": "group", "z": "68ee181e9defa139", "name": "scene - reset daily", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "2f88f0a1be78ca59", "213f3332bd5e75c6", "04a2a3c2efe76a2e", "1864089149dd1020", "3d78b859e586fa91", "9cb403d67f5020f4", "0365c97a2f5bfd4a", "3f3b9ea1c2157e30" ], "x": 94, "y": 199, "w": 1352, "h": 82 }, { "id": "6b28d5f0aa7b2318", "type": "group", "z": "68ee181e9defa139", "name": "catch error", "style": { "fill": "#ff0000", "fill-opacity": "0.05", "label": true, "stroke": "#ff0000" }, "nodes": [ "d9ad2029c6cc7096", "2f804afe437414b9", "8437dc846be5af12" ], "x": 534, "y": 19, "w": 422, "h": 82 }, { "id": "9fed22b2831a8c22", "type": "group", "z": "68ee181e9defa139", "name": "scene - write", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "1b1e4074f6d9749c", "fb4b4e2a3fb029df", "d873539070943718", "2623289b88a15e8c", "941bac341d0a675c", "ca2cf5afce064ad1", "d05f93f2e9f3cbdb", "633e93007ad7359e", "f57a3d0eaf07945a", "85ac6855ecab60c4", "4abd6ee3b969ce9b", "d2e269a6af2dfb1c", "564fec2392c7191d", "8f0ff756ad2dce52" ], "x": 94, "y": 319, "w": 1632, "h": 202 }, { "id": "796ef41c1dd2380c", "type": "group", "z": "68ee181e9defa139", "name": "scene - lighting", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "abdf34b12a5dd88d", "0dce2c644348616c", "1e475c1be1dba2cd", "3b9ded82962309a3", "eabf5fc19efa675a", "6e799ecb83c4920e", "bee342e3eb1d1f39", "e08e83753e727848", "556fd5f1e5d631d9", "3783da8f96cfca80", "e3db60d3d55e1a82", "05713976186ba442", "585814f2cbaf139f", "9e47c40faa28271b", "8c14a3d77196d0aa", "034c93c5f54aaa15", "e9387364f390f805", "e3a86e68e388729d", "85d5d5e5b6c9beac", "435b7ba53d3b3f3d", "5cf10abb34d2afd9", "de95eb8bc9cedb87", "7af2f9f85dfa9434", "9f7db667a3e5cce9", "9c4f5df3df617722", "08ab0de6523813f1" ], "x": 94, "y": 1399, "w": 3432, "h": 322 }, { "id": "53babb398943f380", "type": "group", "z": "68ee181e9defa139", "name": "scene - fire", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "07d45bb35ac762c9", "2856d3bff393f9fc", "f4e114d534bc63d0", "d5aa33c47a8c4347", "7fcd9ac436f62e8a", "975a84254ad7876b" ], "x": 94, "y": 919, "w": 922, "h": 82 }, { "id": "cec3ab5a35c60f2d", "type": "group", "z": "68ee181e9defa139", "name": "scene - trigger", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "6e5d97fd5f511366", "2ea571ad93364449", "8f1009a9502a5516", "3d54b31ec68172cf", "b0a067f702405dd8", "56cb9892b5febb14", "ba1ad3b1c11760c5", "a205fd735ab69076", "c0b5773a6bf24fa0", "56aeeccb6faf8480", "b7b4f3e199cff4e1", "b3e6c30cb9035dee", "e9f918d732ed4390", "7660a519a43dca38", "e3935a8921558315", "05cb38d49efdd621", "e4a851ee51659fbe", "5aaa598948695182", "df48aef72bf72d15", "828954124f9d5f18", "6d05765c48afd703", "ee316a30d7d76949", "0cd574bde14391d4", "4b76b340559fb347", "e61e9d413554539f", "1ea871e1ad0c448e", "3ada84cb46c4cf59", "7e60e1c2ce2b33b5", "0bba3390b421b942", "437450dbe9e8f9d5" ], "x": 94, "y": 3679, "w": 2202, "h": 682 }, { "id": "3e2b5d0f1dd7c70c", "type": "group", "z": "68ee181e9defa139", "name": "scene - toggle", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "4e5dc7fe86199d6d", "da742d7b236d74e9", "0b8cfb72bb0f3e13", "b15b9bb27e18cc28" ], "x": 94, "y": 2419, "w": 512, "h": 142 }, { "id": "152a1afefb8c6055", "type": "group", "z": "68ee181e9defa139", "name": "scene - shutter shading", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "6ea014398476684e", "85772c505d998011", "4ddccddf03e3d4d4", "a07d6dd6d1c29a6a", "eeb585f11f6823ce", "ce174d9aa3f86e80", "81521b1b53a011cf", "a5ccd36e26d9f6d9", "0e492506da218846", "37da6809fc64b9e4", "db475389de188a0c", "7fd8ffaab7b5e644", "e4bcc2150345266e", "d104d5773963a340", "1acc8b4f519da72e", "bb270d49658a693f", "b0cca198cd40b4b7", "57ab09d50f789b03", "174cc227ba703f1c", "f1475eafde58ef48", "fe15947cd1dee943", "bebe5c9f233bc014", "decfc56647d266cf", "36fedc6b0be804e7", "4ba20a57285906e1" ], "x": 94, "y": 1039, "w": 2792, "h": 322 }, { "id": "1d10dc102aa4bd1a", "type": "group", "z": "68ee181e9defa139", "name": "scene - clone", "style": { "fill-opacity": "0.05", "label": true, "fill": "#92d04f" }, "nodes": [ "0afac8df8c0ad593", "d39803577094b080", "102eb508957fee9a", "99f3818ae330dad4", "394846d13b3f3ad5", "d8f45ef2a1ef83db" ], "x": 94, "y": 2599, "w": 1112, "h": 142 }, { "id": "241e58e3b15dd775", "type": "group", "z": "68ee181e9defa139", "name": "scene - custom color", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "a1e311e659c0a082", "0a11184001fe0640", "5391e717f6dca308", "906b6acddcc68024", "82aa18736b702cd8" ], "x": 94, "y": 2779, "w": 912, "h": 142 }, { "id": "282f949a47889a3f", "type": "group", "z": "68ee181e9defa139", "name": "scene - custom level", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "2ff1d9f7d0cd1e1c", "309b17151899bda1", "6ffbc9731bd5e6ae", "3d8af1903f187678", "deed3da8baf03817", "9909e92faf9def23", "22d518d36e04716c", "a1ef7c28be93a984" ], "x": 94, "y": 2959, "w": 1252, "h": 142 }, { "id": "ca328d57424013a3", "type": "group", "z": "68ee181e9defa139", "name": "scene - airflow", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "08678fd952d0718b", "75bb87ae3f2c0e0a", "ab4fc8c6e09cc5c2", "a0fa2c85acd788b9", "6790e3c9c69ca682", "d15334a68d41f0c1", "82b63e4a511b74b1", "406126819aeb6e7a", "9824552e3d00a585", "e1f16ee8824ca937", "0f4579886aba5d44", "5d63e702c0356933", "e2b5d164394915e1", "222a2cb866b5d927" ], "x": 94, "y": 1759, "w": 1462, "h": 202 }, { "id": "c9e818a567724ec0", "type": "group", "z": "68ee181e9defa139", "name": "scene - cumulus", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "f4ad016915b58f34", "1b526a505cca4b38", "05d83797479be408", "ff50da859f9ab394", "9d69c9b73ed6d46a", "42352296ba1a9b8f", "ac52cc5b1a310d97", "a7985c79389939ee", "35328fc67036b0b7", "aab05884f02c9ae5", "c24662116bd8d039", "d87d6edb5c6df065", "ee2f9913c385850b", "fee856239ffcf41d", "092fe634cc63515f", "6b28323c8b96ebdb", "179270593d4a9213", "029a7d6759da4e71", "3db7c0647f6f3b27", "f800de19b190bb45", "66144194d3248dab", "aa6fd304e5255f29", "e80f200967e6e92e", "8a6e80bb7690df1a", "154ca07785fc4a03", "32abed02d0722808" ], "x": 94, "y": 1999, "w": 2482, "h": 382 }, { "id": "7ad8c7d614a6550d", "type": "group", "z": "68ee181e9defa139", "name": "scene - snapshot", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "d7a5fb49638d61c7", "07a2f1dafbf1361b", "2ac3ee9cfd871785", "cf9bb9f13aa683ed", "b1d8ee0c1293ac1d", "a246dabb539abf36", "0f6fdddafa87cee7", "ee662244b88ac05c", "c47576e23f709bb0", "1b0cbe0fc795ac63", "3be19cd8f49a0c90", "3b1fb9312071cef4", "dc2fab4bf098df8c" ], "x": 94, "y": 3319, "w": 2032, "h": 142 }, { "id": "4f3050e222b9d901", "type": "group", "z": "68ee181e9defa139", "name": "scene - custom volume", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "588b2a84691acfcc", "779a7ca67f93706e", "75552a6e9aeabca1", "30505f159e3df7fb", "057d3226a76029a3", "086c6a1d782a1f2b" ], "x": 94, "y": 3139, "w": 1092, "h": 142 }, { "id": "b211976dfc18123b", "type": "group", "z": "68ee181e9defa139", "name": "scene - overload", "style": { "fill": "#92d04f", "fill-opacity": "0.05", "label": true }, "nodes": [ "cb1e39e2071036cb", "c7cc959fe94dc6ec", "4bb9a5575ff72468", "a2ca81a4a0f17f2b", "ac34f353008f720b", "cc0c27e2ec0f27c3", "077d26e64b31245a", "f1253a4898076087", "979e5dadb00816e2", "345bfad057c2239b", "5e4211383e41daf1", "46f096fb26163aaf", "dbf634344f4eb19d", "b784f74024662869" ], "x": 94, "y": 3499, "w": 2112, "h": 142 }, { "id": "2f88f0a1be78ca59", "type": "link in", "z": "68ee181e9defa139", "g": "fed2a5ee0a71e88f", "name": "scene - reset daily", "links": [ "031a6afd8300356a" ], "x": 135, "y": 240, "wires": [ [ "213f3332bd5e75c6" ] ] }, { "id": "213f3332bd5e75c6", "type": "switch", "z": "68ee181e9defa139", "g": "fed2a5ee0a71e88f", "name": "trigger", "property": "path", "propertyType": "msg", "rules": [ { "t": "eq", "v": "system/mode/nycthemer", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 270, "y": 240, "wires": [ [ "04a2a3c2efe76a2e" ] ] }, { "id": "04a2a3c2efe76a2e", "type": "switch", "z": "68ee181e9defa139", "g": "fed2a5ee0a71e88f", "name": "day", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "day", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 430, "y": 240, "wires": [ [ "1864089149dd1020" ] ] }, { "id": "d9ad2029c6cc7096", "type": "catch", "z": "68ee181e9defa139", "g": "6b28d5f0aa7b2318", "name": "catch error", "scope": null, "uncaught": false, "x": 620, "y": 60, "wires": [ [ "2f804afe437414b9" ] ] }, { "id": "1b1e4074f6d9749c", "type": "link out", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "scene - write", "mode": "link", "links": [ "206c1fb4a48067df" ], "x": 1555, "y": 420, "wires": [] }, { "id": "fb4b4e2a3fb029df", "type": "link in", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "scene - write", "links": [ "7fcd9ac436f62e8a", "c6a33fe34a5837ef", "cf3ba5e22164d0c7", "e3db60d3d55e1a82", "d508dae06ba6ea5f", "5fef774a053c6a26", "06c1934cb35fe252", "9379409dd3374a57", "7110eb15cfddfcf3", "371da4ba2aa94afb", "45b8cc265f3cddf8", "6a36741a719e6e4d", "843601335db31104", "b15b9bb27e18cc28", "6ea014398476684e", "75bb87ae3f2c0e0a", "9d69c9b73ed6d46a" ], "x": 135, "y": 420, "wires": [ [ "f57a3d0eaf07945a", "941bac341d0a675c" ] ] }, { "id": "d873539070943718", "type": "switch", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "compare payload to existing value", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "existing", "vt": "msg" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 560, "y": 420, "wires": [ [ "ca2cf5afce064ad1" ], [ "d05f93f2e9f3cbdb" ] ] }, { "id": "2623289b88a15e8c", "type": "delay", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "2 msg / s / topic", "pauseType": "queue", "timeout": "350", "timeoutUnits": "milliseconds", "rate": "2", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 1240, "y": 420, "wires": [ [ "d2e269a6af2dfb1c" ] ] }, { "id": "941bac341d0a675c", "type": "switch", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "request update daily", "property": "scene.update_daily", "propertyType": "msg", "rules": [ { "t": "true" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 320, "y": 480, "wires": [ [ "564fec2392c7191d" ] ] }, { "id": "ca2cf5afce064ad1", "type": "switch", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "requedst repeat", "property": "scene.repeat", "propertyType": "msg", "rules": [ { "t": "true" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 840, "y": 360, "wires": [ [ "d05f93f2e9f3cbdb" ] ] }, { "id": "d05f93f2e9f3cbdb", "type": "change", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "set metric", "rules": [ { "t": "set", "p": "bucket", "pt": "msg", "to": "scene.bucket", "tot": "msg" }, { "t": "set", "p": "measurement", "pt": "msg", "to": "cible", "tot": "str" }, { "t": "set", "p": "field", "pt": "msg", "to": "scene.field", "tot": "msg" }, { "t": "set", "p": "old_topic", "pt": "msg", "to": "topic", "tot": "msg" }, { "t": "set", "p": "topic", "pt": "msg", "to": "msg.bucket&msg.measurement&msg.field", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1040, "y": 420, "wires": [ [ "2623289b88a15e8c" ] ] }, { "id": "633e93007ad7359e", "type": "comment", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "prevent infinite loop on slow device", "info": "", "x": 1120, "y": 360, "wires": [] }, { "id": "f57a3d0eaf07945a", "type": "change", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "from global", "rules": [ { "t": "set", "p": "existing", "pt": "msg", "to": "metrics[msg.scene.bucket][msg.scene.measurement][msg.scene.field]", "tot": "global" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 290, "y": 420, "wires": [ [ "d873539070943718" ] ] }, { "id": "85ac6855ecab60c4", "type": "debug", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "scene - write", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1610, "y": 360, "wires": [] }, { "id": "4abd6ee3b969ce9b", "type": "debug", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "scene - update daily", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1000, "y": 480, "wires": [] }, { "id": "abdf34b12a5dd88d", "type": "link in", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "scene - lighting", "links": [ "31d14fe33ea1b7b2", "82f016c6bec5fe59", "938e3b8f717989d7", "2b30160f07c7d626", "d95f2ca72214b098", "0fa2ffecb9982cf5", "f08fe7b4b871821b", "41c0a6ba4a34abdc", "61afa8c6a05d66c5", "912556577f30a22e", "846814ea1666f8b1", "52b59fc8ef0553fe", "c7cf50bce96c5614", "5bc5a072069c9a6f", "d5e508f404ff4666", "77c776cd9ef0cb9d", "a5d16e445fcf58a5", "df53fc8e041f623d", "3330543761d78e58", "15367243a010781c", "feef715d3f66ac99", "37b076f40502ae57", "c57984f9ea96ac0d", "a205fd735ab69076" ], "x": 135, "y": 1620, "wires": [ [ "435b7ba53d3b3f3d" ] ] }, { "id": "0dce2c644348616c", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "measurement", "property": "measurement", "propertyType": "msg", "rules": [ { "t": "eq", "v": "motion", "vt": "str" }, { "t": "eq", "v": "aperture", "vt": "str" }, { "t": "eq", "v": "command", "vt": "str" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 4, "x": 520, "y": 1620, "wires": [ [ "585814f2cbaf139f" ], [ "05713976186ba442" ], [ "05713976186ba442" ], [ "bee342e3eb1d1f39" ] ] }, { "id": "1e475c1be1dba2cd", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "6d71d5859b10c11e" ], "linkType": "static", "timeout": "30", "x": 1140, "y": 1560, "wires": [ [ "3b9ded82962309a3" ] ] }, { "id": "3b9ded82962309a3", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 1330, "y": 1560, "wires": [ [ "eabf5fc19efa675a" ], [ "8c14a3d77196d0aa" ] ] }, { "id": "eabf5fc19efa675a", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "3abf64e6a345da67" ], "linkType": "static", "timeout": "30", "x": 1910, "y": 1560, "wires": [ [ "6e799ecb83c4920e" ] ] }, { "id": "6e799ecb83c4920e", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "neq", "v": "-1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 2110, "y": 1560, "wires": [ [ "bee342e3eb1d1f39" ] ] }, { "id": "bee342e3eb1d1f39", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "587236e6160da46c" ], "linkType": "static", "timeout": "30", "x": 2290, "y": 1680, "wires": [ [ "e08e83753e727848" ] ] }, { "id": "e08e83753e727848", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "neq", "v": "0", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 2470, "y": 1680, "wires": [ [ "e3db60d3d55e1a82", "e9387364f390f805", "556fd5f1e5d631d9" ] ] }, { "id": "556fd5f1e5d631d9", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "834ce9850cdb0a72" ], "linkType": "static", "timeout": "30", "x": 2650, "y": 1560, "wires": [ [ "3783da8f96cfca80" ] ] }, { "id": "3783da8f96cfca80", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 2850, "y": 1560, "wires": [ [ "e3a86e68e388729d" ] ] }, { "id": "e3db60d3d55e1a82", "type": "link out", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "scene - lighting", "mode": "link", "links": [ "fb4b4e2a3fb029df" ], "x": 3335, "y": 1680, "wires": [] }, { "id": "05713976186ba442", "type": "change", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "payload as scene on/off", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "msg.payload?msg.scene.on:msg.scene.off", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 770, "y": 1620, "wires": [ [ "bee342e3eb1d1f39" ] ] }, { "id": "585814f2cbaf139f", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "dfec2e7efb555d4d" ], "linkType": "static", "timeout": "30", "x": 750, "y": 1560, "wires": [ [ "9e47c40faa28271b" ] ] }, { "id": "9e47c40faa28271b", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "neq", "v": "-1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 950, "y": 1560, "wires": [ [ "1e475c1be1dba2cd" ] ] }, { "id": "8c14a3d77196d0aa", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "cae336906ea60890" ], "linkType": "static", "timeout": "30", "x": 1520, "y": 1620, "wires": [ [ "034c93c5f54aaa15" ] ] }, { "id": "034c93c5f54aaa15", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1710, "y": 1620, "wires": [ [ "eabf5fc19efa675a" ] ] }, { "id": "e9387364f390f805", "type": "debug", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "scene - lighting", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 3400, "y": 1620, "wires": [] }, { "id": "e3a86e68e388729d", "type": "link call", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "", "links": [ "c1a22098f4c6b607" ], "linkType": "static", "timeout": "30", "x": 3030, "y": 1560, "wires": [ [ "85d5d5e5b6c9beac" ] ] }, { "id": "85d5d5e5b6c9beac", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 3210, "y": 1560, "wires": [ [ "e9387364f390f805", "e3db60d3d55e1a82" ] ] }, { "id": "07d45bb35ac762c9", "type": "switch", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "trigger", "property": "path", "propertyType": "msg", "rules": [ { "t": "eq", "v": "system/mode/fire", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 270, "y": 960, "wires": [ [ "d5aa33c47a8c4347" ] ] }, { "id": "2856d3bff393f9fc", "type": "switch", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "mode master", "property": "metrics.system.mode.master", "propertyType": "global", "rules": [ { "t": "eq", "v": "about.automate", "vt": "global" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 610, "y": 960, "wires": [ [ "f4e114d534bc63d0" ] ] }, { "id": "f4e114d534bc63d0", "type": "switch", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "mode automate", "property": "metrics.system.mode.automate", "propertyType": "global", "rules": [ { "t": "eq", "v": "automatic", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 820, "y": 960, "wires": [ [ "7fcd9ac436f62e8a" ] ] }, { "id": "d5aa33c47a8c4347", "type": "switch", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "fire", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "fire", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 430, "y": 960, "wires": [ [ "2856d3bff393f9fc" ] ] }, { "id": "7fcd9ac436f62e8a", "type": "link out", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "scene - fire", "mode": "link", "links": [ "fb4b4e2a3fb029df" ], "x": 975, "y": 960, "wires": [] }, { "id": "975a84254ad7876b", "type": "link in", "z": "68ee181e9defa139", "g": "53babb398943f380", "name": "scene - fire", "links": [], "x": 135, "y": 960, "wires": [ [ "07d45bb35ac762c9" ] ] }, { "id": "2f804afe437414b9", "type": "change", "z": "68ee181e9defa139", "g": "6b28d5f0aa7b2318", "name": "topic", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "scene", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 790, "y": 60, "wires": [ [ "8437dc846be5af12" ] ] }, { "id": "8437dc846be5af12", "type": "link out", "z": "68ee181e9defa139", "g": "6b28d5f0aa7b2318", "name": "catch error", "mode": "link", "links": [ "a52f0e788cd4dca3" ], "x": 915, "y": 60, "wires": [] }, { "id": "d2e269a6af2dfb1c", "type": "change", "z": "68ee181e9defa139", "g": "9fed22b2831a8c22", "name": "move", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "old_topic", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1430, "y": 420, "wires": [ [ "85ac6855ecab60c4", "1b1e4074f6d9749c" ] ] }, { "id": "6e5d97fd5f511366", "type": "link in", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger", "links": [ "031a6afd8300356a", "427c0a5a050502e2" ], "x": 135, "y": 3780, "wires": [ [ "437450dbe9e8f9d5" ] ] }, { "id": "2ea571ad93364449", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "path", "property": "triggers", "propertyType": "global", "rules": [ { "t": "hask", "v": "path", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 480, "y": 3780, "wires": [ [ "8f1009a9502a5516" ] ] }, { "id": "8f1009a9502a5516", "type": "change", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "move", "rules": [ { "t": "set", "p": "trigger_payload", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "triggers[msg.path]", "tot": "global" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 640, "y": 3780, "wires": [ [ "3d54b31ec68172cf" ] ] }, { "id": "3d54b31ec68172cf", "type": "split", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene md5", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "property": "payload", "x": 820, "y": 3780, "wires": [ [ "b3e6c30cb9035dee", "7660a519a43dca38", "e4a851ee51659fbe" ] ] }, { "id": "b0a067f702405dd8", "type": "debug", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "trigger - path", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1940, "y": 3720, "wires": [] }, { "id": "56cb9892b5febb14", "type": "change", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene", "rules": [ { "t": "set", "p": "scene", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "trigger_payload", "tot": "msg" }, { "t": "delete", "p": "trigger_payload", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1560, "y": 3780, "wires": [ [ "0cd574bde14391d4" ] ] }, { "id": "ba1ad3b1c11760c5", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene type", "property": "scene.type", "propertyType": "msg", "rules": [ { "t": "eq", "v": "lighting", "vt": "str" }, { "t": "eq", "v": "shading", "vt": "str" }, { "t": "eq", "v": "airflow", "vt": "str" }, { "t": "eq", "v": "cumulus", "vt": "str" }, { "t": "eq", "v": "toggle", "vt": "str" }, { "t": "eq", "v": "clone", "vt": "str" }, { "t": "eq", "v": "snapshot", "vt": "str" }, { "t": "eq", "v": "overload", "vt": "str" }, { "t": "eq", "v": "custom color", "vt": "str" }, { "t": "eq", "v": "custom level", "vt": "str" }, { "t": "eq", "v": "custom volume", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 11, "x": 2100, "y": 3840, "wires": [ [ "a205fd735ab69076" ], [ "df48aef72bf72d15" ], [ "e61e9d413554539f" ], [ "1ea871e1ad0c448e" ], [ "5aaa598948695182" ], [ "828954124f9d5f18" ], [ "3ada84cb46c4cf59" ], [ "0bba3390b421b942" ], [ "6d05765c48afd703" ], [ "ee316a30d7d76949" ], [ "7e60e1c2ce2b33b5" ] ] }, { "id": "a205fd735ab69076", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - lighting", "mode": "link", "links": [ "abdf34b12a5dd88d" ], "x": 2255, "y": 3720, "wires": [] }, { "id": "c0b5773a6bf24fa0", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "on other", "property": "payload.on", "propertyType": "msg", "rules": [ { "t": "eq", "v": "trigger_payload", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1210, "y": 3900, "wires": [ [ "56aeeccb6faf8480" ] ] }, { "id": "56aeeccb6faf8480", "type": "change", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "value", "rules": [ { "t": "set", "p": "trigger_payload", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1400, "y": 3840, "wires": [ [ "56cb9892b5febb14" ] ] }, { "id": "b7b4f3e199cff4e1", "type": "change", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "value", "rules": [ { "t": "set", "p": "trigger_payload", "pt": "msg", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1400, "y": 3960, "wires": [ [ "56cb9892b5febb14" ] ] }, { "id": "b3e6c30cb9035dee", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "state on type", "property": "payload.on", "propertyType": "msg", "rules": [ { "t": "istype", "v": "number", "vt": "number" }, { "t": "istype", "v": "boolean", "vt": "boolean" }, { "t": "istype", "v": "string", "vt": "string" } ], "checkall": "false", "repair": false, "outputs": 3, "x": 1020, "y": 3840, "wires": [ [ "e9f918d732ed4390" ], [ "c0b5773a6bf24fa0" ], [ "c0b5773a6bf24fa0" ] ] }, { "id": "e9f918d732ed4390", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "on number", "property": "payload.on", "propertyType": "msg", "rules": [ { "t": "lte", "v": "trigger_payload", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1220, "y": 3840, "wires": [ [ "56aeeccb6faf8480" ] ] }, { "id": "7660a519a43dca38", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "state off type", "property": "payload.off", "propertyType": "msg", "rules": [ { "t": "istype", "v": "number", "vt": "number" }, { "t": "istype", "v": "boolean", "vt": "boolean" }, { "t": "istype", "v": "string", "vt": "string" } ], "checkall": "false", "repair": false, "outputs": 3, "x": 1020, "y": 3960, "wires": [ [ "e3935a8921558315" ], [ "05cb38d49efdd621" ], [ "05cb38d49efdd621" ] ] }, { "id": "e3935a8921558315", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "off number", "property": "payload.off", "propertyType": "msg", "rules": [ { "t": "gte", "v": "trigger_payload", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1220, "y": 3960, "wires": [ [ "b7b4f3e199cff4e1" ] ] }, { "id": "05cb38d49efdd621", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "off other", "property": "payload.off", "propertyType": "msg", "rules": [ { "t": "eq", "v": "trigger_payload", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1210, "y": 4020, "wires": [ [ "b7b4f3e199cff4e1" ] ] }, { "id": "435b7ba53d3b3f3d", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "nightlight actif", "property": "routine.nightlight", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 300, "y": 1620, "wires": [ [ "5cf10abb34d2afd9" ], [ "0dce2c644348616c" ] ] }, { "id": "5cf10abb34d2afd9", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "nycthemer", "property": "metrics.system.mode.nycthemer", "propertyType": "global", "rules": [ { "t": "eq", "v": "night", "vt": "str" }, { "t": "eq", "v": "day", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 510, "y": 1500, "wires": [ [ "de95eb8bc9cedb87" ], [ "08ab0de6523813f1" ] ] }, { "id": "de95eb8bc9cedb87", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "measurement", "property": "measurement", "propertyType": "msg", "rules": [ { "t": "eq", "v": "light", "vt": "str" }, { "t": "eq", "v": "mode", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 720, "y": 1440, "wires": [ [ "7af2f9f85dfa9434" ], [ "08ab0de6523813f1" ] ] }, { "id": "7af2f9f85dfa9434", "type": "switch", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "field", "property": "field", "propertyType": "msg", "rules": [ { "t": "neq", "v": "scene.field", "vt": "msg" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 910, "y": 1440, "wires": [ [ "9f7db667a3e5cce9" ] ] }, { "id": "9f7db667a3e5cce9", "type": "change", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "invert", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "$number(msg.payload)=0", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 3030, "y": 1440, "wires": [ [ "9c4f5df3df617722" ] ] }, { "id": "9c4f5df3df617722", "type": "change", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "payload", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "msg.payload?msg.scene.on:msg.scene.off", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 3200, "y": 1500, "wires": [ [ "e3db60d3d55e1a82", "e9387364f390f805" ] ] }, { "id": "08ab0de6523813f1", "type": "change", "z": "68ee181e9defa139", "g": "796ef41c1dd2380c", "name": "payload", "rules": [ { "t": "set", "p": "nycthemer", "pt": "msg", "to": "metrics.system.mode.nycthemer", "tot": "global" }, { "t": "set", "p": "payload", "pt": "msg", "to": "msg.nycthemer='night'", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 920, "y": 1500, "wires": [ [ "9c4f5df3df617722" ] ] }, { "id": "e4a851ee51659fbe", "type": "switch", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "no state", "property": "payload", "propertyType": "msg", "rules": [ { "t": "hask", "v": "on", "vt": "str" }, { "t": "hask", "v": "off", "vt": "str" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 3, "x": 1010, "y": 3780, "wires": [ [], [], [ "56cb9892b5febb14" ] ] }, { "id": "5aaa598948695182", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - toggle", "mode": "link", "links": [ "4e5dc7fe86199d6d" ], "x": 2255, "y": 3960, "wires": [] }, { "id": "4e5dc7fe86199d6d", "type": "link in", "z": "68ee181e9defa139", "g": "3e2b5d0f1dd7c70c", "name": "scene - toggle", "links": [ "5aaa598948695182" ], "x": 135, "y": 2520, "wires": [ [ "0b8cfb72bb0f3e13" ] ] }, { "id": "da742d7b236d74e9", "type": "debug", "z": "68ee181e9defa139", "g": "3e2b5d0f1dd7c70c", "name": "scene - toggle", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 480, "y": 2460, "wires": [] }, { "id": "0b8cfb72bb0f3e13", "type": "change", "z": "68ee181e9defa139", "g": "3e2b5d0f1dd7c70c", "name": "get global", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "metrics[msg.scene.bucket][msg.scene.measurement][msg.scene.field]", "tot": "global" }, { "t": "set", "p": "payload", "pt": "msg", "to": "msg.payload=msg.scene.off?msg.scene.on:msg.scene.off", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 280, "y": 2520, "wires": [ [ "b15b9bb27e18cc28", "da742d7b236d74e9" ] ] }, { "id": "b15b9bb27e18cc28", "type": "link out", "z": "68ee181e9defa139", "g": "3e2b5d0f1dd7c70c", "name": "scene - toggle", "mode": "link", "links": [ "fb4b4e2a3fb029df" ], "x": 415, "y": 2520, "wires": [] }, { "id": "df48aef72bf72d15", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - shading", "mode": "link", "links": [ "d104d5773963a340" ], "x": 2255, "y": 3780, "wires": [] }, { "id": "6ea014398476684e", "type": "link out", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "scene - shutter shading", "mode": "link", "links": [ "fb4b4e2a3fb029df" ], "x": 2635, "y": 1320, "wires": [] }, { "id": "85772c505d998011", "type": "link call", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "", "links": [ "c63c05889184c3bc" ], "linkType": "static", "timeout": "30", "x": 1630, "y": 1200, "wires": [ [ "4ddccddf03e3d4d4" ] ] }, { "id": "4ddccddf03e3d4d4", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1810, "y": 1200, "wires": [ [ "db475389de188a0c" ] ] }, { "id": "a07d6dd6d1c29a6a", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "type", "property": "payload", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 3, "x": 2330, "y": 1260, "wires": [ [ "eeb585f11f6823ce" ], [ "ce174d9aa3f86e80" ], [ "81521b1b53a011cf" ] ] }, { "id": "eeb585f11f6823ce", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "99", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "scene.on", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2490, "y": 1200, "wires": [ [ "6ea014398476684e", "1acc8b4f519da72e" ] ] }, { "id": "ce174d9aa3f86e80", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "0", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "scene.off", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2490, "y": 1260, "wires": [ [ "6ea014398476684e", "1acc8b4f519da72e" ] ] }, { "id": "81521b1b53a011cf", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "number", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "$abs($number(msg.payload))", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2500, "y": 1320, "wires": [ [ "6ea014398476684e", "1acc8b4f519da72e" ] ] }, { "id": "a5ccd36e26d9f6d9", "type": "link call", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "", "links": [ "89bf9e5c676a419c" ], "linkType": "static", "timeout": "30", "x": 530, "y": 1080, "wires": [ [ "0e492506da218846" ] ] }, { "id": "0e492506da218846", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 730, "y": 1080, "wires": [ [ "37da6809fc64b9e4" ] ] }, { "id": "37da6809fc64b9e4", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "openwork", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "routine.openwork", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "$number(msg.payload)", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1800, "y": 1080, "wires": [ [ "db475389de188a0c" ] ] }, { "id": "db475389de188a0c", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "right bay", "property": "metrics[msg.scene.bucket]aperture['right bay']", "propertyType": "global", "rules": [ { "t": "false" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 1980, "y": 1200, "wires": [ [ "7fd8ffaab7b5e644" ] ] }, { "id": "7fd8ffaab7b5e644", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "left bay", "property": "metrics[msg.scene.bucket]aperture['left bay']", "propertyType": "global", "rules": [ { "t": "false" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 2160, "y": 1200, "wires": [ [ "a07d6dd6d1c29a6a" ] ] }, { "id": "e4bcc2150345266e", "type": "link call", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "", "links": [ "c63c05889184c3bc" ], "linkType": "static", "timeout": "30", "x": 850, "y": 1320, "wires": [ [ "b0cca198cd40b4b7" ] ] }, { "id": "d104d5773963a340", "type": "link in", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "scene - shutter shading", "links": [ "df48aef72bf72d15" ], "x": 135, "y": 1260, "wires": [ [ "57ab09d50f789b03" ] ] }, { "id": "1acc8b4f519da72e", "type": "debug", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "scene - shutter shading", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 2730, "y": 1260, "wires": [] }, { "id": "bb270d49658a693f", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "nycthemer", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "metrics.system.mode.nycthemer", "tot": "global" }, { "t": "set", "p": "payload", "pt": "msg", "to": "msg.payload='day'", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1430, "y": 1200, "wires": [ [ "85772c505d998011" ] ] }, { "id": "b0cca198cd40b4b7", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "rsp", "property": "routine.response", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "num" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 2170, "y": 1320, "wires": [ [ "a07d6dd6d1c29a6a" ] ] }, { "id": "57ab09d50f789b03", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "measurement", "property": "measurement", "propertyType": "msg", "rules": [ { "t": "eq", "v": "luminosity", "vt": "str" }, { "t": "eq", "v": "mode", "vt": "str" }, { "t": "eq", "v": "aperture", "vt": "str" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 4, "x": 300, "y": 1260, "wires": [ [ "a5ccd36e26d9f6d9" ], [ "174cc227ba703f1c" ], [ "fe15947cd1dee943" ], [ "e4bcc2150345266e" ] ] }, { "id": "174cc227ba703f1c", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "field", "property": "field", "propertyType": "msg", "rules": [ { "t": "eq", "v": "nycthemer", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 1, "x": 490, "y": 1140, "wires": [ [ "decfc56647d266cf" ] ] }, { "id": "f1475eafde58ef48", "type": "trigger", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "wait 3 s", "op1": "", "op2": "", "op1type": "nul", "op2type": "payl", "duration": "3", "extend": false, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "topic", "topic": "scene.bucket", "outputs": 1, "x": 1240, "y": 1140, "wires": [ [ "bb270d49658a693f" ] ] }, { "id": "fe15947cd1dee943", "type": "switch", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "field", "property": "field", "propertyType": "msg", "rules": [ { "t": "neq", "v": "scene.field", "vt": "msg" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 490, "y": 1200, "wires": [ [ "bb270d49658a693f" ], [ "bebe5c9f233bc014" ] ] }, { "id": "bebe5c9f233bc014", "type": "trigger", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "wait 30 s", "op1": "", "op2": "", "op1type": "nul", "op2type": "payl", "duration": "30", "extend": true, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "topic", "topic": "scene.bucket", "outputs": 1, "x": 660, "y": 1260, "wires": [ [ "e4bcc2150345266e" ] ] }, { "id": "decfc56647d266cf", "type": "change", "z": "68ee181e9defa139", "g": "152a1afefb8c6055", "name": "set delay", "rules": [ { "t": "set", "p": "delay", "pt": "msg", "to": "msg.routine.delay>0?msg.routine.delay:1", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 660, "y": 1140, "wires": [ [ "4ba20a57285906e1" ] ] }, { "id": "0afac8df8c0ad593", "type": "link out", "z": "68ee181e9defa139", "g": "1d10dc102aa4bd1a", "name": "scene - clone", "mode": "link", "links": [ "206c1fb4a48067df" ], "x": 615, "y": 2700, "wires": [] }, { "id": "d39803577094b080", "type": "debug", "z": "68ee181e9defa139", "g": "1d10dc102aa4bd1a", "name": "scene - clone", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 670, "y": 2640, "wires": [] }, { "id": "102eb508957fee9a", "type": "change", "z": "68ee181e9defa139", "g": "1d10dc102aa4bd1a", "name": "split metric", "rules": [ { "t": "set", "p": "tmp", "pt": "msg", "to": "$split(msg.scene.path,'/')", "tot": "jsonata" }, { "t": "set", "p": "target.bucket", "pt": "msg", "to": "tmp[0]", "tot": "msg" }, { "t": "set", "p": "target.measurement", "pt": "msg", "to": "tmp[1]", "tot": "msg" }, { "t": "set", "p": "target.field", "pt": "msg", "to": "tmp[2]", "tot": "msg" }, { "t": "set", "p": "target.payload", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "set", "p": "target.repeat", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 290, "y": 2700, "wires": [ [ "99f3818ae330dad4" ] ] }, { "id": "99f3818ae330dad4", "type": "function", "z": "68ee181e9defa139", "g": "1d10dc102aa4bd1a", "name": "set metric", "func": "// script var\nvar msg = msg;\n\nreturn msg.target;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 2700, "wires": [ [ "d39803577094b080", "0afac8df8c0ad593" ] ] }, { "id": "394846d13b3f3ad5", "type": "link in", "z": "68ee181e9defa139", "g": "1d10dc102aa4bd1a", "name": "scene - clone", "links": [ "828954124f9d5f18" ], "x": 135, "y": 2700, "wires": [ [ "102eb508957fee9a" ] ] }, { "id": "828954124f9d5f18", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - clone", "mode": "link", "links": [ "394846d13b3f3ad5" ], "x": 2255, "y": 4020, "wires": [] }, { "id": "a1e311e659c0a082", "type": "change", "z": "68ee181e9defa139", "g": "241e58e3b15dd775", "name": "set metric", "rules": [ { "t": "set", "p": "bucket", "pt": "msg", "to": "scene.bucket", "tot": "msg" }, { "t": "set", "p": "measurement", "pt": "msg", "to": "scene.measurement", "tot": "msg" }, { "t": "set", "p": "field", "pt": "msg", "to": "scene.field", "tot": "msg" }, { "t": "set", "p": "colors", "pt": "msg", "to": "{\t '#FFFFFF':'#FF0018',\t '#FF0018':'#FFFF41',\t '#FFFF41':'#008018',\t '#008018':'#0000F9',\t '#0000F9':'#86007D',\t '#86007D':'#FFFFFF'\t}", "tot": "jsonata" }, { "t": "set", "p": "state", "pt": "msg", "to": "metrics[msg.bucket][msg.measurement][msg.field]", "tot": "global" }, { "t": "set", "p": "color", "pt": "msg", "to": "colors[msg.state]", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "msg.color?msg.color:'#FFFFFF'", "tot": "jsonata" }, { "t": "set", "p": "repeat", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 280, "y": 2880, "wires": [ [ "5391e717f6dca308", "906b6acddcc68024" ] ] }, { "id": "6d05765c48afd703", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - custom color", "mode": "link", "links": [ "0a11184001fe0640" ], "x": 2255, "y": 4200, "wires": [] }, { "id": "0a11184001fe0640", "type": "link in", "z": "68ee181e9defa139", "g": "241e58e3b15dd775", "name": "scene - custom color", "links": [ "6d05765c48afd703" ], "x": 135, "y": 2880, "wires": [ [ "a1e311e659c0a082" ] ] }, { "id": "5391e717f6dca308", "type": "debug", "z": "68ee181e9defa139", "g": "241e58e3b15dd775", "name": "scene - custom color", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 500, "y": 2820, "wires": [] }, { "id": "906b6acddcc68024", "type": "link out", "z": "68ee181e9defa139", "g": "241e58e3b15dd775", "name": "scene - custom color", "mode": "link", "links": [ "206c1fb4a48067df" ], "x": 415, "y": 2880, "wires": [] }, { "id": "2ff1d9f7d0cd1e1c", "type": "change", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "level +", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "(msg.state+msg.routine.step)>msg.routine.higher?msg.routine.higher:(msg.state+msg.routine.step)", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 630, "y": 3000, "wires": [ [ "6ffbc9731bd5e6ae", "3d8af1903f187678" ] ] }, { "id": "309b17151899bda1", "type": "link in", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "scene - custom level", "links": [ "ee316a30d7d76949" ], "x": 135, "y": 3060, "wires": [ [ "9909e92faf9def23" ] ] }, { "id": "6ffbc9731bd5e6ae", "type": "debug", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "scene - custom level", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 840, "y": 3000, "wires": [] }, { "id": "3d8af1903f187678", "type": "link out", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "scene - custom level", "mode": "link", "links": [ "206c1fb4a48067df" ], "x": 755, "y": 3060, "wires": [] }, { "id": "ee316a30d7d76949", "type": "link out", "z": "68ee181e9defa139", "g": "cec3ab5a35c60f2d", "name": "scene - trigger - custom level", "mode": "link", "links": [ "309b17151899bda1" ], "x": 2255, "y": 4260, "wires": [] }, { "id": "deed3da8baf03817", "type": "switch", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "payload", "property": "payload", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 460, "y": 3060, "wires": [ [ "2ff1d9f7d0cd1e1c" ], [ "22d518d36e04716c" ] ] }, { "id": "9909e92faf9def23", "type": "change", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "set metric", "rules": [ { "t": "set", "p": "bucket", "pt": "msg", "to": "scene.bucket", "tot": "msg" }, { "t": "set", "p": "measurement", "pt": "msg", "to": "scene.measurement", "tot": "msg" }, { "t": "set", "p": "field", "pt": "msg", "to": "scene.field", "tot": "msg" }, { "t": "set", "p": "repeat", "pt": "msg", "to": "true", "tot": "bool" }, { "t": "set", "p": "state", "pt": "msg", "to": "metrics[msg.bucket][msg.measurement][msg.field]", "tot": "global" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 280, "y": 3060, "wires": [ [ "deed3da8baf03817" ] ] }, { "id": "22d518d36e04716c", "type": "change", "z": "68ee181e9defa139", "g": "282f949a47889a3f", "name": "level -", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "(msg.state-msg.routine.step)