create clock by defaut for all rooms

This commit is contained in:
JcDenis 2024-07-21 21:34:43 +02:00
parent 09055657b7
commit fdb4081ae5
6 changed files with 2109 additions and 2685 deletions

File diff suppressed because one or more lines are too long

View file

@ -94,7 +94,7 @@
], ],
"x": 74, "x": 74,
"y": 819, "y": 819,
"w": 672, "w": 732,
"h": 82 "h": 82
}, },
{ {
@ -1675,7 +1675,7 @@
} }
} }
}, },
"x": 370, "x": 430,
"y": 860, "y": 860,
"wires": [ "wires": [
[ [
@ -1688,14 +1688,14 @@
"type": "inject", "type": "inject",
"z": "29b296e6cd0e71d4", "z": "29b296e6cd0e71d4",
"g": "0cf81dc631df6bea", "g": "0cf81dc631df6bea",
"name": "", "name": "get Alexa devices",
"props": [], "props": [],
"repeat": "", "repeat": "",
"crontab": "", "crontab": "",
"once": false, "once": false,
"onceDelay": 0.1, "onceDelay": 0.1,
"topic": "", "topic": "",
"x": 170, "x": 200,
"y": 860, "y": 860,
"wires": [ "wires": [
[ [
@ -1717,7 +1717,7 @@
"targetType": "msg", "targetType": "msg",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 610, "x": 670,
"y": 860, "y": 860,
"wires": [] "wires": []
}, },

View file

@ -546,79 +546,6 @@
"w": 342, "w": 342,
"h": 82 "h": 82
}, },
{
"id": "a4306c9de01d4722",
"type": "group",
"z": "f125f568d4e332ee",
"g": "1021acef5727d683",
"name": "api - clock - source",
"style": {
"fill": "#0070c0",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"28812ef076d967f4",
"7f0910ae6f903617",
"85890de261cf2a1f",
"ac912f36def02119",
"ffb6d8f6427b4d52",
"7a46605f38735c66",
"b9f3d00e902f65a2",
"1acc4b7b4c392c1f",
"59e31b73c4ea2253",
"5e6d3072053bc3d4",
"61f1ad5814d37ec9"
],
"x": 1134,
"y": 1999,
"w": 1292,
"h": 202
},
{
"id": "69645e55501064d8",
"type": "group",
"z": "f125f568d4e332ee",
"g": "1021acef5727d683",
"name": "api - clock - device",
"style": {
"fill": "#ffC000",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"685a0ab8aaa24747",
"260725a140f7cb61",
"62d9811cb83cb6dd",
"44266579fe2f82fd",
"0acceaea33c8972d",
"4a4b8dcde9348a97",
"7f8e16b6edfac5e4"
],
"x": 94,
"y": 1999,
"w": 942,
"h": 142
},
{
"id": "1021acef5727d683",
"type": "group",
"z": "f125f568d4e332ee",
"name": "room - clock",
"style": {
"fill": "#777777",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"69645e55501064d8",
"a4306c9de01d4722"
],
"x": 68,
"y": 1973,
"w": 2384,
"h": 254
},
{ {
"id": "99fe787fc1aa2efe", "id": "99fe787fc1aa2efe",
"type": "change", "type": "change",
@ -5394,529 +5321,5 @@
"x": 210, "x": 210,
"y": 1820, "y": 1820,
"wires": [] "wires": []
},
{
"id": "28812ef076d967f4",
"type": "link out",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "api - clock - source - in",
"mode": "link",
"links": [
"42c36b63863ecb77",
"84aad657cc3015c1",
"151c140cd7171c80",
"3db710d8b9023738",
"f1ddd31035db0cc4"
],
"x": 1435,
"y": 2040,
"wires": []
},
{
"id": "7f0910ae6f903617",
"type": "change",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "sync",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "sync",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1310,
"y": 2040,
"wires": [
[
"28812ef076d967f4"
]
]
},
{
"id": "85890de261cf2a1f",
"type": "link in",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "api - clock - source - out",
"links": [
"2ecf7207d27bb785",
"e0ee48357ee30544",
"c469093ebb0005f9",
"e0395c593211c049",
"bbae4d26e41478ea"
],
"x": 1595,
"y": 2040,
"wires": [
[
"b9f3d00e902f65a2"
]
]
},
{
"id": "ac912f36def02119",
"type": "switch",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "topic",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "day",
"vt": "str"
},
{
"t": "eq",
"v": "eve",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 2070,
"y": 2040,
"wires": [
[
"7a46605f38735c66"
],
[
"7a46605f38735c66"
]
]
},
{
"id": "ffb6d8f6427b4d52",
"type": "link out",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "api - clock - source",
"mode": "link",
"links": [],
"x": 2385,
"y": 2040,
"wires": []
},
{
"id": "7a46605f38735c66",
"type": "change",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "metric",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "'work '&msg.topic",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$boolean(msg.payload)",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2250,
"y": 2040,
"wires": [
[
"ffb6d8f6427b4d52"
]
]
},
{
"id": "b9f3d00e902f65a2",
"type": "switch",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "sync",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "sync",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 1730,
"y": 2040,
"wires": [
[
"59e31b73c4ea2253",
"61f1ad5814d37ec9"
],
[
"1acc4b7b4c392c1f"
]
]
},
{
"id": "1acc4b7b4c392c1f",
"type": "delay",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "250 ms",
"pauseType": "delay",
"timeout": "250",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1900,
"y": 2160,
"wires": [
[
"ac912f36def02119"
]
]
},
{
"id": "59e31b73c4ea2253",
"type": "change",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "work day",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "day",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1900,
"y": 2040,
"wires": [
[
"ac912f36def02119"
]
]
},
{
"id": "5e6d3072053bc3d4",
"type": "link in",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "api - clock - source",
"links": [
"074a67bf0fcf09ad"
],
"x": 1175,
"y": 2040,
"wires": [
[
"7f0910ae6f903617"
]
]
},
{
"id": "61f1ad5814d37ec9",
"type": "change",
"z": "f125f568d4e332ee",
"g": "a4306c9de01d4722",
"name": "work eve",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "eve",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1900,
"y": 2100,
"wires": [
[
"ac912f36def02119"
]
]
},
{
"id": "685a0ab8aaa24747",
"type": "change",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "clock / work day / boolean / false",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "work day",
"tot": "str"
},
{
"t": "set",
"p": "format",
"pt": "msg",
"to": "boolean",
"tot": "str"
},
{
"t": "set",
"p": "default",
"pt": "msg",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 770,
"y": 2040,
"wires": [
[
"260725a140f7cb61"
]
]
},
{
"id": "260725a140f7cb61",
"type": "link out",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "api - clock - device",
"mode": "link",
"links": [
"bfa594bf1f876c92"
],
"x": 995,
"y": 2040,
"wires": []
},
{
"id": "62d9811cb83cb6dd",
"type": "link in",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "api - clock - device",
"links": [
"25445f5a9b787a0a"
],
"x": 135,
"y": 2040,
"wires": [
[
"0acceaea33c8972d"
]
]
},
{
"id": "44266579fe2f82fd",
"type": "change",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "clock/ work eve / boolean / false",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "work eve",
"tot": "str"
},
{
"t": "set",
"p": "format",
"pt": "msg",
"to": "boolean",
"tot": "str"
},
{
"t": "set",
"p": "default",
"pt": "msg",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 770,
"y": 2100,
"wires": [
[
"260725a140f7cb61"
]
]
},
{
"id": "0acceaea33c8972d",
"type": "link out",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "api - clock - device - in",
"mode": "link",
"links": [
"540ed3f299c779d4",
"0ec19ecfc3edabbd",
"170b7bbf9e361ce2",
"7faf686a74225948",
"41856b3f50fd450b"
],
"x": 235,
"y": 2040,
"wires": []
},
{
"id": "4a4b8dcde9348a97",
"type": "link in",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "api - clock - device - out",
"links": [
"d47a5d29139aca1c",
"100b75c92fbd601d",
"b8690e2acb308498",
"021ed4766414be0d",
"ad43a0610ba77d34"
],
"x": 395,
"y": 2040,
"wires": [
[
"7f8e16b6edfac5e4"
]
]
},
{
"id": "7f8e16b6edfac5e4",
"type": "switch",
"z": "f125f568d4e332ee",
"g": "69645e55501064d8",
"name": "room",
"property": "room",
"propertyType": "msg",
"rules": [
{
"t": "istype",
"v": "string",
"vt": "string"
}
],
"checkall": "false",
"repair": false,
"outputs": 1,
"x": 530,
"y": 2040,
"wires": [
[
"685a0ab8aaa24747",
"44266579fe2f82fd"
]
]
} }
] ]

File diff suppressed because it is too large Load diff

View file

@ -60,20 +60,18 @@
"fill-opacity": "0.05" "fill-opacity": "0.05"
}, },
"nodes": [ "nodes": [
"2e7bb0e6e6079d56",
"5f114cc4b6ae0579",
"7992580eefeada6a",
"6b5dd5979114ad9c",
"69a45eebaa58325f", "69a45eebaa58325f",
"6eafb2a9c1ec95c0", "6eafb2a9c1ec95c0",
"39740b8338a622fd", "39740b8338a622fd",
"4e5188bf59004a54", "4e5188bf59004a54",
"cc946bae3f4b46d8", "cc946bae3f4b46d8",
"fc14608145819575" "fc14608145819575",
"6b5dd5979114ad9c",
"a1dbeb8cf51c3366"
], ],
"x": 94, "x": 94,
"y": 379, "y": 379,
"w": 1112, "w": 1052,
"h": 142 "h": 142
}, },
{ {
@ -183,7 +181,7 @@
], ],
"x": 94, "x": 94,
"y": 199, "y": 199,
"w": 912, "w": 1092,
"h": 142 "h": 142
}, },
{ {
@ -580,100 +578,6 @@
"y": 60, "y": 60,
"wires": [] "wires": []
}, },
{
"id": "2e7bb0e6e6079d56",
"type": "link in",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "entities - register rooms",
"links": [
"0503bf7758416919",
"2c97fceb2be5bfbb",
"332aa628b5bee5dd",
"35e382c59a86017f",
"36ce7ba8c84903c3",
"5a8db78f84b2088e",
"65462b7ee4a5168d",
"668a343981badf28",
"6ba22e84394777c7",
"7cb9a6573bc17516",
"8407471b62e3c9e6",
"8967bafc6b5c1f70",
"95b38fc6b2a4af14",
"a7adf44ae42183e7",
"cc68069930b2479b",
"e035e232e2747fed",
"e6e1bdcedd4890e9",
"fb0afb89fb191395",
"fc02e2aced7cc118",
"fd2f2860794605a9"
],
"x": 135,
"y": 480,
"wires": [
[
"5f114cc4b6ae0579"
]
]
},
{
"id": "5f114cc4b6ae0579",
"type": "switch",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "bucket exists in global",
"property": "buckets",
"propertyType": "global",
"rules": [
{
"t": "hask",
"v": "bucket",
"vt": "msg"
},
{
"t": "else"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 320,
"y": 480,
"wires": [
[],
[
"7992580eefeada6a"
]
]
},
{
"id": "7992580eefeada6a",
"type": "change",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "add room",
"rules": [
{
"t": "set",
"p": "rooms[msg.bucket]",
"pt": "global",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 480,
"wires": [
[
"69a45eebaa58325f"
]
]
},
{ {
"id": "6c95c42a1bb0e0e8", "id": "6c95c42a1bb0e0e8",
"type": "ui-dropdown", "type": "ui-dropdown",
@ -2334,7 +2238,7 @@
"type": "change", "type": "change",
"z": "1362a4b4f08f3d5b", "z": "1362a4b4f08f3d5b",
"g": "4aa11d03f1b394a5", "g": "4aa11d03f1b394a5",
"name": "from global", "name": "get entities from global",
"rules": [ "rules": [
{ {
"t": "set", "t": "set",
@ -2349,7 +2253,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 290, "x": 440,
"y": 300, "y": 300,
"wires": [ "wires": [
[ [
@ -2369,7 +2273,7 @@
"arraySpltType": "len", "arraySpltType": "len",
"stream": false, "stream": false,
"addname": "", "addname": "",
"x": 470, "x": 650,
"y": 300, "y": 300,
"wires": [ "wires": [
[ [
@ -2391,7 +2295,7 @@
"targetType": "full", "targetType": "full",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 860, "x": 1040,
"y": 240, "y": 240,
"wires": [] "wires": []
}, },
@ -2408,7 +2312,7 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 640, "x": 820,
"y": 300, "y": 300,
"wires": [ "wires": [
[ [
@ -2427,7 +2331,7 @@
"links": [ "links": [
"d85fe6335a6eae7b" "d85fe6335a6eae7b"
], ],
"x": 775, "x": 955,
"y": 300, "y": 300,
"wires": [] "wires": []
}, },
@ -3406,7 +3310,7 @@
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 290, "x": 210,
"y": 240, "y": 240,
"wires": [ "wires": [
[ [
@ -4479,17 +4383,6 @@
] ]
] ]
}, },
{
"id": "6b5dd5979114ad9c",
"type": "comment",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "buckets which are rooms",
"info": "",
"x": 1070,
"y": 480,
"wires": []
},
{ {
"id": "69a45eebaa58325f", "id": "69a45eebaa58325f",
"type": "debug", "type": "debug",
@ -4504,8 +4397,8 @@
"targetType": "full", "targetType": "full",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 770, "x": 870,
"y": 480, "y": 420,
"wires": [] "wires": []
}, },
{ {
@ -7502,7 +7395,7 @@
"f4e4d84dd55f9d0d" "f4e4d84dd55f9d0d"
], ],
"x": 135, "x": 135,
"y": 420, "y": 480,
"wires": [ "wires": [
[ [
"4e5188bf59004a54" "4e5188bf59004a54"
@ -7514,18 +7407,20 @@
"type": "split", "type": "split",
"z": "1362a4b4f08f3d5b", "z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537", "g": "d62c9cf0cb81a537",
"name": "", "name": "rooms",
"splt": "\\n", "splt": "\\n",
"spltType": "str", "spltType": "str",
"arraySplt": 1, "arraySplt": 1,
"arraySpltType": "len", "arraySpltType": "len",
"stream": false, "stream": false,
"addname": "room", "addname": "room",
"x": 470, "property": "payload",
"y": 420, "x": 650,
"y": 480,
"wires": [ "wires": [
[ [
"fc14608145819575" "fc14608145819575",
"69a45eebaa58325f"
] ]
] ]
}, },
@ -7534,7 +7429,7 @@
"type": "change", "type": "change",
"z": "1362a4b4f08f3d5b", "z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537", "g": "d62c9cf0cb81a537",
"name": "from global", "name": "get rooms from global",
"rules": [ "rules": [
{ {
"t": "set", "t": "set",
@ -7556,8 +7451,8 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 290, "x": 440,
"y": 420, "y": 480,
"wires": [ "wires": [
[ [
"39740b8338a622fd" "39740b8338a622fd"
@ -7569,7 +7464,7 @@
"type": "change", "type": "change",
"z": "1362a4b4f08f3d5b", "z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537", "g": "d62c9cf0cb81a537",
"name": "to global", "name": "to global metrics",
"rules": [ "rules": [
{ {
"t": "set", "t": "set",
@ -7584,8 +7479,8 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 840, "x": 1040,
"y": 420, "y": 480,
"wires": [ "wires": [
[] []
] ]
@ -7611,13 +7506,54 @@
"checkall": "false", "checkall": "false",
"repair": false, "repair": false,
"outputs": 2, "outputs": 2,
"x": 650, "x": 830,
"y": 420, "y": 480,
"wires": [ "wires": [
[], [],
[ [
"cc946bae3f4b46d8" "cc946bae3f4b46d8"
] ]
] ]
},
{
"id": "6b5dd5979114ad9c",
"type": "comment",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "buckets which are rooms",
"info": "",
"x": 590,
"y": 420,
"wires": []
},
{
"id": "a1dbeb8cf51c3366",
"type": "inject",
"z": "1362a4b4f08f3d5b",
"g": "d62c9cf0cb81a537",
"name": "reload rooms",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 210,
"y": 420,
"wires": [
[
"4e5188bf59004a54"
]
]
} }
] ]

View file

@ -721,6 +721,79 @@
"w": 2124, "w": 2124,
"h": 314 "h": 314
}, },
{
"id": "1021acef5727d683",
"type": "group",
"z": "677f66663a198839",
"name": "room - clock",
"style": {
"fill": "#777777",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"69645e55501064d8",
"a4306c9de01d4722"
],
"x": 68,
"y": 3533,
"w": 2284,
"h": 254
},
{
"id": "69645e55501064d8",
"type": "group",
"z": "677f66663a198839",
"g": "1021acef5727d683",
"name": "room - clock - device",
"style": {
"fill": "#ffC000",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"685a0ab8aaa24747",
"260725a140f7cb61",
"62d9811cb83cb6dd",
"44266579fe2f82fd",
"06ce61297d900620",
"c90a6632bc4b63a3",
"b9934bb215edafe6"
],
"x": 94,
"y": 3559,
"w": 842,
"h": 142
},
{
"id": "a4306c9de01d4722",
"type": "group",
"z": "677f66663a198839",
"g": "1021acef5727d683",
"name": "room - clock - source",
"style": {
"fill": "#0070c0",
"fill-opacity": "0.05",
"label": true
},
"nodes": [
"28812ef076d967f4",
"7f0910ae6f903617",
"85890de261cf2a1f",
"ac912f36def02119",
"ffb6d8f6427b4d52",
"7a46605f38735c66",
"b9f3d00e902f65a2",
"1acc4b7b4c392c1f",
"59e31b73c4ea2253",
"5e6d3072053bc3d4",
"61f1ad5814d37ec9"
],
"x": 1034,
"y": 3559,
"w": 1292,
"h": 202
},
{ {
"id": "da2f54e055f1d1ac", "id": "da2f54e055f1d1ac",
"type": "change", "type": "change",
@ -6437,7 +6510,7 @@
"type": "change", "type": "change",
"z": "677f66663a198839", "z": "677f66663a198839",
"g": "0164b91ce85885f1", "g": "0164b91ce85885f1",
"name": "from global", "name": "metrics",
"rules": [ "rules": [
{ {
"t": "set", "t": "set",
@ -6466,7 +6539,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 910, "x": 900,
"y": 4920, "y": 4920,
"wires": [ "wires": [
[ [
@ -6479,14 +6552,15 @@
"type": "split", "type": "split",
"z": "677f66663a198839", "z": "677f66663a198839",
"g": "0164b91ce85885f1", "g": "0164b91ce85885f1",
"name": "split", "name": "buckets",
"splt": "\\n", "splt": "\\n",
"spltType": "str", "spltType": "str",
"arraySplt": 1, "arraySplt": 1,
"arraySpltType": "len", "arraySpltType": "len",
"stream": false, "stream": false,
"addname": "", "addname": "",
"x": 1090, "property": "payload",
"x": 1080,
"y": 4920, "y": 4920,
"wires": [ "wires": [
[ [
@ -9552,5 +9626,524 @@
"x": 2310, "x": 2310,
"y": 2700, "y": 2700,
"wires": [] "wires": []
},
{
"id": "685a0ab8aaa24747",
"type": "change",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "clock / work day / boolean / false",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "work day",
"tot": "str"
},
{
"t": "set",
"p": "format",
"pt": "msg",
"to": "boolean",
"tot": "str"
},
{
"t": "set",
"p": "default",
"pt": "msg",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 3600,
"wires": [
[
"260725a140f7cb61"
]
]
},
{
"id": "260725a140f7cb61",
"type": "link out",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "room - clock - device",
"mode": "link",
"links": [
"bfa594bf1f876c92"
],
"x": 895,
"y": 3660,
"wires": []
},
{
"id": "62d9811cb83cb6dd",
"type": "link in",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "room - clock - device",
"links": [
"25445f5a9b787a0a"
],
"x": 135,
"y": 3660,
"wires": [
[
"06ce61297d900620"
]
]
},
{
"id": "44266579fe2f82fd",
"type": "change",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "clock/ work eve / boolean / false",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "work eve",
"tot": "str"
},
{
"t": "set",
"p": "format",
"pt": "msg",
"to": "boolean",
"tot": "str"
},
{
"t": "set",
"p": "default",
"pt": "msg",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 3660,
"wires": [
[
"260725a140f7cb61"
]
]
},
{
"id": "06ce61297d900620",
"type": "change",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "rooms",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "rooms",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 270,
"y": 3660,
"wires": [
[
"c90a6632bc4b63a3"
]
]
},
{
"id": "c90a6632bc4b63a3",
"type": "split",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "rooms",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "room",
"property": "payload",
"x": 430,
"y": 3660,
"wires": [
[
"685a0ab8aaa24747",
"44266579fe2f82fd"
]
]
},
{
"id": "b9934bb215edafe6",
"type": "comment",
"z": "677f66663a198839",
"g": "69645e55501064d8",
"name": "create clock for each room",
"info": "",
"x": 230,
"y": 3600,
"wires": []
},
{
"id": "28812ef076d967f4",
"type": "link out",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "room - clock - source - in",
"mode": "link",
"links": [
"151c140cd7171c80",
"3db710d8b9023738",
"42c36b63863ecb77",
"84aad657cc3015c1",
"f1ddd31035db0cc4"
],
"x": 1335,
"y": 3600,
"wires": []
},
{
"id": "7f0910ae6f903617",
"type": "change",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "sync",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "sync",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1210,
"y": 3600,
"wires": [
[
"28812ef076d967f4"
]
]
},
{
"id": "85890de261cf2a1f",
"type": "link in",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "room - clock - source - out",
"links": [
"2ecf7207d27bb785",
"bbae4d26e41478ea",
"c469093ebb0005f9",
"e0395c593211c049",
"e0ee48357ee30544"
],
"x": 1495,
"y": 3600,
"wires": [
[
"b9f3d00e902f65a2"
]
]
},
{
"id": "ac912f36def02119",
"type": "switch",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "topic",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "day",
"vt": "str"
},
{
"t": "eq",
"v": "eve",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 1970,
"y": 3600,
"wires": [
[
"7a46605f38735c66"
],
[
"7a46605f38735c66"
]
]
},
{
"id": "ffb6d8f6427b4d52",
"type": "link out",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "room - clock - source",
"mode": "link",
"links": [],
"x": 2285,
"y": 3600,
"wires": []
},
{
"id": "7a46605f38735c66",
"type": "change",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "metric",
"rules": [
{
"t": "set",
"p": "bucket",
"pt": "msg",
"to": "room",
"tot": "msg"
},
{
"t": "set",
"p": "measurement",
"pt": "msg",
"to": "clock",
"tot": "str"
},
{
"t": "set",
"p": "field",
"pt": "msg",
"to": "'work '&msg.topic",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$boolean(msg.payload)",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2150,
"y": 3600,
"wires": [
[
"ffb6d8f6427b4d52"
]
]
},
{
"id": "b9f3d00e902f65a2",
"type": "switch",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "sync",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "sync",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 1630,
"y": 3600,
"wires": [
[
"59e31b73c4ea2253",
"61f1ad5814d37ec9"
],
[
"1acc4b7b4c392c1f"
]
]
},
{
"id": "1acc4b7b4c392c1f",
"type": "delay",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "250 ms",
"pauseType": "delay",
"timeout": "250",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1800,
"y": 3720,
"wires": [
[
"ac912f36def02119"
]
]
},
{
"id": "59e31b73c4ea2253",
"type": "change",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "work day",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "day",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1800,
"y": 3600,
"wires": [
[
"ac912f36def02119"
]
]
},
{
"id": "5e6d3072053bc3d4",
"type": "link in",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "room - clock - source",
"links": [
"074a67bf0fcf09ad"
],
"x": 1075,
"y": 3600,
"wires": [
[
"7f0910ae6f903617"
]
]
},
{
"id": "61f1ad5814d37ec9",
"type": "change",
"z": "677f66663a198839",
"g": "a4306c9de01d4722",
"name": "work eve",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "eve",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1800,
"y": 3660,
"wires": [
[
"ac912f36def02119"
]
]
} }
] ]