Heute nur ein kleines Flow-Update zur HomeKit-Steuerung meines Hörmann Seitensektionaltors…
Setting:
- 1 Relais steuert den Antrieb (NodOn Relais, Tasterfunktion)
- 2 Türsensoren zur Bestimmung ganz auf/geschlossen
Flow in NodeRed:
- Verzicht auf Webhooks…das ganze läuft lokal über den homee node
- Wird das Tor manuell angehalten, arbeiten danach die Stati wieder korrekt
- Steuerung über HomeKit, homee und manuell bringt die Stati nicht mehr durcheinander
[{"id":"9541dff1.ab6ff","type":"link in","z":"2cc975df.7f8f7a","name":"","links":["bbddce99.fc4118"],"x":95,"y":1120,"wires":[["6d2a0160.a2ae3"]]},{"id":"215140ed.3162b","type":"link out","z":"2cc975df.7f8f7a","name":"","links":["1f6d5452.168fbc"],"x":1275,"y":1100,"wires":[]},{"id":"889af82d.31c5f8","type":"homekit-service","z":"2cc975df.7f8f7a","accessory":"c6e3fefa.a89558","name":"Garagentor","serviceName":"GarageDoorOpener","x":1010,"y":1100,"wires":[["a2cb52ad.d8726"]]},{"id":"17d43df.bf84c42","type":"function","z":"2cc975df.7f8f7a","name":"Status offen nach Stop","func":"const attributes = global.get('homee.attributes');\nvar test = attributes.filter(attribute => attribute.id === 1272).map(a => a.current_value).reduce((a,c) => a+c);\nif (msg.payload.TargetDoorState === 0 && test === 1){\n return {payload: {\"CurrentDoorState\":0}};\n}\n","outputs":1,"noerr":0,"x":750,"y":1080,"wires":[["889af82d.31c5f8"]]},{"id":"1e16b9a5.fb5a16","type":"delay","z":"2cc975df.7f8f7a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":1080,"wires":[["17d43df.bf84c42"]]},{"id":"3b363ef.bdd3142","type":"function","z":"2cc975df.7f8f7a","name":"Status geschlossen nach Stop","func":"const attributes = global.get('homee.attributes');\nvar test = attributes.filter(attribute => attribute.id === 1272).map(a => a.current_value).reduce((a,c) => a+c);\nif (msg.payload.TargetDoorState === 1 && test === 1){\n return {payload: {\"CurrentDoorState\":1}};\n}\n","outputs":1,"noerr":0,"x":770,"y":1140,"wires":[["889af82d.31c5f8"]]},{"id":"3bd6d82f.5de52","type":"delay","z":"2cc975df.7f8f7a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":1140,"wires":[["3b363ef.bdd3142"]]},{"id":"a2cb52ad.d8726","type":"function","z":"2cc975df.7f8f7a","name":"an-aus","func":"var nodeid = 218; // node ID in homee vom Gerät\nvar attributid = 1082; // attribut ID in homee vom Gerät\nconst attributes = global.get('homee.attributes');\nif (msg.payload.TargetDoorState === 0)\n{return {payload: \"PUT:/nodes/\"+nodeid+\"/attributes/\"+attributid+\"?target_value=1\"}}\nif (msg.payload.TargetDoorState === 1)\n{return {payload: \"PUT:/nodes/\"+nodeid+\"/attributes/\"+attributid+\"?target_value=1\"}}\n","outputs":1,"noerr":0,"x":1170,"y":1100,"wires":[["215140ed.3162b"]]},{"id":"6d2a0160.a2ae3","type":"function","z":"2cc975df.7f8f7a","name":"Status an HomeKit","func":"var attribute = msg.payload.attribute;\nvar contact1 = 1156;\nvar contact2 = 1272;\nif (attribute && attribute.id === contact1 && attribute.current_value === 0 ) {return [{payload: {\"TargetDoorState\":1,\"CurrentDoorState\":1}}];}\nif (attribute && attribute.id === contact1 && attribute.current_value === 1 ) {return [{payload: {\"TargetDoorState\":0}}];}\nif (attribute && attribute.id === contact2 && attribute.current_value === 0 ) {return [{payload: {\"TargetDoorState\":0,\"CurrentDoorState\":0}}];}\nif (attribute && attribute.id === contact2 && attribute.current_value === 1 ) {return [{payload: {\"TargetDoorState\":1}}];}\n","outputs":3,"noerr":0,"x":250,"y":1120,"wires":[["1e16b9a5.fb5a16","3bd6d82f.5de52","889af82d.31c5f8"],[],[]],"outputLabels":["Taster 1 oben gedrückt","Taster 1 unten gedrückt","Taster 1 los gelassen"]},{"id":"c6e3fefa.a89558","type":"homekit-accessory","z":"","accessoryName":"Garagentor","pinCode":"347-55-234","port":"","manufacturer":"Hoermann","model":"Supramatic E3","serialNo":"1234567890","accessoryType":"4"}]