diff --git a/.gitignore b/.gitignore index e0d20f5..06cb29c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +node_modules/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/Mieszkanie Kuby/flows.json b/Mieszkanie Kuby/flows.json new file mode 100644 index 0000000..da99fc5 --- /dev/null +++ b/Mieszkanie Kuby/flows.json @@ -0,0 +1 @@ +[{"id":"5c0986ec.93df28","type":"tab","label":"Biuro","disabled":false,"info":""},{"id":"64f43831.2c3f38","type":"server-state-changed","z":"5c0986ec.93df28","name":"Włącznik obok serwera","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in11"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":100,"wires":[["26d8854.1c92e7a"]]},{"id":"185ee5a7.e9852a","type":"function","z":"5c0986ec.93df28","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":100,"wires":[["ad10751c.4e9d88"]]},{"id":"922b2ae1.9b7608","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":80,"wires":[["185ee5a7.e9852a"]]},{"id":"fdce932a.0ff7d","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":120,"wires":[["185ee5a7.e9852a"]]},{"id":"5a6aae6b.c3d62","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":100,"wires":[["922b2ae1.9b7608"],["fdce932a.0ff7d"]]},{"id":"26d8854.1c92e7a","type":"change","z":"5c0986ec.93df28","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":100,"wires":[["5a6aae6b.c3d62"]]},{"id":"ad10751c.4e9d88","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":100,"wires":[["ac0f4d3f.cb48c"],["23d19588.08fa5a"],["a511bdb0.05322"],[]]},{"id":"ac0f4d3f.cb48c","type":"api-call-service","z":"5c0986ec.93df28","name":"Ledy nad Serwerem","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_serwer_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1260,"y":40,"wires":[[]]},{"id":"23d19588.08fa5a","type":"api-call-service","z":"5c0986ec.93df28","name":"Lampa Biuro","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.test_led_2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1230,"y":100,"wires":[[]]},{"id":"a511bdb0.05322","type":"api-call-service","z":"5c0986ec.93df28","name":"Wetnylator obieg","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub3_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1250,"y":160,"wires":[[]]},{"id":"691f091e.80d828","type":"server-state-changed","z":"5c0986ec.93df28","name":"Włącznik obok serwera","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in12"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":360,"wires":[["76d9d38b.0407fc"]]},{"id":"6cc2cd65.3fbba4","type":"function","z":"5c0986ec.93df28","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":360,"wires":[["2aaf96fe.ca3d7a"]]},{"id":"5481b8a3.647a98","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":340,"wires":[["6cc2cd65.3fbba4"]]},{"id":"9168e352.c5ac6","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":380,"wires":[["6cc2cd65.3fbba4"]]},{"id":"228c19cf.a7b5b6","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":360,"wires":[["5481b8a3.647a98"],["9168e352.c5ac6"]]},{"id":"76d9d38b.0407fc","type":"change","z":"5c0986ec.93df28","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":360,"wires":[["228c19cf.a7b5b6"]]},{"id":"2aaf96fe.ca3d7a","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":360,"wires":[["2a979101.9179ae","ea459146.a9952"],["2a979101.9179ae"],[],["1a4a7aae818a0d97"]]},{"id":"ea459146.a9952","type":"api-call-service","z":"5c0986ec.93df28","name":"Lampa Biuro","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1230,"y":300,"wires":[[]]},{"id":"2a979101.9179ae","type":"api-call-service","z":"5c0986ec.93df28","name":"Korytarz Halogeny","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out14"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1250,"y":360,"wires":[[]]},{"id":"d7bb2e07.a463c","type":"api-call-service","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"switch.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["switch.lampa_biuro"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"switch","service":"toggle","x":670,"y":720,"wires":[[]]},{"id":"8e952a2c.76e198","type":"server-state-changed","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.wlacznik_biuro"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":320,"y":720,"wires":[["d7bb2e07.a463c"],[]]},{"id":"8bef34d.57956c8","type":"server-state-changed","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.wlacznik_biala_lazienka_kinkiety"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":440,"y":780,"wires":[["777b478.4e0c9b8"],[]]},{"id":"777b478.4e0c9b8","type":"api-call-service","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"switch.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["switch.kinkiety_lazenka_skos"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"switch","service":"toggle","x":750,"y":780,"wires":[[]]},{"id":"c8792435.16bd08","type":"server-state-changed","z":"5c0986ec.93df28","name":"Ogrzewanie na 3 godziny","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["input_boolean.switch"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":1700,"wires":[["a0836b00.ce08f8"],[]]},{"id":"dc3c4735.eb8a68","type":"api-call-service","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"input_boolean.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["input_boolean.switch"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"input_boolean","service":"turn_off","x":1090,"y":1700,"wires":[[]]},{"id":"a0836b00.ce08f8","type":"api-call-service","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"switch.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["switch.ogrzewanie_glowica_1_1","switch.ogrzewanie_glowica_1_2","switch.ogrzewanie_glowica_1_3","switch.ogrzewanie_glowica_1_4","switch.ogrzewanie_glowica_1_5","switch.ogrzewanie_glowica_1_6","switch.ogrzewanie_glowica_1_7","switch.ogrzewanie_glowica_1_8","switch.ogrzewanie_glowica_2_1","switch.ogrzewanie_glowica_2_2","switch.ogrzewanie_glowica_2_3","switch.ogrzewanie_glowica_2_4","switch.ogrzewanie_glowica_2_5_2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"switch","service":"turn_on","x":440,"y":1700,"wires":[["687b0b1f.ba3ba4"]]},{"id":"687b0b1f.ba3ba4","type":"delay","z":"5c0986ec.93df28","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"hours","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":600,"y":1700,"wires":[["a4021a9e.2aa1d8"]]},{"id":"a4021a9e.2aa1d8","type":"api-call-service","z":"5c0986ec.93df28","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"switch.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["switch.ogrzewanie_glowica_1_1","switch.ogrzewanie_glowica_1_2","switch.ogrzewanie_glowica_1_3","switch.ogrzewanie_glowica_1_4","switch.ogrzewanie_glowica_1_5","switch.ogrzewanie_glowica_1_6","switch.ogrzewanie_glowica_1_7","switch.ogrzewanie_glowica_1_8","switch.ogrzewanie_glowica_2_1","switch.ogrzewanie_glowica_2_2","switch.ogrzewanie_glowica_2_3","switch.ogrzewanie_glowica_2_4","switch.ogrzewanie_glowica_2_5_2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"switch","service":"turn_off","x":820,"y":1700,"wires":[["dc3c4735.eb8a68"]]},{"id":"64c1b8477d962e2f","type":"server-state-changed","z":"5c0986ec.93df28","name":"Biuro","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in10"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":90,"y":540,"wires":[["042cccc3c8c9434f"]]},{"id":"598ecaa3dd339a92","type":"function","z":"5c0986ec.93df28","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":540,"wires":[["04196e857862998f"]]},{"id":"ede3f4eb72e878b8","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":520,"wires":[["598ecaa3dd339a92"]]},{"id":"9f98b593712fc2ac","type":"timed-counter","z":"5c0986ec.93df28","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":560,"wires":[["598ecaa3dd339a92"]]},{"id":"4495aff367736b75","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":540,"wires":[["ede3f4eb72e878b8"],["9f98b593712fc2ac"]]},{"id":"042cccc3c8c9434f","type":"change","z":"5c0986ec.93df28","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":540,"wires":[["4495aff367736b75"]]},{"id":"04196e857862998f","type":"switch","z":"5c0986ec.93df28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":540,"wires":[["fcc00f49eeb6be15"],["78bef18eec058e78","44d6a5099c8e831b"],[],[]]},{"id":"fcc00f49eeb6be15","type":"api-call-service","z":"5c0986ec.93df28","name":"Lampa Biuro","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1230,"y":480,"wires":[[]]},{"id":"78bef18eec058e78","type":"api-call-service","z":"5c0986ec.93df28","name":"Ledy nad Serwerem","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_serwer_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"turn_off","x":1260,"y":600,"wires":[[]]},{"id":"44d6a5099c8e831b","type":"api-call-service","z":"5c0986ec.93df28","name":"Lampa Biuro","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"turn_off","x":1230,"y":540,"wires":[[]]},{"id":"1a4a7aae818a0d97","type":"api-call-service","z":"5c0986ec.93df28","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1270,"y":420,"wires":[["16d0a24839aca066"]]},{"id":"16d0a24839aca066","type":"api-call-service","z":"5c0986ec.93df28","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1540,"y":420,"wires":[[]]},{"id":"444bef4a.a25ef","type":"tab","label":"Korytarze + Wejście","disabled":false,"info":""},{"id":"8ffbabbb.6efb98","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Wejście 1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in0"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":160,"wires":[["d7757f18.15c55"]]},{"id":"98aacaab.6bce68","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":160,"wires":[["305490e2.f4b92"]]},{"id":"83d89329.901ad","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":140,"wires":[["98aacaab.6bce68"]]},{"id":"cab085a3.baf2e8","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":180,"wires":[["98aacaab.6bce68"]]},{"id":"963349bf.20c418","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":160,"wires":[["83d89329.901ad"],["cab085a3.baf2e8"]]},{"id":"d7757f18.15c55","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":160,"wires":[["963349bf.20c418"]]},{"id":"305490e2.f4b92","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":160,"wires":[["266b0f83.6ebcc"],[],[],["ce1412cf0c2ecc1b"]]},{"id":"266b0f83.6ebcc","type":"api-call-service","z":"444bef4a.a25ef","name":"Halogeny Wejście","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out15"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":100,"wires":[[]]},{"id":"4f46cda5.9dfc64","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Wejście 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in2"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":340,"wires":[["d2bc14f0.9604e8"]]},{"id":"a71a1217.e944a","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":340,"wires":[["2fe17d8a.78a332"]]},{"id":"ecffca09.59c3a8","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":320,"wires":[["a71a1217.e944a"]]},{"id":"93017fb2.36034","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":360,"wires":[["a71a1217.e944a"]]},{"id":"39895e8d.b62072","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":340,"wires":[["ecffca09.59c3a8"],["93017fb2.36034"]]},{"id":"d2bc14f0.9604e8","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":340,"wires":[["39895e8d.b62072"]]},{"id":"2fe17d8a.78a332","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":340,"wires":[["33e46d9e.3f1012"],[],[],[]]},{"id":"33e46d9e.3f1012","type":"api-call-service","z":"444bef4a.a25ef","name":"Halogeny Główny Korytarz","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out14"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1300,"y":280,"wires":[[]]},{"id":"2e955a0e.331646","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Wejście 3","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in2"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":520,"wires":[["ead61c90.b5ae1"]]},{"id":"4e4bb15f.4542","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":520,"wires":[["5239600d.06606"]]},{"id":"86f335cc.d4ea88","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":500,"wires":[["4e4bb15f.4542"]]},{"id":"1c4515aa.dfa56a","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":540,"wires":[["4e4bb15f.4542"]]},{"id":"bec31a49.2c2bc8","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":520,"wires":[["86f335cc.d4ea88"],["1c4515aa.dfa56a"]]},{"id":"ead61c90.b5ae1","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":520,"wires":[["bec31a49.2c2bc8"]]},{"id":"5239600d.06606","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":520,"wires":[["47917dff.b52884"],[],[],["8b78888f2b4914db"]]},{"id":"47917dff.b52884","type":"api-call-service","z":"444bef4a.a25ef","name":"Kinkiety korytarz","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.korytarz_kinkiety"],"labelId":[],"data":"{\"effect\":\"Rise light\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1260,"y":460,"wires":[[]]},{"id":"caaa4ff3.a431b","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Korytarz 1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in2"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":740,"wires":[["708182c5.8f4e6c"]]},{"id":"eadd9c35.8ff2d","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":740,"wires":[["2dc4091b.9da8a6"]]},{"id":"f793c7af.d07508","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":720,"wires":[["eadd9c35.8ff2d"]]},{"id":"c2de01bf.5dcb7","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":760,"wires":[["eadd9c35.8ff2d"]]},{"id":"d0206dcb.0b422","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":740,"wires":[["f793c7af.d07508"],["c2de01bf.5dcb7"]]},{"id":"708182c5.8f4e6c","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":740,"wires":[["d0206dcb.0b422"]]},{"id":"2dc4091b.9da8a6","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":740,"wires":[["d35e4b30.7d3e98"],[],[],["a18ef0d3c2e525c1"]]},{"id":"54d6a813.d14418","type":"api-call-service","z":"444bef4a.a25ef","name":"Halogeny Wejście","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out15"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":860,"wires":[[]]},{"id":"433ecc13.e07064","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Korytarz 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in0"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":920,"wires":[["b404ef21.76c71"]]},{"id":"19f2ea8a.514ad5","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":920,"wires":[["ff72cfe1.1cce9"]]},{"id":"f5ed615e.4ce7e","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":900,"wires":[["19f2ea8a.514ad5"]]},{"id":"9f699ce7.4d586","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":940,"wires":[["19f2ea8a.514ad5"]]},{"id":"bbf807a3.3da6e8","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":920,"wires":[["f5ed615e.4ce7e"],["9f699ce7.4d586"]]},{"id":"b404ef21.76c71","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":920,"wires":[["bbf807a3.3da6e8"]]},{"id":"ff72cfe1.1cce9","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":920,"wires":[["54d6a813.d14418"],[],[],[]]},{"id":"d35e4b30.7d3e98","type":"api-call-service","z":"444bef4a.a25ef","name":"Halogeny Główny Korytarz","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out14"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1300,"y":680,"wires":[[]]},{"id":"fe0689a4.563018","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Korytarz 3","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in1"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":1100,"wires":[["7d48dc2c.3986b4"]]},{"id":"d89451eb.c0778","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1100,"wires":[["2de932bc.c769de"]]},{"id":"ec239395.768db","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1080,"wires":[["d89451eb.c0778"]]},{"id":"65c8f0a3.98888","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1120,"wires":[["d89451eb.c0778"]]},{"id":"d5b7f0a.535621","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1100,"wires":[["ec239395.768db"],["65c8f0a3.98888"]]},{"id":"7d48dc2c.3986b4","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1100,"wires":[["d5b7f0a.535621"]]},{"id":"2de932bc.c769de","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1100,"wires":[["472a9c2f.cf8b24"],[],[],["d6f4f5cafe4d058e"]]},{"id":"472a9c2f.cf8b24","type":"api-call-service","z":"444bef4a.a25ef","name":"Kinkiety korytarz","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.korytarz_kinkiety"],"labelId":[],"data":"{\"effect\":\"Rise light\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1260,"y":1040,"wires":[[]]},{"id":"bc9e7d6f.3a5dc","type":"server-state-changed","z":"444bef4a.a25ef","name":"Włącznik Korytarz maŲ�y","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in3"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":160,"y":1280,"wires":[["84f84bde.5d56e8"]]},{"id":"dbc0247d.eea2c8","type":"function","z":"444bef4a.a25ef","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>400) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"timeout":"","noerr":3,"initialize":"","finalize":"","libs":[],"x":900,"y":1280,"wires":[["8e259ef8.a7ca2"]]},{"id":"97e983e1.d7e95","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"400","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1260,"wires":[["dbc0247d.eea2c8"]]},{"id":"1cce02a2.b2380d","type":"timed-counter","z":"444bef4a.a25ef","name":"","timelimit":"400","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1300,"wires":[["dbc0247d.eea2c8"]]},{"id":"76c75bfc.4a76f4","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1280,"wires":[["97e983e1.d7e95"],["1cce02a2.b2380d"]]},{"id":"84f84bde.5d56e8","type":"change","z":"444bef4a.a25ef","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1280,"wires":[["76c75bfc.4a76f4"]]},{"id":"8e259ef8.a7ca2","type":"switch","z":"444bef4a.a25ef","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1280,"wires":[["b66ca183.b16fa"],["d4d89278.2b956"],[],[]]},{"id":"f8e069e4.8292a8","type":"api-call-service","z":"444bef4a.a25ef","name":"Kinkiet Mały korytarz ","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out13"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1480,"y":1300,"wires":[[]]},{"id":"b8570112.3afd","type":"api-call-service","z":"444bef4a.a25ef","name":"Halogeny Mały Korytarz","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out3"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1490,"y":1220,"wires":[[]]},{"id":"b66ca183.b16fa","type":"time-range-switch","z":"444bef4a.a25ef","name":"6-20am","lat":"","lon":"","startTime":"06:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":1220,"y":1240,"wires":[["b8570112.3afd"],["f8e069e4.8292a8"]]},{"id":"d4d89278.2b956","type":"time-range-switch","z":"444bef4a.a25ef","name":"6-20am","lat":"","lon":"","startTime":"06:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":1220,"y":1300,"wires":[["f8e069e4.8292a8"],["b8570112.3afd"]]},{"id":"ce1412cf0c2ecc1b","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1290,"y":220,"wires":[["a2a602999b5ec910"]]},{"id":"8b78888f2b4914db","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1290,"y":580,"wires":[["a97e469dcb3d6d06"]]},{"id":"d6f4f5cafe4d058e","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1290,"y":1160,"wires":[["758b52a70e38c7a3"]]},{"id":"a18ef0d3c2e525c1","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1290,"y":780,"wires":[["ec0f7deb2634995f"]]},{"id":"a2a602999b5ec910","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1560,"y":220,"wires":[[]]},{"id":"a97e469dcb3d6d06","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1580,"y":580,"wires":[[]]},{"id":"ec0f7deb2634995f","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1580,"y":780,"wires":[[]]},{"id":"758b52a70e38c7a3","type":"api-call-service","z":"444bef4a.a25ef","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1580,"y":1160,"wires":[[]]},{"id":"c127068e.175598","type":"tab","label":"Garderoby","disabled":false,"info":""},{"id":"1d55c9cd.510e26","type":"server-state-changed","z":"c127068e.175598","name":"Włącznik Garderoba mała","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in4"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":170,"y":100,"wires":[["e7be23bd.4018d"]]},{"id":"2625b203.45b0ce","type":"function","z":"c127068e.175598","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":100,"wires":[["9255890.a551678"]]},{"id":"8ce6556f.9f7fc8","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":80,"wires":[["2625b203.45b0ce"]]},{"id":"36c92b38.de68f4","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":120,"wires":[["2625b203.45b0ce"]]},{"id":"fe4ff6c.87d3408","type":"switch","z":"c127068e.175598","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":100,"wires":[["8ce6556f.9f7fc8"],["36c92b38.de68f4"]]},{"id":"e7be23bd.4018d","type":"change","z":"c127068e.175598","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":100,"wires":[["fe4ff6c.87d3408"]]},{"id":"9255890.a551678","type":"switch","z":"c127068e.175598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":100,"wires":[["268581bc.10d02e"],["260d62fe.0f5a2e"],[],[]]},{"id":"268581bc.10d02e","type":"api-call-service","z":"c127068e.175598","name":"Garderoba mała","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out14"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1260,"y":40,"wires":[[]]},{"id":"260d62fe.0f5a2e","type":"api-call-service","z":"c127068e.175598","name":"Wetnylator obieg","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub3_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":100,"wires":[[]]},{"id":"fdc8921b.93877","type":"api-call-service","z":"c127068e.175598","name":"Duża Garderoba","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out7"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":180,"wires":[[]]},{"id":"411903fe10828364","type":"function","z":"c127068e.175598","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":220,"wires":[["47194414a2d8b124"]]},{"id":"517e2c5d23f8ebef","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":200,"wires":[["411903fe10828364"]]},{"id":"26690934f928c9cd","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":240,"wires":[["411903fe10828364"]]},{"id":"019d83882c3da0fa","type":"switch","z":"c127068e.175598","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":220,"wires":[["517e2c5d23f8ebef"],["26690934f928c9cd"]]},{"id":"3f1982e3a36e6d7e","type":"change","z":"c127068e.175598","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":220,"wires":[["019d83882c3da0fa"]]},{"id":"47194414a2d8b124","type":"switch","z":"c127068e.175598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":220,"wires":[["fdc8921b.93877"],[],[],[]]},{"id":"b37eb1fde81f629c","type":"server-state-changed","z":"c127068e.175598","name":"Włącznik Garderoba mała","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in0"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":170,"y":220,"wires":[["3f1982e3a36e6d7e"]]},{"id":"9d9e14ecd8d04a3d","type":"api-call-service","z":"c127068e.175598","name":"Duża Garderoba","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out7"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":300,"wires":[[]]},{"id":"b1e33fa37d3fd378","type":"function","z":"c127068e.175598","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":340,"wires":[["1895d9c11c191f6b"]]},{"id":"6bca62b03969890a","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":320,"wires":[["b1e33fa37d3fd378"]]},{"id":"775b8f1f4ecb8ab3","type":"timed-counter","z":"c127068e.175598","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":360,"wires":[["b1e33fa37d3fd378"]]},{"id":"4d773c8fe83c1846","type":"switch","z":"c127068e.175598","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":340,"wires":[["6bca62b03969890a"],["775b8f1f4ecb8ab3"]]},{"id":"c9b9b3569d9fa91c","type":"change","z":"c127068e.175598","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":340,"wires":[["4d773c8fe83c1846"]]},{"id":"1895d9c11c191f6b","type":"switch","z":"c127068e.175598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":340,"wires":[["9d9e14ecd8d04a3d"],[],[],[]]},{"id":"d4d51fdc49e62b0a","type":"server-state-changed","z":"c127068e.175598","name":"Włącznik Garderoba mała","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in1"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":170,"y":340,"wires":[["c9b9b3569d9fa91c"]]},{"id":"dcac36e782856427","type":"server-state-changed","z":"c127068e.175598","name":"Włącznik Garderoba mała","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in1"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":170,"y":480,"wires":[[]]},{"id":"ad18d5c7.ff8828","type":"tab","label":"Sypialnie","disabled":false,"info":""},{"id":"ff729c74.ce7ba","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia mała 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in8"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":100,"wires":[["87d5127d.0f944"]]},{"id":"f98f96d8.2b5628","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Halogen + Lampa sypialnia mała","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out10"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1260,"y":60,"wires":[[]]},{"id":"493f8ce4.750644","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia mała 1","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in9"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":260,"wires":[["3efc4fc.d0831b"],[]]},{"id":"f8cffc03.5bdde","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia duża 1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in4"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":440,"wires":[["c3f56d4d.8b60a"]]},{"id":"4fae414e.e3586","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":440,"wires":[["3904558a.188a9a"]]},{"id":"cbbf80f9.f10ca","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":420,"wires":[["4fae414e.e3586"]]},{"id":"5b0b75be.dae0ec","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":460,"wires":[["4fae414e.e3586"]]},{"id":"3e59815e.9c1f1e","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":440,"wires":[["cbbf80f9.f10ca"],["5b0b75be.dae0ec"]]},{"id":"c3f56d4d.8b60a","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":440,"wires":[["3e59815e.9c1f1e"]]},{"id":"3904558a.188a9a","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":440,"wires":[["1f2acfcc.97ea2"],["8b8f9c9c0a5e875a"],[],[]]},{"id":"1f2acfcc.97ea2","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Ledy w suficie","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_sypialnia_led"],"labelId":[],"data":"{\t \"brightness\": 50,\t \"rgb_color\": [\t 255,\t 0,\t 0\t ]\t \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1240,"y":380,"wires":[[]]},{"id":"59fa2f9f.d081c","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia duża 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in5"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":600,"wires":[["99f06904.7d3698"]]},{"id":"7eb3c11c.fda55","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":600,"wires":[["c5069d0f.2eab6"]]},{"id":"11219a6d.bfad06","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":580,"wires":[["7eb3c11c.fda55"]]},{"id":"c074fb60.0cbac8","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":620,"wires":[["7eb3c11c.fda55"]]},{"id":"db8f0c15.d87c6","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":600,"wires":[["11219a6d.bfad06"],["c074fb60.0cbac8"]]},{"id":"99f06904.7d3698","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":600,"wires":[["db8f0c15.d87c6"]]},{"id":"c5069d0f.2eab6","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":600,"wires":[["f4809350.f8119"],[],[],[]]},{"id":"f4809350.f8119","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Sypialnia duża TV","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out7"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1250,"y":540,"wires":[[]]},{"id":"ff79160.e08dee8","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia duża 3","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in3"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":760,"wires":[["33d2e841.0f2e98"]]},{"id":"7f4f1720.12e3f8","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":760,"wires":[["52380b77.169044"]]},{"id":"d9f7c752.c4fad8","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":740,"wires":[["7f4f1720.12e3f8"]]},{"id":"c92d92df.60f66","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":780,"wires":[["7f4f1720.12e3f8"]]},{"id":"dadef394.2e7d9","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":760,"wires":[["d9f7c752.c4fad8"],["c92d92df.60f66"]]},{"id":"33d2e841.0f2e98","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":760,"wires":[["dadef394.2e7d9"]]},{"id":"52380b77.169044","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":760,"wires":[["b2af43a6.d871a"],["ea662680.6a6a48"],[],[]]},{"id":"b2af43a6.d871a","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Włącz Lampy nad łóżkiem","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out12","light.main_hub_hub2_out1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"turn_on","x":1270,"y":700,"wires":[[]]},{"id":"ea662680.6a6a48","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Wyłącz Lampy nad łózkiem","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out12","light.main_hub_hub2_out1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1280,"y":760,"wires":[[]]},{"id":"c1bb31a9.7313","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia Łóżko prawo","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in6"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":940,"wires":[["3dc39e07.7a4e62"]]},{"id":"7fb0a74d.a83d28","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":940,"wires":[["e43c2113.b46ee"]]},{"id":"c3a7365.573abc8","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":920,"wires":[["7fb0a74d.a83d28"]]},{"id":"6eac543a.dec74c","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":960,"wires":[["7fb0a74d.a83d28"]]},{"id":"5033dc65.fb60f4","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":940,"wires":[["c3a7365.573abc8"],["6eac543a.dec74c"]]},{"id":"3dc39e07.7a4e62","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":940,"wires":[["5033dc65.fb60f4"]]},{"id":"e43c2113.b46ee","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":940,"wires":[["1b427f86.60162"],["66e8a832.486458"],[],["1d8725c151f8575c"]]},{"id":"1b427f86.60162","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Halogen nad łóżkiem prawy","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1280,"y":880,"wires":[[]]},{"id":"c8181846.257548","type":"server-state-changed","z":"ad18d5c7.ff8828","name":"Sypialnia Łóżko lewo","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub1_in7"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":1120,"wires":[["bf2c5cff.dad81"]]},{"id":"1e0548be.7419d7","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":1120,"wires":[["da824854.49a0a8"]]},{"id":"184be79d.956ce8","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":1100,"wires":[["1e0548be.7419d7"]]},{"id":"8f5d4312.9880e","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":700,"y":1140,"wires":[["1e0548be.7419d7"]]},{"id":"4fbc7db2.0568a4","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":1120,"wires":[["184be79d.956ce8"],["8f5d4312.9880e"]]},{"id":"bf2c5cff.dad81","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1120,"wires":[["4fbc7db2.0568a4"]]},{"id":"da824854.49a0a8","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":1120,"wires":[["250aae82.2406e2"],["66e8a832.486458"],[],["1d8725c151f8575c"]]},{"id":"250aae82.2406e2","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Halogen nad łóżkiem lewy","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out12"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":1060,"wires":[[]]},{"id":"3efc4fc.d0831b","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Ledy w suficie","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_pokoj_dla_gosci_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":360,"y":260,"wires":[[]]},{"id":"47ffce42.c7f11","type":"function","z":"ad18d5c7.ff8828","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":100,"wires":[["19dfd9b9.d79586"]]},{"id":"7ab594f0.2b905c","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":680,"y":80,"wires":[["47ffce42.c7f11"]]},{"id":"fbece98d.516e48","type":"timed-counter","z":"ad18d5c7.ff8828","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":680,"y":120,"wires":[["47ffce42.c7f11"]]},{"id":"42721387.13eacc","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":100,"wires":[["7ab594f0.2b905c"],["fbece98d.516e48"]]},{"id":"87d5127d.0f944","type":"change","z":"ad18d5c7.ff8828","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":100,"wires":[["42721387.13eacc"]]},{"id":"19dfd9b9.d79586","type":"switch","z":"ad18d5c7.ff8828","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1010,"y":100,"wires":[["f98f96d8.2b5628"],["a40ca866.d005c8"],[],[]]},{"id":"a40ca866.d005c8","type":"api-call-service","z":"ad18d5c7.ff8828","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out7"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1240,"y":120,"wires":[[]]},{"id":"66e8a832.486458","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Wyłąćz Halogen nad łóżkiem","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out12","light.main_hub_hub2_out1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1280,"y":940,"wires":[[]]},{"id":"8b8f9c9c0a5e875a","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Ledy w suficie","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_sypialnia_led"],"labelId":[],"data":"{\t \"brightness\": 255,\t \"rgb_color\": [\t 255,\t 255,\t 255\t ]\t \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1240,"y":440,"wires":[[]]},{"id":"1d8725c151f8575c","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1270,"y":1000,"wires":[["d531d430f673c67e"]]},{"id":"d531d430f673c67e","type":"api-call-service","z":"ad18d5c7.ff8828","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1600,"y":1000,"wires":[[]]},{"id":"49d9a8ab.75a718","type":"tab","label":"Salon i Kuchnia","disabled":false,"info":""},{"id":"2ee0efb6.9053f","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":100,"wires":[["b380588.5b47ca8"]]},{"id":"35cc37c6.0088d8","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":80,"wires":[["2ee0efb6.9053f"]]},{"id":"9f2b5908.6fee68","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":120,"wires":[["2ee0efb6.9053f"]]},{"id":"ee4cd089.69895","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":100,"wires":[["35cc37c6.0088d8"],["9f2b5908.6fee68"]]},{"id":"26c78eb0.19b7b2","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":100,"wires":[["ee4cd089.69895"]]},{"id":"b380588.5b47ca8","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":100,"wires":[["1e40e868.60aa78"],["2684ae6c.728cd2"],[],[]]},{"id":"1e40e868.60aa78","type":"api-call-service","z":"49d9a8ab.75a718","name":"Plafon Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out11"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1250,"y":40,"wires":[[]]},{"id":"d2d087b3.0cec18","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 1_2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in10"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":280,"wires":[["59b61177.68ab"]]},{"id":"644ba8e2.983168","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":280,"wires":[["405cea66.311ce4"]]},{"id":"aec18fed.41b65","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":260,"wires":[["644ba8e2.983168"]]},{"id":"c9852e06.55539","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":300,"wires":[["644ba8e2.983168"]]},{"id":"2b527e99.028742","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":280,"wires":[["aec18fed.41b65"],["c9852e06.55539"]]},{"id":"59b61177.68ab","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":280,"wires":[["2b527e99.028742"]]},{"id":"405cea66.311ce4","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":280,"wires":[["ac1f9b6c.3eb998"],["5de6ffb0.5e628"],[],["dadb851f.000ea8"]]},{"id":"ac1f9b6c.3eb998","type":"api-call-service","z":"49d9a8ab.75a718","name":"Kinkiety/Komin Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.komin_led","light.salon_kinkiety_led"],"labelId":[],"data":"{\"effect\":\"Rise light\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1280,"y":220,"wires":[[]]},{"id":"627c651d.1c47cc","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 2_1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in7"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":460,"wires":[["57474187.594b1"]]},{"id":"aa98ccca.4c125","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":460,"wires":[["ed29d2bc.b78bf"]]},{"id":"ac6480c9.5436","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":440,"wires":[["aa98ccca.4c125"]]},{"id":"7023d2ee.4f179c","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":480,"wires":[["aa98ccca.4c125"]]},{"id":"e43c9071.131c4","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":460,"wires":[["ac6480c9.5436"],["7023d2ee.4f179c"]]},{"id":"57474187.594b1","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":460,"wires":[["e43c9071.131c4"]]},{"id":"ed29d2bc.b78bf","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":460,"wires":[["aa53aa20.d07478"],[],[],["e7bf5f0b84a73da3"]]},{"id":"aa53aa20.d07478","type":"api-call-service","z":"49d9a8ab.75a718","name":"Kuchnia","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out3"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1240,"y":400,"wires":[[]]},{"id":"29e8b70f.f5c468","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 2_2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in8"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":660,"wires":[["aa4c9fa0.a0ed1"]]},{"id":"5366e17e.e823e","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":660,"wires":[["9f2b1b4.7e161e8"]]},{"id":"5fa72c4a.f2e7a4","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":640,"wires":[["5366e17e.e823e"]]},{"id":"137c1a.a55b33e6","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":680,"wires":[["5366e17e.e823e"]]},{"id":"7a7a424c.22013c","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":660,"wires":[["5fa72c4a.f2e7a4"],["137c1a.a55b33e6"]]},{"id":"aa4c9fa0.a0ed1","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":660,"wires":[["7a7a424c.22013c"]]},{"id":"9f2b1b4.7e161e8","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":660,"wires":[["79c80769.1f9e78"],[],[],[]]},{"id":"53bad49d.d04cbc","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 3_1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in5"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":860,"wires":[["50d071e3.f48dd"]]},{"id":"c838882d.9aff38","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":860,"wires":[["426b7df7.bbad04"]]},{"id":"c44788bf.c6ec68","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"500","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":840,"wires":[["c838882d.9aff38"]]},{"id":"48b6d28a.4af14c","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"500","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":880,"wires":[["c838882d.9aff38"]]},{"id":"e9c45cca.80bcc","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":860,"wires":[["c44788bf.c6ec68"],["48b6d28a.4af14c"]]},{"id":"50d071e3.f48dd","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":860,"wires":[["e9c45cca.80bcc"]]},{"id":"426b7df7.bbad04","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":860,"wires":[["c4dc5fad.09d98"],[],[],[]]},{"id":"c4dc5fad.09d98","type":"api-call-service","z":"49d9a8ab.75a718","name":"Halogeny Jadalnia","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out8"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":800,"wires":[[]]},{"id":"1b9e0836.5ce898","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 3_2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in6"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":1060,"wires":[["caa76c00.dad35"]]},{"id":"3b30d96d.0d3e96","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1060,"wires":[["566d2d5f.a9d824"]]},{"id":"53a62ee6.be399","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1040,"wires":[["3b30d96d.0d3e96"]]},{"id":"f9bfab22.591238","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1080,"wires":[["3b30d96d.0d3e96"]]},{"id":"334a1f33.74556","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1060,"wires":[["53a62ee6.be399"],["f9bfab22.591238"]]},{"id":"caa76c00.dad35","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1060,"wires":[["334a1f33.74556"]]},{"id":"566d2d5f.a9d824","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1060,"wires":[["cbd7dde5.ca87c"],[],[],[]]},{"id":"cbd7dde5.ca87c","type":"api-call-service","z":"49d9a8ab.75a718","name":"Ledy Jadalnia","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_jadalnia_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1260,"y":1000,"wires":[[]]},{"id":"79c80769.1f9e78","type":"api-call-service","z":"49d9a8ab.75a718","name":"Kuchnia","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_kuchnia_lezka_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1240,"y":600,"wires":[[]]},{"id":"61257db4.00aff4","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Salon 1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in12"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":110,"y":1260,"wires":[["833c50ad.80a46"]]},{"id":"2c6af5f6.c2c43a","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1260,"wires":[["85cf8076.a273"]]},{"id":"bd6e77e0.864398","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1240,"wires":[["2c6af5f6.c2c43a"]]},{"id":"e85a64f2.d50228","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1280,"wires":[["2c6af5f6.c2c43a"]]},{"id":"3de7aed2.694712","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1260,"wires":[["bd6e77e0.864398"],["e85a64f2.d50228"]]},{"id":"833c50ad.80a46","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1260,"wires":[["3de7aed2.694712"]]},{"id":"85cf8076.a273","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1260,"wires":[["b60a4176.e655b"],[],[],[]]},{"id":"256efad6.f3ebd6","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Salon 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in13"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":110,"y":1460,"wires":[["f8dda16e.b0184"]]},{"id":"a9a5fd7c.91fe3","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1460,"wires":[["82fb47de.c8e3f8"]]},{"id":"afcf3846.592408","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1440,"wires":[["a9a5fd7c.91fe3"]]},{"id":"da8ac3b9.e5807","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1480,"wires":[["a9a5fd7c.91fe3"]]},{"id":"95033fc0.f8fa1","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1460,"wires":[["afcf3846.592408"],["da8ac3b9.e5807"]]},{"id":"f8dda16e.b0184","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1460,"wires":[["95033fc0.f8fa1"]]},{"id":"82fb47de.c8e3f8","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1460,"wires":[["6ab760c7.6c4e8"],["7db12148.3c70f"],[],["b5cb681e.6b5cd8"]]},{"id":"f5d320f9.b9f76","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Salon 3","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in11"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":110,"y":1660,"wires":[["e0a7dd80.bb4a8"]]},{"id":"5fb40943.d16cd8","type":"function","z":"49d9a8ab.75a718","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1660,"wires":[["d2d5de11.b07b2"]]},{"id":"33e9af33.e9bda","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1640,"wires":[["5fb40943.d16cd8"]]},{"id":"1a59f2ec.ee6b7d","type":"timed-counter","z":"49d9a8ab.75a718","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":1680,"wires":[["5fb40943.d16cd8"]]},{"id":"3ab3c626.cc6a7a","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1660,"wires":[["33e9af33.e9bda"],["1a59f2ec.ee6b7d"]]},{"id":"e0a7dd80.bb4a8","type":"change","z":"49d9a8ab.75a718","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1660,"wires":[["3ab3c626.cc6a7a"]]},{"id":"d2d5de11.b07b2","type":"switch","z":"49d9a8ab.75a718","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":1660,"wires":[["3d8d47b4.addcb8"],[],[],[]]},{"id":"194e6551.84184b","type":"api-call-service","z":"49d9a8ab.75a718","name":"Schody LEDy","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.schody"],"labelId":[],"data":"{\"effect\":\"Rise light\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1260,"y":1700,"wires":[[]]},{"id":"b5cb681e.6b5cd8","type":"api-call-service","z":"49d9a8ab.75a718","name":"Komin Led","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.komin_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1250,"y":1520,"wires":[[]]},{"id":"2684ae6c.728cd2","type":"api-call-service","z":"49d9a8ab.75a718","name":"Wentylator Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.salon_wentylator"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1270,"y":100,"wires":[[]]},{"id":"b60a4176.e655b","type":"api-call-service","z":"49d9a8ab.75a718","name":"Plafon Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out11"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1250,"y":1200,"wires":[[]]},{"id":"6ab760c7.6c4e8","type":"api-call-service","z":"49d9a8ab.75a718","name":"Ledy Kinkiety","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.salon_kinkiet_1_led","light.salon_kinkiet_2_led","light.salon_kinkiet_3_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1250,"y":1400,"wires":[[]]},{"id":"7db12148.3c70f","type":"api-call-service","z":"49d9a8ab.75a718","name":"Ledy Kinkiety","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.salon_kinkiety_led","light.salon_kinkiet_1_led","light.salon_kinkiet_2_led","light.salon_kinkiet_3_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","x":1250,"y":1460,"wires":[[]]},{"id":"3d8d47b4.addcb8","type":"api-call-service","z":"49d9a8ab.75a718","name":"Zwisy schody","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"light.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.oczka_taras_2","light.skrzynia_2","light.tunel_2","light.zwis_schody_2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"toggle","x":1260,"y":1640,"wires":[[]]},{"id":"5de6ffb0.5e628","type":"api-call-service","z":"49d9a8ab.75a718","name":"Kinkiety/Komin Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.komin_led"],"labelId":[],"data":"{\"entity_id\":\"light.komin_led\",\"brightness_step_pct\":\"10\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"turn_on","x":1280,"y":260,"wires":[[]]},{"id":"dadb851f.000ea8","type":"api-call-service","z":"49d9a8ab.75a718","name":"Kinkiety/Komin Salon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.komin_led"],"labelId":[],"data":"{\"entity_id\":\"light.komin_led\",\"brightness_step_pct\":\"-10\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"turn_on","x":1280,"y":300,"wires":[[]]},{"id":"f9b79959.944478","type":"server-state-changed","z":"49d9a8ab.75a718","name":"Filar 1_1","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub2_in9"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":100,"wires":[["26c78eb0.19b7b2"]]},{"id":"e7bf5f0b84a73da3","type":"api-call-service","z":"49d9a8ab.75a718","name":"Wyłącz wszystkie lampy","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1290,"y":540,"wires":[["1cb575eaa9653ce7"]]},{"id":"1cb575eaa9653ce7","type":"api-call-service","z":"49d9a8ab.75a718","name":"Wyłącz wszystkie wantylatory","server":"e6b1b546.b23368","version":7,"debugenabled":false,"action":"fan.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["all"],"labelId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","blockInputOverrides":false,"domain":"fan","service":"turn_off","output_location":"payload","output_location_type":"msg","x":1600,"y":540,"wires":[[]]},{"id":"30212bee.794d64","type":"tab","label":"Łazienki","disabled":false,"info":""},{"id":"9946b814.9c17c8","type":"server-state-changed","z":"30212bee.794d64","name":"SPA Prawy","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in3"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":700,"wires":[["6f58fbd1.3b8d64"]]},{"id":"ddd62738.a6f868","type":"server-state-changed","z":"30212bee.794d64","name":"SPA Lewy","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in2"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":820,"wires":[["57a10cf5.276c44"]]},{"id":"eb3ae55f.697528","type":"api-call-service","z":"30212bee.794d64","name":"SPA Wentylator","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub1_out4"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1560,"y":620,"wires":[[]]},{"id":"3b70701b.fde1f","type":"api-call-service","z":"30212bee.794d64","name":"SPA Ledy","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_spa_ledy"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1530,"y":760,"wires":[[]]},{"id":"1b559a4.fd94366","type":"api-call-service","z":"30212bee.794d64","name":"SPA Halongeny","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out10"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1560,"y":680,"wires":[[]]},{"id":"75fbe49f.07a49c","type":"api-call-service","z":"30212bee.794d64","name":"SPA Zwisy","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out13"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1550,"y":820,"wires":[[]]},{"id":"a25c8db4.995b6","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":700,"wires":[["2117e4bf.f964bc"]]},{"id":"b055b03f.b7739","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":680,"wires":[["a25c8db4.995b6"]]},{"id":"96cfd509.f6f378","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":720,"wires":[["a25c8db4.995b6"]]},{"id":"11c21e6f.9f0e42","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":700,"wires":[["b055b03f.b7739"],["96cfd509.f6f378"]]},{"id":"6f58fbd1.3b8d64","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":700,"wires":[["11c21e6f.9f0e42"]]},{"id":"2117e4bf.f964bc","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1310,"y":700,"wires":[["eb3ae55f.697528","1b559a4.fd94366"],[],[],["3b70701b.fde1f"]]},{"id":"b9273595.e13478","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":820,"wires":[["e653b6b8.d5fb78"]]},{"id":"4c21d334.8c92ec","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":800,"wires":[["b9273595.e13478"]]},{"id":"c0325c6a.a94e5","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":840,"wires":[["b9273595.e13478"]]},{"id":"edacc0c3.90668","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":820,"wires":[["4c21d334.8c92ec"],["c0325c6a.a94e5"]]},{"id":"57a10cf5.276c44","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":820,"wires":[["edacc0c3.90668"]]},{"id":"e653b6b8.d5fb78","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1310,"y":820,"wires":[["75fbe49f.07a49c"],[],[],["b7e5e517.8daba8"]]},{"id":"b7e5e517.8daba8","type":"api-call-service","z":"30212bee.794d64","name":"SPA Wentylator","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub1_out4"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1540,"y":880,"wires":[[]]},{"id":"d592ffb6.70dc","type":"server-state-changed","z":"30212bee.794d64","name":"WC Prawy","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in5"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":940,"wires":[["6bf6bb1b.3654c4","7f5a798821eb50d3","82fcb0139accc567"],[]]},{"id":"6bf6bb1b.3654c4","type":"api-call-service","z":"30212bee.794d64","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out2"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":660,"y":940,"wires":[[]]},{"id":"b433dd7d.0350d","type":"server-state-changed","z":"30212bee.794d64","name":"WC Lewy","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in6"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":1080,"wires":[["8682d019.f3619"],[]]},{"id":"8682d019.f3619","type":"api-call-service","z":"30212bee.794d64","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out9"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":660,"y":1080,"wires":[[]]},{"id":"82fcb0139accc567","type":"api-call-service","z":"30212bee.794d64","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub2_out5"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":660,"y":1000,"wires":[[]]},{"id":"7f5a798821eb50d3","type":"api-call-service","z":"30212bee.794d64","name":"","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.wc_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":660,"y":880,"wires":[[]]},{"id":"302f21b8.48bd2e","type":"api-call-service","z":"30212bee.794d64","name":"Kanciapa pod schodami","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out5"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1590,"y":300,"wires":[[]]},{"id":"cfbe8a46.ea6988","type":"api-call-service","z":"30212bee.794d64","name":"SPA Lustro Kinkiet","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub1_out1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1570,"y":480,"wires":[[]]},{"id":"9c07253dc96776a7","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":360,"wires":[["b68aa77879b21d7c"]]},{"id":"432a318f4b2b79a5","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":340,"wires":[["9c07253dc96776a7"]]},{"id":"d14eb46bc5bd3afc","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":980,"y":380,"wires":[["9c07253dc96776a7"]]},{"id":"513873295aadec99","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":360,"wires":[["432a318f4b2b79a5"],["d14eb46bc5bd3afc"]]},{"id":"55a3700ac54dde3e","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":360,"wires":[["513873295aadec99"]]},{"id":"b68aa77879b21d7c","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1310,"y":360,"wires":[["302f21b8.48bd2e"],[],[],[]]},{"id":"2b85304acd7ff3b0","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":540,"wires":[["597c7fec97412171"]]},{"id":"d482633a2c194b8b","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":520,"wires":[["2b85304acd7ff3b0"]]},{"id":"bf74163629ac3e20","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":560,"wires":[["2b85304acd7ff3b0"]]},{"id":"b8fddaa4353c2af9","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":540,"wires":[["d482633a2c194b8b"],["bf74163629ac3e20"]]},{"id":"d81d12b6c363aa6f","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":540,"wires":[["b8fddaa4353c2af9"]]},{"id":"597c7fec97412171","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1330,"y":540,"wires":[["cfbe8a46.ea6988"],[],[],[]]},{"id":"10d1f722985ad2b8","type":"server-state-changed","z":"30212bee.794d64","name":"SPA Prawy","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in9"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":540,"wires":[["d81d12b6c363aa6f"]]},{"id":"0d34be58720f462a","type":"server-state-changed","z":"30212bee.794d64","name":"SPA Prawy","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in8"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":120,"y":360,"wires":[["55a3700ac54dde3e"]]},{"id":"10ef4fcb.79e94","type":"api-call-service","z":"30212bee.794d64","name":"Łazienka Plafon","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out0"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1520,"y":1160,"wires":[[]]},{"id":"1ffca80.0eb3158","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":1220,"wires":[["e3c2dea6.6bed2"]]},{"id":"d53ccbc4.9dada8","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":1200,"wires":[["1ffca80.0eb3158"]]},{"id":"4af3a53d.16a9fc","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":1240,"wires":[["1ffca80.0eb3158"]]},{"id":"18362d10.d9e1d3","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":1220,"wires":[["d53ccbc4.9dada8"],["4af3a53d.16a9fc"]]},{"id":"a8d373f4.84d1d","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1220,"wires":[["18362d10.d9e1d3"]]},{"id":"e3c2dea6.6bed2","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1330,"y":1220,"wires":[["10ef4fcb.79e94","2cde911a.203f0e"],["ee1871a9.9274d"],[],["21a9a2d2.aa07ee"]]},{"id":"20e1f7f7.dbe538","type":"server-state-changed","z":"30212bee.794d64","name":"Włącznik Biała łazienka plafon","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in4"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":180,"y":1220,"wires":[["a8d373f4.84d1d"]]},{"id":"ee1871a9.9274d","type":"api-call-service","z":"30212bee.794d64","name":"Ledy pod wanną","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_biala_lazienka_wanna_led"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1520,"y":1220,"wires":[[]]},{"id":"21a9a2d2.aa07ee","type":"api-call-service","z":"30212bee.794d64","name":"Łazinka Wentylator","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub2_out8"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1530,"y":1280,"wires":[[]]},{"id":"2cde911a.203f0e","type":"api-call-service","z":"30212bee.794d64","name":"Łazienka wentylator","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["fan.main_hub_hub2_out8"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1540,"y":1120,"wires":[[]]},{"id":"8a765ac78a9f36a7","type":"function","z":"30212bee.794d64","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":1400,"wires":[["43d93904a31d7355"]]},{"id":"b28789e9b83b64c9","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":1380,"wires":[["8a765ac78a9f36a7"]]},{"id":"3e958a6293f28290","type":"timed-counter","z":"30212bee.794d64","name":"","timelimit":"350","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":1000,"y":1420,"wires":[["8a765ac78a9f36a7"]]},{"id":"6108c2fd9e9043b9","type":"switch","z":"30212bee.794d64","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":1400,"wires":[["b28789e9b83b64c9"],["3e958a6293f28290"]]},{"id":"c3f1aab441950b0e","type":"change","z":"30212bee.794d64","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1400,"wires":[["6108c2fd9e9043b9"]]},{"id":"43d93904a31d7355","type":"switch","z":"30212bee.794d64","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1330,"y":1400,"wires":[["e276385b752e3458"],[],[],[]]},{"id":"7975d4b082b628e6","type":"server-state-changed","z":"30212bee.794d64","name":"Włącznik Biała łazienka skos","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.hub3_in7"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":180,"y":1400,"wires":[["c3f1aab441950b0e"]]},{"id":"e276385b752e3458","type":"api-call-service","z":"30212bee.794d64","name":"Łazienka wentylator","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.main_hub_hub2_out4"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1540,"y":1340,"wires":[[]]},{"id":"8792feeb.c171","type":"tab","label":"Góra","disabled":false,"info":""},{"id":"803f2911.cde838","type":"server-state-changed","z":"8792feeb.c171","name":"Włącznik Góra 1","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.gora_1"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":100,"wires":[["9ead49f7.43ead8"],[]]},{"id":"e4ea2712.2e9868","type":"api-call-service","z":"8792feeb.c171","name":"Schody","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.zwis_schody"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":380,"y":380,"wires":[[]]},{"id":"3a135f18.6564e","type":"server-state-changed","z":"8792feeb.c171","name":"Włĝ�cznik Góra 2","server":"b8019c99.626c3","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.gora_2"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":240,"wires":[["a7660a6d.53a2c8"]]},{"id":"563deac4.030bb4","type":"function","z":"8792feeb.c171","name":"function","func":"var pressTime;\n\nif (msg.count >= 3 && msg.payload.value == '1')\n{\n msg.payload = \"triple\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count >= 2 && msg.payload.value == '1')\n{\n msg.payload = \"double\";\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n}\nif (msg.count == 1){\n if (msg.payload.value == '1') { //Pressed\n pressTime = Date.now(); \n //node.send({payload:{pressTime}});\n context.set('pressTime',pressTime);\n }\n pressTime = context.get('pressTime');\n //node.send({payload:{pressTime}});\n if (msg.payload.value === '0' && pressTime !== null) { //Released\n releaseTime = Date.now(); \n \n var timeDiff = releaseTime-pressTime;\n //node.send({payload:{timeDiff}});\n if (releaseTime-pressTime>350) {msg.payload = \"long\";}\n else {msg.payload = \"single\";}\n context.set('pressTime',null);\n context.set('releaseTime',null);\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":240,"wires":[["e59a571.3a326a8"]]},{"id":"91c313fc.495d4","type":"timed-counter","z":"8792feeb.c171","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":220,"wires":[["563deac4.030bb4"]]},{"id":"80007490.7ddc58","type":"timed-counter","z":"8792feeb.c171","name":"","timelimit":"200","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":720,"y":260,"wires":[["563deac4.030bb4"]]},{"id":"111bb202.a09fae","type":"switch","z":"8792feeb.c171","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":240,"wires":[["91c313fc.495d4"],["80007490.7ddc58"]]},{"id":"a7660a6d.53a2c8","type":"change","z":"8792feeb.c171","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":240,"wires":[["111bb202.a09fae"]]},{"id":"e59a571.3a326a8","type":"switch","z":"8792feeb.c171","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"triple","vt":"str"},{"t":"eq","v":"long","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":240,"wires":[["15dcad7a.b0d143"],[],[],["8e522785.f936b8"]]},{"id":"15dcad7a.b0d143","type":"api-call-service","z":"8792feeb.c171","name":"Skrzynia","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.skrzynia"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1240,"y":200,"wires":[[]]},{"id":"9dc3730c.ef2a1","type":"server-state-changed","z":"8792feeb.c171","name":"Włącznik Góra 3","server":"b8019c99.626c3","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["binary_sensor.gora_3"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"20","forType":"num","forUnits":"milliseconds","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":140,"y":380,"wires":[["e4ea2712.2e9868"],[]]},{"id":"9ead49f7.43ead8","type":"api-call-service","z":"8792feeb.c171","name":"Oczka Taras","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.oczka_taras"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":390,"y":100,"wires":[[]]},{"id":"8e522785.f936b8","type":"api-call-service","z":"8792feeb.c171","name":"Tunel","server":"b8019c99.626c3","version":7,"debugenabled":false,"action":"homeassistant.toggle","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.tunel"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"toggle","x":1230,"y":260,"wires":[[]]},{"id":"b8019c99.626c3","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"e6b1b546.b23368","type":"server","name":"Home Assistant","addon":true}] \ No newline at end of file diff --git a/Mieszkanie Kuby/main-hub.yaml b/Mieszkanie Kuby/main-hub.yaml new file mode 100644 index 0000000..9fd6c24 --- /dev/null +++ b/Mieszkanie Kuby/main-hub.yaml @@ -0,0 +1,97 @@ +esphome: + name: main-hub + friendly_name: main-hub + +esp32: + board: esp32dev + framework: + type: esp-idf + +logger: + +api: + encryption: + key: "eyBNZWDUaBDCTIZsSIUzwHFpUcm/Kbc9UAWjX++ToL4=" + +ota: + - platform: esphome + password: "000f95472f1adc514d45abdc280a3903" + +#wifi: +# ssid: !secret wifi_ssid +# password: !secret wifi_password +# +# ap: +# ssid: "Main-Hub Fallback Hotspot" +# password: "y0LGSOyT5tjJ" + +#captive_portal: + +web_server: + port: 80 + +ethernet: + type: LAN8720 + mdc_pin: GPIO23 + mdio_pin: GPIO18 + clk_mode: GPIO17_OUT + phy_addr: 0 + power_pin: GPIO12 + +button: + - platform: restart + name: "main-hub Restart" + +packages: + i2c: !include packages/i2c.yaml + pca9685: !include packages/pca9685.yaml + mcp23017_outputs: !include packages/mcp23017_outputs.yaml + mcp23017_inputs: !include packages/mcp23017_inputs.yaml + scripts: !include packages/scripts.yaml + +esp32_ble_tracker: + +sensor: + - platform: uptime + type: seconds + name: Uptime Sensor + - platform: atc_mithermometer + mac_address: "A4:C1:38:C5:11:58" + temperature: + name: "Biuro Temperatura" + humidity: + name: "Biuro Nawilżenie" + battery_level: + name: "Biuro Bateria" + - platform: atc_mithermometer + mac_address: "A4:C1:38:5C:4F:38" + temperature: + name: "Serwer Temperatura" + humidity: + name: "Serwer Nawilżenie" + battery_level: + name: "Serwer Bateria" + - platform: atc_mithermometer + mac_address: "A4:C1:38:67:6B:94" + temperature: + name: "Kuchnia Temperatura" + humidity: + name: "Kuchnia Nawilżenie" + battery_level: + name: "Kuchnia Bateria" + - platform: atc_mithermometer + mac_address: "A4:C1:38:C9:FE:CA" + temperature: + name: "WC Temperatura" + humidity: + name: "WC Nawilżenie" + battery_level: + name: "WC Bateria" + - platform: atc_mithermometer + mac_address: "A4:C1:38:63:6D:DB" + temperature: + name: "Łazienka Temperatura" + humidity: + name: "Łazienka Nawilżenie" + battery_level: + name: "Łazienka Bateria" diff --git a/Mieszkanie Kuby/packages/i2c.yaml b/Mieszkanie Kuby/packages/i2c.yaml new file mode 100644 index 0000000..5cd2925 --- /dev/null +++ b/Mieszkanie Kuby/packages/i2c.yaml @@ -0,0 +1,5 @@ +i2c: + sda: 13 + scl: 16 + scan: True + frequency: 200kHz diff --git a/Mieszkanie Kuby/packages/mcp23017_inputs.yaml b/Mieszkanie Kuby/packages/mcp23017_inputs.yaml new file mode 100644 index 0000000..3fcffd5 --- /dev/null +++ b/Mieszkanie Kuby/packages/mcp23017_inputs.yaml @@ -0,0 +1,884 @@ +mcp23017: + - id: "mcp23xxx_hub1_IN" + address: 0x20 + - id: "mcp23xxx_hub2_IN" + address: 0x22 + - id: "mcp23xxx_hub3_IN" + address: 0x24 + + +binary_sensor: + ################## + #mcp23xxx_hub1_IN# + ################## + + # Wejście 1 — single: halogeny wejście, triple: wyłącz lampy, long: wyłącz wentylatory + - platform: gpio + name: "hub1_in0" + id: hub1_in0 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 0 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out15 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: off_all_lights + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_fans + + # Wejście 3 — brak automatyzacji w Node-RED + - platform: gpio + name: "hub1_in1" + id: hub1_in1 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 1 + mode: INPUT + inverted: True + + # Wejście 2 — single: hub1_out14, triple: WLED korytarz kinkiety + - platform: gpio + name: "hub1_in2" + id: hub1_in2 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 2 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out14 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_korytarz_kinkiety_toggle + + # Sypialnia 3 — single: turn_on hub2_out12+hub2_out1, double: toggle hub2_out12+hub2_out1 + - platform: gpio + name: "hub1_in3" + id: hub1_in3 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 3 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.turn_on: hub2_out12 + - light.turn_on: hub2_out1 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out12 + - light.toggle: hub2_out1 + + # Sypialnia 1 — single: sypialnia LED + - platform: gpio + name: "hub1_in4" + id: hub1_in4 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 4 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: sypialnia_led + + # Sypialnia 2 — single: hub2_out7 + - platform: gpio + name: "hub1_in5" + id: hub1_in5 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 5 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out7 + + # Sypialnia Łóżko Prawa Strona — single: hub2_out1, double: hub2_out12+hub2_out1, long: wyłącz wszystkie + - platform: gpio + name: "hub1_in6" + id: hub1_in6 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 6 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out1 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out12 + - light.toggle: hub2_out1 + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_lights + - script.execute: off_all_fans + + # Sypialnia Łóżko Lewa Strona — single: hub2_out12, double: hub2_out12+hub2_out1, long: wyłącz wszystkie + - platform: gpio + name: "hub1_in7" + id: hub1_in7 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 7 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out12 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out12 + - light.toggle: hub2_out1 + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_lights + - script.execute: off_all_fans + + # Niebieski Pokój Lewy — single: hub2_out10, double: hub1_out7 + - platform: gpio + name: "hub1_in8" + id: hub1_in8 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 8 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out10 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out7 + + # Niebieski Pokój Prawy — bezpośredni toggle pokój dla gości LED (bez gestów) + - platform: gpio + name: "hub1_in9" + id: hub1_in9 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 9 + mode: INPUT + inverted: True + on_click: + min_length: 50ms + max_length: 1000ms + then: + - light.toggle: pokoj_dla_gosci_led + + # Nie podpięte + - platform: gpio + name: "hub1_in10" + id: hub1_in10 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 10 + mode: INPUT + inverted: True + - platform: gpio + name: "hub1_in11" + id: hub1_in11 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 11 + mode: INPUT + inverted: True + - platform: gpio + name: "hub1_in12" + id: hub1_in12 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 12 + mode: INPUT + inverted: True + - platform: gpio + name: "hub1_in13" + id: hub1_in13 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 13 + mode: INPUT + inverted: True + - platform: gpio + name: "hub1_in14" + id: hub1_in14 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 14 + mode: INPUT + inverted: True + - platform: gpio + name: "hub1_in15" + id: hub1_in15 + pin: + mcp23xxx: mcp23xxx_hub1_IN + number: 15 + mode: INPUT + inverted: True + + ################## + #mcp23xxx_hub2_IN# + ################## + + # Korytarz 2 — single: hub1_out15 + - platform: gpio + name: "hub2_in0" + id: hub2_in0 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 0 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out15 + + # Korytarz 3 — single: WLED korytarz kinkiety, long: wyłącz wszystkie + - platform: gpio + name: "hub2_in1" + id: hub2_in1 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 1 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_korytarz_kinkiety_toggle + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_lights + - script.execute: off_all_fans + + # Korytarz 1 — single: hub1_out14, long: wyłącz wszystkie + - platform: gpio + name: "hub2_in2" + id: hub2_in2 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 2 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out14 + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_lights + - script.execute: off_all_fans + + # Mały Korytarz — brak automatyzacji w Node-RED + - platform: gpio + name: "hub2_in3" + id: hub2_in3 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 3 + mode: INPUT + inverted: True + + # Garderoba Mała — single: hub2_out14, double: hub3_out2 (wentylator) + - platform: gpio + name: "hub2_in4" + id: hub2_in4 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 4 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out14 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub3_out2 + + # Kuchnia 3_1 — single: hub1_out8 + - platform: gpio + name: "hub2_in5" + id: hub2_in5 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 5 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out8 + + # Kuchnia 3_2 — single: jadalnia LED + - platform: gpio + name: "hub2_in6" + id: hub2_in6 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 6 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: jadalnia_led + + # Kuchnia 2_1 — single: hub1_out3, triple: wyłącz lampy, long: wyłącz wentylatory + - platform: gpio + name: "hub2_in7" + id: hub2_in7 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 7 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out3 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: off_all_lights + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_fans + + # Kuchnia 2_2 — single: kuchnia łezka LED + - platform: gpio + name: "hub2_in8" + id: hub2_in8 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 8 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: kuchnia_lezka_led + + # Kuchnia 1_1 — single: hub2_out11, double: WLED salon wentylator + - platform: gpio + name: "hub2_in9" + id: hub2_in9 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 9 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out11 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_salon_wentylator_toggle + + # Kuchnia 1_2 — single: WLED komin+salon kinkiety toggle, double: WLED komin on, long: WLED komin on + - platform: gpio + name: "hub2_in10" + id: hub2_in10 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 10 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_komin_toggle + - script.execute: wled_salon_kinkiety_toggle + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_komin_on + - timing: + - ON for at least 350ms + then: + - script.execute: wled_komin_on + + # Schody 3 — single: WLED oczka taras + skrzynia + tunel + zwis schody toggle + - platform: gpio + name: "hub2_in11" + id: hub2_in11 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 11 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_schody_all_toggle + + # Schody 1 — single: hub2_out11 + - platform: gpio + name: "hub2_in12" + id: hub2_in12 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 12 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out11 + + # Schody 2 — single: WLED salon kinkiety toggle, double: WLED salon kinkiety off, long: WLED komin toggle + - platform: gpio + name: "hub2_in13" + id: hub2_in13 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 13 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_salon_kinkiety_toggle + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: wled_salon_kinkiety_off + - timing: + - ON for at least 350ms + then: + - script.execute: wled_komin_toggle + + # Nie podpięte + - platform: gpio + name: "hub2_in14" + id: hub2_in14 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 14 + mode: INPUT + inverted: True + - platform: gpio + name: "hub2_in15" + id: hub2_in15 + pin: + mcp23xxx: mcp23xxx_hub2_IN + number: 15 + mode: INPUT + inverted: True + + ################## + #mcp23xxx_hub3_IN# + ################## + + # Garderoba Duża Lewy — single: hub1_out7 + - platform: gpio + name: "hub3_in0" + id: hub3_in0 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 0 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out7 + + # Garderoba Duża Prawy — single: hub1_out7 + - platform: gpio + name: "hub3_in1" + id: hub3_in1 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 1 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out7 + + # SPA Lewy — single: hub2_out13, triple: hub1_out4 (wentylator) + - platform: gpio + name: "hub3_in2" + id: hub3_in2 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 2 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out13 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out4 + + # SPA Prawy — single: hub1_out4+hub1_out10, triple: SPA Ledy + - platform: gpio + name: "hub3_in3" + id: hub3_in3 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 3 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out4 + - light.toggle: hub1_out10 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: spa_ledy + + # Biała Łazienka Ściana — single: hub2_out0, double: biała łazienka wanna LED, long: hub2_out8 (wentylator) + - platform: gpio + name: "hub3_in4" + id: hub3_in4 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 4 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out0 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: biala_lazienka_wanna_led + - timing: + - ON for at least 350ms + then: + - light.toggle: hub2_out8 + + # Małe WC Lustro Prawy — bezpośredni toggle hub2_out2 + WLED wc_led + hub2_out5 (wentylator) + - platform: gpio + name: "hub3_in5" + id: hub3_in5 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 5 + mode: INPUT + inverted: True + on_click: + min_length: 50ms + max_length: 1000ms + then: + - light.toggle: hub2_out2 + - light.toggle: hub2_out5 + - script.execute: wled_wc_led_toggle + + # Małe WC Lustro Lewy — bezpośredni toggle hub1_out9 + - platform: gpio + name: "hub3_in6" + id: hub3_in6 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 6 + mode: INPUT + inverted: True + on_click: + min_length: 50ms + max_length: 1000ms + then: + - light.toggle: hub1_out9 + + # Biała Łazienka Skos — single: hub2_out4 + - platform: gpio + name: "hub3_in7" + id: hub3_in7 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 7 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub2_out4 + + # SPA Lustro Lewy — single: hub1_out5 + - platform: gpio + name: "hub3_in8" + id: hub3_in8 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 8 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out5 + + # SPA Lustro Prawy — single: hub1_out1 + - platform: gpio + name: "hub3_in9" + id: hub3_in9 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 9 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out1 + + # Biuro Skos — single: hub1_out2, double: serwer LED wyłącz + - platform: gpio + name: "hub3_in10" + id: hub3_in10 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 10 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out2 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.turn_off: serwer_led + + # Serwer Prawy — single: serwer LED, double: hub1_out2, triple: hub3_out2 (wentylator) + - platform: gpio + name: "hub3_in11" + id: hub3_in11 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 11 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: serwer_led + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out2 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub3_out2 + + # Serwer Lewy — single: hub1_out14, triple: wyłącz lampy, long: wyłącz wentylatory + - platform: gpio + name: "hub3_in12" + id: hub3_in12 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 12 + mode: INPUT + inverted: True + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: hub1_out14 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - script.execute: off_all_lights + - timing: + - ON for at least 350ms + then: + - script.execute: off_all_fans + + # Nie podpięte + - platform: gpio + name: "hub3_in13" + id: hub3_in13 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 13 + mode: INPUT + inverted: True + - platform: gpio + name: "hub3_in14" + id: hub3_in14 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 14 + mode: INPUT + inverted: True + - platform: gpio + name: "hub3_in15" + id: hub3_in15 + pin: + mcp23xxx: mcp23xxx_hub3_IN + number: 15 + mode: INPUT + inverted: True diff --git a/Mieszkanie Kuby/packages/mcp23017_outputs.yaml b/Mieszkanie Kuby/packages/mcp23017_outputs.yaml new file mode 100644 index 0000000..30d9f8a --- /dev/null +++ b/Mieszkanie Kuby/packages/mcp23017_outputs.yaml @@ -0,0 +1,407 @@ +mcp23017: + - id: "mcp23xxx_hub1_OUT" + address: 0x21 + - id: "mcp23xxx_hub2_OUT" + address: 0x23 + - id: "mcp23xxx_hub3_OUT" + address: 0x25 + + +output: + # MCP23017 GPIO outputs — hub1 + - platform: gpio + id: hub1_out0_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 0, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out1_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 1, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out2_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 2, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out3_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 3, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out4_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 4, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out5_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 5, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out6_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 6, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out7_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 7, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out8_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 8, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out9_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 9, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out10_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 10, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out11_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 11, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out12_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 12, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out13_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 13, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out14_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 14, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub1_out15_gpio + pin: {mcp23xxx: mcp23xxx_hub1_OUT, number: 15, mode: OUTPUT, inverted: False} + + # MCP23017 GPIO outputs — hub2 + - platform: gpio + id: hub2_out0_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 0, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out1_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 1, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out2_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 2, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out3_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 3, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out4_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 4, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out5_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 5, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out6_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 6, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out7_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 7, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out8_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 8, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out9_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 9, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out10_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 10, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out11_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 11, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out12_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 12, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out13_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 13, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out14_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 14, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub2_out15_gpio + pin: {mcp23xxx: mcp23xxx_hub2_OUT, number: 15, mode: OUTPUT, inverted: False} + + # MCP23017 GPIO outputs — hub3 + - platform: gpio + id: hub3_out0_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 0, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out1_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 1, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out2_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 2, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out3_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 3, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out4_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 4, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out5_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 5, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out6_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 6, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out7_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 7, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out8_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 8, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out9_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 9, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out10_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 10, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out11_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 11, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out12_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 12, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out13_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 13, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out14_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 14, mode: OUTPUT, inverted: False} + - platform: gpio + id: hub3_out15_gpio + pin: {mcp23xxx: mcp23xxx_hub3_OUT, number: 15, mode: OUTPUT, inverted: False} + + +light: + # hub1 outputs + - platform: binary + name: "hub1_out0" + id: hub1_out0 + output: hub1_out0_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out1" + id: hub1_out1 + output: hub1_out1_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out2" + id: hub1_out2 + output: hub1_out2_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out3" + id: hub1_out3 + output: hub1_out3_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out4" # Fan: SPA/Łazienka + id: hub1_out4 + output: hub1_out4_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out5" + id: hub1_out5 + output: hub1_out5_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out6" + id: hub1_out6 + output: hub1_out6_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out7" + id: hub1_out7 + output: hub1_out7_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out8" + id: hub1_out8 + output: hub1_out8_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out9" + id: hub1_out9 + output: hub1_out9_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out10" + id: hub1_out10 + output: hub1_out10_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out11" + id: hub1_out11 + output: hub1_out11_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out12" + id: hub1_out12 + output: hub1_out12_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out13" + id: hub1_out13 + output: hub1_out13_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out14" + id: hub1_out14 + output: hub1_out14_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub1_out15" + id: hub1_out15 + output: hub1_out15_gpio + restore_mode: ALWAYS_OFF + + # hub2 outputs + - platform: binary + name: "hub2_out0" + id: hub2_out0 + output: hub2_out0_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out1" + id: hub2_out1 + output: hub2_out1_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out2" + id: hub2_out2 + output: hub2_out2_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out3" + id: hub2_out3 + output: hub2_out3_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out4" + id: hub2_out4 + output: hub2_out4_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out5" # Fan: Małe WC + id: hub2_out5 + output: hub2_out5_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out6" + id: hub2_out6 + output: hub2_out6_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out7" + id: hub2_out7 + output: hub2_out7_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out8" # Fan: Biała Łazienka + id: hub2_out8 + output: hub2_out8_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out9" + id: hub2_out9 + output: hub2_out9_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out10" + id: hub2_out10 + output: hub2_out10_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out11" + id: hub2_out11 + output: hub2_out11_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out12" + id: hub2_out12 + output: hub2_out12_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out13" + id: hub2_out13 + output: hub2_out13_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out14" + id: hub2_out14 + output: hub2_out14_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub2_out15" + id: hub2_out15 + output: hub2_out15_gpio + restore_mode: ALWAYS_OFF + + # hub3 outputs + - platform: binary + name: "hub3_out0" + id: hub3_out0 + output: hub3_out0_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out1" + id: hub3_out1 + output: hub3_out1_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out2" # Fan: Biuro/Serwer + id: hub3_out2 + output: hub3_out2_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out3" + id: hub3_out3 + output: hub3_out3_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out4" + id: hub3_out4 + output: hub3_out4_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out5" + id: hub3_out5 + output: hub3_out5_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out6" + id: hub3_out6 + output: hub3_out6_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out7" + id: hub3_out7 + output: hub3_out7_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out8" + id: hub3_out8 + output: hub3_out8_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out9" + id: hub3_out9 + output: hub3_out9_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out10" + id: hub3_out10 + output: hub3_out10_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out11" + id: hub3_out11 + output: hub3_out11_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out12" + id: hub3_out12 + output: hub3_out12_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out13" + id: hub3_out13 + output: hub3_out13_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out14" + id: hub3_out14 + output: hub3_out14_gpio + restore_mode: ALWAYS_OFF + - platform: binary + name: "hub3_out15" + id: hub3_out15 + output: hub3_out15_gpio + restore_mode: ALWAYS_OFF diff --git a/Mieszkanie Kuby/packages/pca9685.yaml b/Mieszkanie Kuby/packages/pca9685.yaml new file mode 100644 index 0000000..8c0161a --- /dev/null +++ b/Mieszkanie Kuby/packages/pca9685.yaml @@ -0,0 +1,221 @@ +pca9685: + - frequency: 1500 + address: 0x40 + id: "pca9685_hub1" + - frequency: 1500 + address: 0x41 + id: "pca9685_hub2" + + +output: + # Status RGB LED (ledc) + - platform: ledc + id: output_blue + pin: 5 + - platform: ledc + id: output_green + pin: 14 + - platform: ledc + id: output_red + pin: 15 + + # PCA9685 Hub1 — kanały PWM + - platform: pca9685 + id: 'PWM1_1_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 0 + max_power: 75% + - platform: pca9685 + id: 'PWM1_2_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 1 + max_power: 75% + - platform: pca9685 + id: 'PWM2_1_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 2 + max_power: 75% + - platform: pca9685 + id: 'PWM2_2_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 3 + max_power: 75% + - platform: pca9685 + id: 'PWM3_1_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 4 + max_power: 75% + - platform: pca9685 + id: 'PWM3_2_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 8 + max_power: 75% + - platform: pca9685 + id: 'PWM4_1_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 6 + min_power: 0% + max_power: 75% + - platform: pca9685 + id: 'PWM4_2_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 7 + min_power: 0% + max_power: 75% + - platform: pca9685 + id: 'PWM5_1_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 12 + max_power: 75% + - platform: pca9685 + id: 'PWM5_2_Hub1' + pca9685_id: 'pca9685_hub1' + channel: 13 + max_power: 75% + + # PCA9685 Hub2 — kanały PWM + - platform: pca9685 + id: 'PWM1_1_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 0 + max_power: 75% + - platform: pca9685 + id: 'PWM1_2_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 1 + max_power: 75% + - platform: pca9685 + id: 'PWM2_1_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 2 + max_power: 75% + - platform: pca9685 + id: 'PWM2_2_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 3 + max_power: 75% + - platform: pca9685 + id: 'PWM3_1_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 4 + max_power: 75% + - platform: pca9685 + id: 'PWM3_2_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 5 + max_power: 95% + - platform: pca9685 + id: 'PWM4_1_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 10 + max_power: 95% + - platform: pca9685 + id: 'PWM4_2_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 13 + max_power: 75% + - platform: pca9685 + id: 'PWM5_1_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 11 + max_power: 75% + - platform: pca9685 + id: 'PWM5_2_Hub2' + pca9685_id: 'pca9685_hub2' + channel: 15 + max_power: 75% + + +light: + - platform: rgb + name: "Status LED" + red: output_red + green: output_green + blue: output_blue + effects: + - pulse: + name: "Fast Pulse" + transition_length: 0.5s + update_interval: 0.5s + - pulse: + name: "Slow Pulse" + transition_length: 1s + update_interval: 1s + - random: + name: "Random Effect" + transition_length: 1s + update_interval: 2s + + - platform: cwww + name: "Serwer LED" + id: serwer_led + cold_white: PWM2_1_Hub1 + warm_white: PWM2_2_Hub1 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + default_transition_length: 2.0s + + - platform: cwww + name: "Jadalnia LED" + id: jadalnia_led + cold_white: PWM4_2_Hub1 + warm_white: PWM4_1_Hub1 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + default_transition_length: 2.0s + + - platform: cwww + name: "Biała Łazienka wanna LED" + id: biala_lazienka_wanna_led + cold_white: PWM5_2_Hub1 + warm_white: PWM5_1_Hub1 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + default_transition_length: 2.0s + + - platform: monochromatic + name: "Kuchnia Łezka LED" + id: kuchnia_lezka_led + output: PWM2_1_Hub2 + default_transition_length: 2.0s + + - platform: cwww + name: "SPA Ledy" + id: spa_ledy + cold_white: PWM5_2_Hub2 + warm_white: PWM5_1_Hub2 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + default_transition_length: 2.0s + + - platform: cwww + name: "Pokój dla gości LED" + id: pokoj_dla_gosci_led + cold_white: PWM3_2_Hub2 + warm_white: PWM4_1_Hub2 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + default_transition_length: 2.0s + + - platform: monochromatic + name: "TEST LED 1" + id: test_led_1 + output: PWM1_2_Hub2 + + - platform: monochromatic + name: "TEST LED 2" + id: test_led_2 + output: PWM3_1_Hub2 + + - platform: rgbww + name: "Sypialnia LED" + id: sypialnia_led + red: PWM1_1_Hub1 + green: PWM1_2_Hub1 + blue: PWM3_1_Hub1 + cold_white: PWM3_2_Hub1 + warm_white: PWM1_1_Hub2 + cold_white_color_temperature: 6536 K + warm_white_color_temperature: 2000 K + color_interlock: false + default_transition_length: 2.0s diff --git a/Mieszkanie Kuby/packages/scripts.yaml b/Mieszkanie Kuby/packages/scripts.yaml new file mode 100644 index 0000000..9e62e23 --- /dev/null +++ b/Mieszkanie Kuby/packages/scripts.yaml @@ -0,0 +1,114 @@ +script: + # ── Wyłącz wszystkie lampy ─────────────────────────────────────────────── + - id: off_all_lights + then: + - light.turn_off: serwer_led + - light.turn_off: jadalnia_led + - light.turn_off: biala_lazienka_wanna_led + - light.turn_off: kuchnia_lezka_led + - light.turn_off: spa_ledy + - light.turn_off: pokoj_dla_gosci_led + - light.turn_off: test_led_1 + - light.turn_off: test_led_2 + - light.turn_off: sypialnia_led + - light.turn_off: hub1_out0 + - light.turn_off: hub1_out1 + - light.turn_off: hub1_out2 + - light.turn_off: hub1_out3 + - light.turn_off: hub1_out5 + - light.turn_off: hub1_out6 + - light.turn_off: hub1_out7 + - light.turn_off: hub1_out8 + - light.turn_off: hub1_out9 + - light.turn_off: hub1_out10 + - light.turn_off: hub1_out11 + - light.turn_off: hub1_out12 + - light.turn_off: hub1_out13 + - light.turn_off: hub1_out14 + - light.turn_off: hub1_out15 + - light.turn_off: hub2_out0 + - light.turn_off: hub2_out1 + - light.turn_off: hub2_out2 + - light.turn_off: hub2_out3 + - light.turn_off: hub2_out4 + - light.turn_off: hub2_out6 + - light.turn_off: hub2_out7 + - light.turn_off: hub2_out9 + - light.turn_off: hub2_out10 + - light.turn_off: hub2_out11 + - light.turn_off: hub2_out12 + - light.turn_off: hub2_out13 + - light.turn_off: hub2_out14 + - light.turn_off: hub2_out15 + - light.turn_off: hub3_out0 + - light.turn_off: hub3_out1 + - light.turn_off: hub3_out3 + - light.turn_off: hub3_out4 + - light.turn_off: hub3_out5 + - light.turn_off: hub3_out6 + - light.turn_off: hub3_out7 + - light.turn_off: hub3_out8 + - light.turn_off: hub3_out9 + - light.turn_off: hub3_out10 + - light.turn_off: hub3_out11 + - light.turn_off: hub3_out12 + - light.turn_off: hub3_out13 + - light.turn_off: hub3_out14 + - light.turn_off: hub3_out15 + + # ── Wyłącz wszystkie wentylatory ───────────────────────────────────────── + - id: off_all_fans + then: + - light.turn_off: hub3_out2 # Fan: Biuro/Serwer + - light.turn_off: hub1_out4 # Fan: SPA/Łazienka + - light.turn_off: hub2_out5 # Fan: Małe WC + - light.turn_off: hub2_out8 # Fan: Biała Łazienka + + # ── WLED placeholders (TODO: zastąpić sterowaniem WLED przez HA/MQTT) ─── + - id: wled_korytarz_kinkiety_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: korytarz_kinkiety toggle" + + - id: wled_komin_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: komin_led toggle" + + - id: wled_komin_on + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: komin_led turn_on" + + - id: wled_salon_kinkiety_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: salon_kinkiety_led toggle" + + - id: wled_salon_kinkiety_off + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: salon_kinkiety_led turn_off" + + - id: wled_schody_all_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: oczka_taras + skrzynia + tunel + zwis_schody toggle" + + - id: wled_wc_led_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: wc_led toggle" + + - id: wled_salon_wentylator_toggle + then: + - logger.log: + level: INFO + format: "WLED PLACEHOLDER: salon_wentylator toggle" diff --git a/boneio-32x10_switches_v0_7_standalone.yaml b/boneio-32x10_switches_v0_7_standalone.yaml index a1ad322..11e00f2 100644 --- a/boneio-32x10_switches_v0_7_standalone.yaml +++ b/boneio-32x10_switches_v0_7_standalone.yaml @@ -3,6 +3,8 @@ substitutions: friendly_name: 'BoneIO ESP 32x10 Switches' serial_prefix: 'esp' #Don't change it. +# dodać https://github.com/ethanak/SimplePgSQL i zaczytywac dane z postgressa a nie z Home Assistanta co do karty, pinu i meldunek + esphome: name: '${name}' friendly_name: '${friendly_name}' diff --git a/panel-dostepu/.env.example b/panel-dostepu/.env.example new file mode 100644 index 0000000..48c360b --- /dev/null +++ b/panel-dostepu/.env.example @@ -0,0 +1,3 @@ +# Skopiuj do .env i uzupełnij +VITE_HA_URL=http://10.20.10.106:8123 +VITE_APARTMENTS=7 diff --git a/panel-dostepu/ha_helpers.yaml b/panel-dostepu/ha_helpers.yaml new file mode 100644 index 0000000..8d3b4c8 --- /dev/null +++ b/panel-dostepu/ha_helpers.yaml @@ -0,0 +1,224 @@ +# ============================================================ +# Home Assistant — helpery dla Panelu Dostępu +# ============================================================ +# Wklej do configuration.yaml lub do osobnych plików przez split config. +# Po dodaniu: Ustawienia → Serwer → Uruchom ponownie HA. +# ============================================================ + +input_number: + apartament_1: + name: "Apartament 1 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_2: + name: "Apartament 2 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_3: + name: "Apartament 3 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_4: + name: "Apartament 4 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_5: + name: "Apartament 5 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_6: + name: "Apartament 6 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + + apartament_7: + name: "Apartament 7 — PIN" + min: 0 + max: 99999999 + step: 1 + mode: box + icon: mdi:lock + +# ============================================================ + +input_text: + apartament_karta_1: + name: "Apartament 1 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_2: + name: "Apartament 2 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_3: + name: "Apartament 3 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_4: + name: "Apartament 4 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_5: + name: "Apartament 5 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_6: + name: "Apartament 6 — Karta" + max: 20 + icon: mdi:card-account-details + + apartament_karta_7: + name: "Apartament 7 — Karta" + max: 20 + icon: mdi:card-account-details + +# ============================================================ + +input_datetime: + apartament_1_zameldowanie: + name: "Apartament 1 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_1_wymeldowanie: + name: "Apartament 1 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_2_zameldowanie: + name: "Apartament 2 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_2_wymeldowanie: + name: "Apartament 2 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_3_zameldowanie: + name: "Apartament 3 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_3_wymeldowanie: + name: "Apartament 3 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_4_zameldowanie: + name: "Apartament 4 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_4_wymeldowanie: + name: "Apartament 4 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_5_zameldowanie: + name: "Apartament 5 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_5_wymeldowanie: + name: "Apartament 5 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_6_zameldowanie: + name: "Apartament 6 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_6_wymeldowanie: + name: "Apartament 6 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + + apartament_7_zameldowanie: + name: "Apartament 7 — Zameldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-right + + apartament_7_wymeldowanie: + name: "Apartament 7 — Wymeldowanie" + has_date: true + has_time: true + icon: mdi:calendar-arrow-left + +# ============================================================ +# input_boolean — flaga "nowy gość" dla automatyzacji świateł +# on = gość jeszcze nie wszedł → automatyzacja odpali się przy pierwszym wejściu +# off = gość już wszedł → automatyzacja nie odpali się ponownie +# Reset przez panel przy meldowaniu nowego gościa. +# ============================================================ + +input_boolean: + apartament_1_nowy_gosc: + name: "Apartament 1 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_2_nowy_gosc: + name: "Apartament 2 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_3_nowy_gosc: + name: "Apartament 3 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_4_nowy_gosc: + name: "Apartament 4 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_5_nowy_gosc: + name: "Apartament 5 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_6_nowy_gosc: + name: "Apartament 6 — Nowy gość" + icon: mdi:account-arrow-right + + apartament_7_nowy_gosc: + name: "Apartament 7 — Nowy gość" + icon: mdi:account-arrow-right diff --git a/panel-dostepu/index.html b/panel-dostepu/index.html new file mode 100644 index 0000000..26c8e9c --- /dev/null +++ b/panel-dostepu/index.html @@ -0,0 +1,18 @@ + + + + + + Panel Dostępu + + + + + +
+ + + diff --git a/panel-dostepu/package-lock.json b/panel-dostepu/package-lock.json new file mode 100644 index 0000000..735349e --- /dev/null +++ b/panel-dostepu/package-lock.json @@ -0,0 +1,1246 @@ +{ + "name": "panel-dostepu", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "panel-dostepu", + "version": "1.0.0", + "dependencies": { + "vue": "^3.4.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.0.0", + "vite": "^5.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", + "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", + "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", + "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", + "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", + "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", + "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", + "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", + "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", + "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", + "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", + "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", + "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", + "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", + "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", + "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", + "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", + "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", + "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", + "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", + "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", + "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", + "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", + "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", + "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", + "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", + "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.32.tgz", + "integrity": "sha512-4x74Tbtqnda8s/NSD6e1Dr5p1c8HdMU5RWSjMSUzb8RTcUQqevDCxVAitcLBKT+ie3o0Dl9crc/S/opJM7qBGQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.2", + "@vue/shared": "3.5.32", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.32.tgz", + "integrity": "sha512-ybHAu70NtiEI1fvAUz3oXZqkUYEe5J98GjMDpTGl5iHb0T15wQYLR4wE3h9xfuTNA+Cm2f4czfe8B4s+CCH57Q==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.32", + "@vue/shared": "3.5.32" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.32.tgz", + "integrity": "sha512-8UYUYo71cP/0YHMO814TRZlPuUUw3oifHuMR7Wp9SNoRSrxRQnhMLNlCeaODNn6kNTJsjFoQ/kqIj4qGvya4Xg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.2", + "@vue/compiler-core": "3.5.32", + "@vue/compiler-dom": "3.5.32", + "@vue/compiler-ssr": "3.5.32", + "@vue/shared": "3.5.32", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.8", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.32.tgz", + "integrity": "sha512-Gp4gTs22T3DgRotZ8aA/6m2jMR+GMztvBXUBEUOYOcST+giyGWJ4WvFd7QLHBkzTxkfOt8IELKNdpzITLbA2rw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.32", + "@vue/shared": "3.5.32" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.32.tgz", + "integrity": "sha512-/ORasxSGvZ6MN5gc+uE364SxFdJ0+WqVG0CENXaGW58TOCdrAW76WWaplDtECeS1qphvtBZtR+3/o1g1zL4xPQ==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.32" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.32.tgz", + "integrity": "sha512-pDrXCejn4UpFDFmMd27AcJEbHaLemaE5o4pbb7sLk79SRIhc6/t34BQA7SGNgYtbMnvbF/HHOftYBgFJtUoJUQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.32", + "@vue/shared": "3.5.32" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.32.tgz", + "integrity": "sha512-1CDVv7tv/IV13V8Nip1k/aaObVbWqRlVCVezTwx3K07p7Vxossp5JU1dcPNhJk3w347gonIUT9jQOGutyJrSVQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.32", + "@vue/runtime-core": "3.5.32", + "@vue/shared": "3.5.32", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.32.tgz", + "integrity": "sha512-IOjm2+JQwRFS7W28HNuJeXQle9KdZbODFY7hFGVtnnghF51ta20EWAZJHX+zLGtsHhaU6uC9BGPV52KVpYryMQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.32", + "@vue/shared": "3.5.32" + }, + "peerDependencies": { + "vue": "3.5.32" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.32.tgz", + "integrity": "sha512-ksNyrmRQzWJJ8n3cRDuSF7zNNontuJg1YHnmWRJd2AMu8Ij2bqwiiri2lH5rHtYPZjj4STkNcgcmiQqlOjiYGg==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.9.tgz", + "integrity": "sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", + "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.1", + "@rollup/rollup-android-arm64": "4.60.1", + "@rollup/rollup-darwin-arm64": "4.60.1", + "@rollup/rollup-darwin-x64": "4.60.1", + "@rollup/rollup-freebsd-arm64": "4.60.1", + "@rollup/rollup-freebsd-x64": "4.60.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", + "@rollup/rollup-linux-arm-musleabihf": "4.60.1", + "@rollup/rollup-linux-arm64-gnu": "4.60.1", + "@rollup/rollup-linux-arm64-musl": "4.60.1", + "@rollup/rollup-linux-loong64-gnu": "4.60.1", + "@rollup/rollup-linux-loong64-musl": "4.60.1", + "@rollup/rollup-linux-ppc64-gnu": "4.60.1", + "@rollup/rollup-linux-ppc64-musl": "4.60.1", + "@rollup/rollup-linux-riscv64-gnu": "4.60.1", + "@rollup/rollup-linux-riscv64-musl": "4.60.1", + "@rollup/rollup-linux-s390x-gnu": "4.60.1", + "@rollup/rollup-linux-x64-gnu": "4.60.1", + "@rollup/rollup-linux-x64-musl": "4.60.1", + "@rollup/rollup-openbsd-x64": "4.60.1", + "@rollup/rollup-openharmony-arm64": "4.60.1", + "@rollup/rollup-win32-arm64-msvc": "4.60.1", + "@rollup/rollup-win32-ia32-msvc": "4.60.1", + "@rollup/rollup-win32-x64-gnu": "4.60.1", + "@rollup/rollup-win32-x64-msvc": "4.60.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.32.tgz", + "integrity": "sha512-vM4z4Q9tTafVfMAK7IVzmxg34rSzTFMyIe0UUEijUCkn9+23lj0WRfA83dg7eQZIUlgOSGrkViIaCfqSAUXsMw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.32", + "@vue/compiler-sfc": "3.5.32", + "@vue/runtime-dom": "3.5.32", + "@vue/server-renderer": "3.5.32", + "@vue/shared": "3.5.32" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + } + } +} diff --git a/panel-dostepu/package.json b/panel-dostepu/package.json new file mode 100644 index 0000000..8372bcf --- /dev/null +++ b/panel-dostepu/package.json @@ -0,0 +1,18 @@ +{ + "name": "panel-dostepu", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "start": "npm run build && npm run preview" + }, + "dependencies": { + "vue": "^3.4.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.0.0", + "vite": "^5.0.0" + } +} diff --git a/panel-dostepu/src/App.vue b/panel-dostepu/src/App.vue new file mode 100644 index 0000000..433c216 --- /dev/null +++ b/panel-dostepu/src/App.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/panel-dostepu/src/main.js b/panel-dostepu/src/main.js new file mode 100644 index 0000000..fe5bae3 --- /dev/null +++ b/panel-dostepu/src/main.js @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './style.css' + +createApp(App).mount('#app') diff --git a/panel-dostepu/src/services/auth.js b/panel-dostepu/src/services/auth.js new file mode 100644 index 0000000..21aa1b7 --- /dev/null +++ b/panel-dostepu/src/services/auth.js @@ -0,0 +1,46 @@ +const STORAGE_KEY = 'ha_token' +const SESSION_KEY = 'panel_authed' +const PRESET_TOKEN = import.meta.env.VITE_HA_TOKEN || '' +const VALID_LOGIN = import.meta.env.VITE_LOGIN || '' +const VALID_PASS = import.meta.env.VITE_PASSWORD || '' + +export function loadToken() { + if (PRESET_TOKEN) return PRESET_TOKEN + return localStorage.getItem(STORAGE_KEY) || '' +} + +export function saveToken(token) { + localStorage.setItem(STORAGE_KEY, token) +} + +export function clearToken() { + localStorage.removeItem(STORAGE_KEY) +} + +/** Sprawdza czy użytkownik jest zalogowany do panelu */ +export function isAuthed() { + return sessionStorage.getItem(SESSION_KEY) === '1' +} + +/** + * Loguje do panelu (login/hasło z .env). + * Zwraca true jeśli OK, false jeśli błędne dane. + */ +export function panelLogin(username, password) { + if (username === VALID_LOGIN && password === VALID_PASS) { + sessionStorage.setItem(SESSION_KEY, '1') + return true + } + return false +} + +export function panelLogout() { + sessionStorage.removeItem(SESSION_KEY) +} + +export async function validateToken(token) { + const res = await fetch('/api/', { + headers: { 'Authorization': `Bearer ${token}` }, + }) + return res.ok +} diff --git a/panel-dostepu/src/services/ha.js b/panel-dostepu/src/services/ha.js new file mode 100644 index 0000000..9f03c55 --- /dev/null +++ b/panel-dostepu/src/services/ha.js @@ -0,0 +1,128 @@ +async function callService(token, domain, service, data) { + const res = await fetch(`/api/services/${domain}/${service}`, { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(data), + }) + if (!res.ok) { + const text = await res.text().catch(() => '') + throw new Error(`HTTP ${res.status}${text ? ': ' + text : ''}`) + } +} + +export async function setPin(token, nr, pin) { + const value = Number(pin) + if (isNaN(value)) throw new Error('PIN musi być liczbą') + await callService(token, 'input_number', 'set_value', { + entity_id: `input_number.apartament_${nr}`, + value, + }) +} + +export async function setCard(token, nr, cardId) { + if (!cardId.trim()) throw new Error('Numer karty nie może być pusty') + await callService(token, 'input_text', 'set_value', { + entity_id: `input_text.apartament_karta_${nr}`, + value: cardId.trim(), + }) +} + +export async function setCheckin(token, nr, datetimeLocal) { + await callService(token, 'input_datetime', 'set_datetime', { + entity_id: `input_datetime.apartament_${nr}_zameldowanie`, + datetime: datetimeLocal.replace('T', ' ') + ':00', + }) +} + +export async function setCheckout(token, nr, datetimeLocal) { + await callService(token, 'input_datetime', 'set_datetime', { + entity_id: `input_datetime.apartament_${nr}_wymeldowanie`, + datetime: datetimeLocal.replace('T', ' ') + ':00', + }) +} + +async function getEntityData(token, entityId) { + const res = await fetch(`/api/states/${entityId}`, { + headers: { 'Authorization': `Bearer ${token}` }, + }) + if (!res.ok) throw new Error(`Nie można odczytać ${entityId} (HTTP ${res.status})`) + return await res.json() +} + +async function getState(token, entityId) { + return (await getEntityData(token, entityId)).state +} + +/** + * Ustawia flagę "nowy gość" (input_boolean.apartament_X_nowy_gosc). + * turn_on = nowy gość (automatyzacja aktywna) + * turn_off = reset (po pierwszym wejściu HA samo wywoła turn_off) + */ +export async function setNewGuest(token, nr, value = true) { + const service = value ? 'turn_on' : 'turn_off' + await callService(token, 'input_boolean', service, { + entity_id: `input_boolean.apartament_${nr}_nowy_gosc`, + }) +} + +/** + * Zwraca datę ostatniej zmiany wartości encji (last_changed). + * @returns {Date|null} + */ +export async function getLastChanged(token, entityId) { + try { + const data = await getEntityData(token, entityId) + return data.last_changed ? new Date(data.last_changed) : null + } catch { + return null + } +} + +export async function verifyAll(token, nr, { checkin, checkout, pin, card }) { + const errors = [] + const normalize = dt => dt.replace('T', ' ') + ':00' + + const checks = [] + + if (checkin !== null) { + checks.push( + getState(token, `input_datetime.apartament_${nr}_zameldowanie`).then(s => { + if (s !== normalize(checkin)) + errors.push(`Zameldowanie: HA ma "${s}", oczekiwano "${normalize(checkin)}"`) + }) + ) + } + + if (checkout !== null) { + checks.push( + getState(token, `input_datetime.apartament_${nr}_wymeldowanie`).then(s => { + if (s !== normalize(checkout)) + errors.push(`Wymeldowanie: HA ma "${s}", oczekiwano "${normalize(checkout)}"`) + }) + ) + } + + if (pin !== null) { + checks.push( + getState(token, `input_number.apartament_${nr}`).then(s => { + if (Number(s) !== Number(pin)) + errors.push(`PIN: HA ma "${s}", oczekiwano "${pin}"`) + }) + ) + } + + if (card !== null) { + checks.push( + getState(token, `input_text.apartament_karta_${nr}`).then(s => { + if (s !== card.trim()) + errors.push(`Karta: HA ma "${s}", oczekiwano "${card.trim()}"`) + }) + ) + } + + await Promise.all(checks) + return errors +} diff --git a/panel-dostepu/src/style.css b/panel-dostepu/src/style.css new file mode 100644 index 0000000..77dc55c --- /dev/null +++ b/panel-dostepu/src/style.css @@ -0,0 +1,148 @@ +*, *::before, *::after { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +:root { + --bg: #0c0c0c; + --bg-card: #161616; + --bg-input: #1e1e1e; + --border: rgba(255, 255, 255, 0.07); + --border-focus: rgba(185, 150, 60, 0.5); + --gold: #b9963c; + --gold-light: #d4af6a; + --text: #ede9e3; + --text-muted: #6b6560; + --text-dim: #9e9890; + --success: #4a7c59; + --success-bg: rgba(74, 124, 89, 0.12); + --error: #8b3a3a; + --error-bg: rgba(139, 58, 58, 0.12); + --font-serif: 'Playfair Display', Georgia, serif; + --font-sans: 'Inter', system-ui, sans-serif; + --radius: 4px; + --radius-lg: 8px; + --transition: 200ms ease; +} + +html, body { + height: 100%; + background: var(--bg); + color: var(--text); + font-family: var(--font-sans); + font-size: 14px; + line-height: 1.6; + -webkit-font-smoothing: antialiased; +} + +#app { + min-height: 100vh; +} + +/* ── Typography ─────────────────────────────────────────── */ +h1, h2, h3 { + font-family: var(--font-serif); + font-weight: 400; + letter-spacing: 0.02em; +} + +/* ── Inputs ─────────────────────────────────────────────── */ +input { + width: 100%; + background: var(--bg-input); + border: 1px solid var(--border); + border-radius: var(--radius); + color: var(--text); + font-family: var(--font-sans); + font-size: 14px; + padding: 10px 14px; + outline: none; + transition: border-color var(--transition), box-shadow var(--transition); +} + +input:focus { + border-color: var(--border-focus); + box-shadow: 0 0 0 3px rgba(185, 150, 60, 0.08); +} + +input::placeholder { + color: var(--text-muted); +} + +/* ── Buttons ─────────────────────────────────────────────── */ +button { + cursor: pointer; + font-family: var(--font-sans); + font-size: 13px; + letter-spacing: 0.06em; + text-transform: uppercase; + border: none; + border-radius: var(--radius); + padding: 10px 20px; + transition: all var(--transition); +} + +.btn-primary { + background: var(--gold); + color: #0c0c0c; + font-weight: 500; +} + +.btn-primary:hover { + background: var(--gold-light); +} + +.btn-primary:active { + transform: translateY(1px); +} + +.btn-primary:disabled { + opacity: 0.4; + cursor: not-allowed; + transform: none; +} + +.btn-ghost { + background: transparent; + color: var(--text-dim); + border: 1px solid var(--border); +} + +.btn-ghost:hover { + border-color: rgba(255,255,255,0.15); + color: var(--text); +} + +/* ── Divider ─────────────────────────────────────────────── */ +.divider { + height: 1px; + background: var(--border); + margin: 20px 0; +} + +/* ── Feedback ────────────────────────────────────────────── */ +.feedback { + padding: 8px 12px; + border-radius: var(--radius); + font-size: 13px; + margin-top: 8px; +} + +.feedback.success { + background: var(--success-bg); + color: #7eba94; + border: 1px solid rgba(74, 124, 89, 0.25); +} + +.feedback.error { + background: var(--error-bg); + color: #c97a7a; + border: 1px solid rgba(139, 58, 58, 0.25); +} + +/* ── Scrollbar ───────────────────────────────────────────── */ +::-webkit-scrollbar { width: 6px; } +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; } +::-webkit-scrollbar-thumb:hover { background: #3a3a3a; } diff --git a/panel-dostepu/src/views/ApartmentView copy.vue b/panel-dostepu/src/views/ApartmentView copy.vue new file mode 100644 index 0000000..50f9c8b --- /dev/null +++ b/panel-dostepu/src/views/ApartmentView copy.vue @@ -0,0 +1,763 @@ + + + + + diff --git a/panel-dostepu/src/views/ApartmentView.vue b/panel-dostepu/src/views/ApartmentView.vue new file mode 100644 index 0000000..012cbc6 --- /dev/null +++ b/panel-dostepu/src/views/ApartmentView.vue @@ -0,0 +1,730 @@ + + + + + diff --git a/panel-dostepu/src/views/DashboardView.vue b/panel-dostepu/src/views/DashboardView.vue new file mode 100644 index 0000000..2b68a1e --- /dev/null +++ b/panel-dostepu/src/views/DashboardView.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/panel-dostepu/src/views/LoginView.vue b/panel-dostepu/src/views/LoginView.vue new file mode 100644 index 0000000..cbe17c1 --- /dev/null +++ b/panel-dostepu/src/views/LoginView.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/panel-dostepu/vite.config.js b/panel-dostepu/vite.config.js new file mode 100644 index 0000000..cbd6c90 --- /dev/null +++ b/panel-dostepu/vite.config.js @@ -0,0 +1,28 @@ +import { defineConfig, loadEnv } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), '') + const haUrl = env.VITE_HA_URL || 'http://10.20.10.106:8123' + + return { + plugins: [vue()], + server: { + port: 5173, + host: true, + proxy: { + '/api': { + target: haUrl, + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + // Upewnij się że Authorization header jest przekazywany + const auth = req.headers['authorization'] + if (auth) proxyReq.setHeader('Authorization', auth) + }) + }, + }, + }, + }, + } +})