[{"id":"f4ce26f0.22055","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"ec3347d0.94006","type":"mqtt in","z":"f4ce26f0.22055","name":"","topic":"RFID","qos":"1","datatype":"utf8","broker":"f119edb0.e6ff1","x":110,"y":160,"wires":[["8f06369a.7fb86","c7068d53.104278","a9497623.eb7a78"]]},{"id":"386fc529.c39e9a","type":"mysql","z":"f4ce26f0.22055","mydb":"38417304.575e9c","name":"","x":410,"y":240,"wires":[["3b5df68b.3ef092"]]},{"id":"a9497623.eb7a78","type":"template","z":"f4ce26f0.22055","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT rfidno FROM rfid1 \nWHERE rfidno='{{payload}}';","output":"str","x":260,"y":240,"wires":[["386fc529.c39e9a","d1329fd6.f801a"]]},{"id":"3b5df68b.3ef092","type":"switch","z":"f4ce26f0.22055","name":"","property":"payload","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":240,"wires":[["69c0acd5.fcc094"],["951e3461.d81718"]]},{"id":"69c0acd5.fcc094","type":"change","z":"f4ce26f0.22055","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"CR_FAIL","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":140,"wires":[["fc20bb4d.9f3b9","8f218188.f7c7d"]]},{"id":"951e3461.d81718","type":"change","z":"f4ce26f0.22055","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"CR_SUCCESS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":340,"wires":[["27049bf1.bb8dd4","fc20bb4d.9f3b9","207d854c.6e3b7a","b00f41b0.3c09e8"]]},{"id":"fc20bb4d.9f3b9","type":"mqtt out","z":"f4ce26f0.22055","name":"","topic":"MATCH","qos":"2","retain":"true","broker":"f119edb0.e6ff1","x":800,"y":240,"wires":[]},{"id":"b00f41b0.3c09e8","type":"ui_switch","z":"f4ce26f0.22055","name":"","label":"Open","tooltip":"","group":"ea12b474.8ed4d8","order":0,"width":"2","height":"2","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"DR1_ON","onvalueType":"str","onicon":"","oncolor":"green","offvalue":"--","offvalueType":"str","officon":"","offcolor":"red","x":990,"y":60,"wires":[["6780d94e.dee3f","81999de5.5133f"]]},{"id":"207d854c.6e3b7a","type":"ui_switch","z":"f4ce26f0.22055","name":"","label":"Close","tooltip":"","group":"ea12b474.8ed4d8","order":0,"width":"2","height":"2","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"DR1_OFF","onvalueType":"str","onicon":"","oncolor":"green","offvalue":"--","offvalueType":"str","officon":"","offcolor":"red","x":990,"y":120,"wires":[["81999de5.5133f","6780d94e.dee3f"]]},{"id":"6780d94e.dee3f","type":"ui_text","z":"f4ce26f0.22055","group":"59684e9b.60672","order":2,"width":0,"height":0,"name":"","label":"DOOR1","format":"{{msg.payload}}","layout":"row-spread","x":1220,"y":60,"wires":[]},{"id":"81999de5.5133f","type":"template","z":"f4ce26f0.22055","name":"update_template","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE rfid1 \nSET Door_Status='{{payload}}'\nWHERE rfidno='{{id}}';\n","output":"str","x":1190,"y":160,"wires":[["15c8e7a2.fd3328","a9bdcf4.c362e3"]]},{"id":"15c8e7a2.fd3328","type":"mysql","z":"f4ce26f0.22055","mydb":"38417304.575e9c","name":"","x":1350,"y":220,"wires":[["42a36416.b6dfe4"]]},{"id":"8f06369a.7fb86","type":"debug","z":"f4ce26f0.22055","name":"MQTT_IN Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":290,"y":80,"wires":[]},{"id":"8f218188.f7c7d","type":"debug","z":"f4ce26f0.22055","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":60,"wires":[]},{"id":"27049bf1.bb8dd4","type":"debug","z":"f4ce26f0.22055","name":"Debug2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":420,"wires":[]},{"id":"eabc8767.4fabf8","type":"debug","z":"f4ce26f0.22055","name":"debug3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":500,"y":100,"wires":[]},{"id":"c7068d53.104278","type":"change","z":"f4ce26f0.22055","name":"","rules":[{"t":"set","p":"id","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":160,"wires":[["eabc8767.4fabf8","81999de5.5133f"]]},{"id":"d1329fd6.f801a","type":"debug","z":"f4ce26f0.22055","name":"Debug23","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":400,"y":340,"wires":[]},{"id":"a9bdcf4.c362e3","type":"debug","z":"f4ce26f0.22055","name":"Debug_template","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1320,"y":340,"wires":[]},{"id":"42a36416.b6dfe4","type":"debug","z":"f4ce26f0.22055","name":"Debug_rfid","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1490,"y":160,"wires":[]},{"id":"f119edb0.e6ff1","type":"mqtt-broker","z":"","name":"RFID","broker":"tcp://mqtt.eclipse.org","port":"1883","clientid":"NCS_Client_02","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"2","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"38417304.575e9c","type":"MySQLdatabase","z":"","name":"","host":"127.0.0.1","port":"3306","db":"rfid","tz":""},{"id":"ea12b474.8ed4d8","type":"ui_group","z":"","name":"Door 1","tab":"45bf936.9ba396c","order":2,"disp":true,"width":"6","collapse":false},{"id":"59684e9b.60672","type":"ui_group","z":"","name":"Door Controller","tab":"45bf936.9ba396c","order":1,"disp":true,"width":"6","collapse":false},{"id":"45bf936.9ba396c","type":"ui_tab","z":"","name":" NCS_Door Controller Panel","icon":"door controller","order":1,"disabled":false,"hidden":false}]