[{"id":"1509049e.9012cb","type":"tab","label":"Dementia Alarm System","disabled":false,"info":""},{"id":"1c187378.63b42d","type":"ui_group","name":"Patient Number 001 Alarm","tab":"eda79c42.69c6f","order":15,"disp":true,"width":"6","collapse":false},{"id":"82dcab4.5346158","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"eda79c42.69c6f","type":"ui_tab","name":"Alarm System","icon":"dashboard","disabled":false,"hidden":false},{"id":"b71cd97b.523318","type":"debug","z":"1509049e.9012cb","name":"Patient 001s Room Alarm","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1870,"y":200,"wires":[]},{"id":"57924b46.dbb894","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1640,"y":220,"wires":[["b71cd97b.523318","6d23ad01.313fb4"]]},{"id":"d044b261.c45b6","type":"ui_button","z":"1509049e.9012cb","name":"","group":"1c187378.63b42d","order":0,"width":"6","height":"3","passthru":false,"label":"Reset Patient 001s Room Alarm","tooltip":"","color":"","bgcolor":"{{bgcolour}}","icon":"","payload":"false","payloadType":"str","topic":"","topicType":"str","x":1430,"y":280,"wires":[["57924b46.dbb894","d38bee1f.c83f2"]]},{"id":"9919486b.1c7e38","type":"debug","z":"1509049e.9012cb","name":"Alarm By Toilet","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":480,"y":660,"wires":[]},{"id":"40e07793.14c968","type":"switch","z":"1509049e.9012cb","name":"Alarm by Bath Room Toilet","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":520,"y":700,"wires":[["23e52c5a.756864"],["62144ad.1f486b4"]]},{"id":"62144ad.1f486b4","type":"debug","z":"1509049e.9012cb","name":"false","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":590,"y":820,"wires":[]},{"id":"e70f36b3.75f248","type":"createcall","z":"1509049e.9012cb","creds":"","endpoint":"phone","to":"{{msg.payload}}","dtmfanswer":"","wsuri":"","headers":"","sipuri":"","extension":"","from":"","ringingtimer":"","lengthtimer":"","machinedetection":"","answer":"","answertype":"fixed","eventurl":"","x":2830,"y":220,"wires":[["9556331e.514cc"]]},{"id":"fcaa593b.765d88","type":"talk","z":"1509049e.9012cb","text":"There is a problem in Patient 001s Room!","voicename":"Joey","bargein":false,"loop":"10","level":"","x":2650,"y":220,"wires":[["e70f36b3.75f248"]]},{"id":"9556331e.514cc","type":"debug","z":"1509049e.9012cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3060,"y":220,"wires":[]},{"id":"df01356e.1bd5e8","type":"debug","z":"1509049e.9012cb","name":"Bathroom Toilet Alarm","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1860,"y":640,"wires":[]},{"id":"573ce43b.8051bc","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1640,"y":660,"wires":[["df01356e.1bd5e8","4453f64e.376f18"]]},{"id":"83dab218.4a73e","type":"ui_button","z":"1509049e.9012cb","name":"","group":"1c187378.63b42d","order":0,"width":"6","height":"3","passthru":false,"label":"Reset Bathroom Toilet Alarm","tooltip":"","color":"","bgcolor":"{{bgcolour}}","icon":"","payload":"false","payloadType":"str","topic":"","topicType":"str","x":1420,"y":720,"wires":[["573ce43b.8051bc","c56364bd.f657a8"]]},{"id":"1a76559e.065d6a","type":"debug","z":"1509049e.9012cb","name":"Bathroom Bath Alarm","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1860,"y":1120,"wires":[]},{"id":"7da2f9c8.9f0228","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1640,"y":1140,"wires":[["1a76559e.065d6a","d0db1d94.da127"]]},{"id":"90ce13ee.a44a8","type":"ui_button","z":"1509049e.9012cb","name":"","group":"1c187378.63b42d","order":0,"width":"6","height":"3","passthru":false,"label":"Reset Bathroom Bath Alarm","tooltip":"","color":"","bgcolor":"{{bgcolour}}","icon":"","payload":"false","payloadType":"str","topic":"","topicType":"str","x":1420,"y":1200,"wires":[["7da2f9c8.9f0228","6df10822.ba5028"]]},{"id":"6d23ad01.313fb4","type":"switch","z":"1509049e.9012cb","name":"Check State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1810,"y":260,"wires":[["b165c899.5eab68","b6668aa0.493e78","b444791e.7db058"]]},{"id":"b165c899.5eab68","type":"change","z":"1509049e.9012cb","name":"Set Active Alarm Color to RED","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2150,"y":280,"wires":[["d044b261.c45b6"]]},{"id":"d38bee1f.c83f2","type":"change","z":"1509049e.9012cb","name":"Set In-Active Alarm Color to GREEN","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2170,"y":380,"wires":[["d044b261.c45b6"]]},{"id":"4453f64e.376f18","type":"switch","z":"1509049e.9012cb","name":"Check State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1810,"y":700,"wires":[["dfed0290.8ab57","6f5edb68.ef05e4","a2344b34.f48258"]]},{"id":"dfed0290.8ab57","type":"change","z":"1509049e.9012cb","name":"Set Active Alarm Color to RED","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2150,"y":720,"wires":[["83dab218.4a73e"]]},{"id":"c56364bd.f657a8","type":"change","z":"1509049e.9012cb","name":"Set In-Active Alarm Color to GREEN","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2170,"y":820,"wires":[["83dab218.4a73e"]]},{"id":"d0db1d94.da127","type":"switch","z":"1509049e.9012cb","name":"Check State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1810,"y":1180,"wires":[["ac3e0b73.60b358","7f6cbf43.63e41","60e122d1.6ac05c"]]},{"id":"ac3e0b73.60b358","type":"change","z":"1509049e.9012cb","name":"Set Active Alarm Color to RED","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2150,"y":1200,"wires":[["90ce13ee.a44a8"]]},{"id":"6df10822.ba5028","type":"change","z":"1509049e.9012cb","name":"Set In-Active Alarm Color to GREEN","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2170,"y":1300,"wires":[["90ce13ee.a44a8"]]},{"id":"857c81af.e225b","type":"debug","z":"1509049e.9012cb","name":"Alarm in Patients Room","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":510,"y":220,"wires":[]},{"id":"fc13aa8c.a5fc08","type":"switch","z":"1509049e.9012cb","name":"Alarm in Patients Room","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["3809a5a3.ae1a1a"],["e201eef.8ff261"]]},{"id":"e201eef.8ff261","type":"debug","z":"1509049e.9012cb","name":"false","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":590,"y":340,"wires":[]},{"id":"3809a5a3.ae1a1a","type":"change","z":"1509049e.9012cb","name":"Trigger Alarm in Patients Room","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":220,"wires":[["57924b46.dbb894","168d4e66.c779c2"]]},{"id":"b6668aa0.493e78","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":220,"wires":[["fcaa593b.765d88"]]},{"id":"23e52c5a.756864","type":"change","z":"1509049e.9012cb","name":"Trigger Alarm in Bathroom by Toilet","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":660,"wires":[["573ce43b.8051bc","333f867d.a177ba"]]},{"id":"3323826.9eabf7e","type":"createcall","z":"1509049e.9012cb","creds":"","endpoint":"phone","to":"{{msg.payload}}","dtmfanswer":"","wsuri":"","headers":"","sipuri":"","extension":"","from":"","ringingtimer":"","lengthtimer":"","machinedetection":"","answer":"","answertype":"fixed","eventurl":"","x":2830,"y":660,"wires":[["751a8bb1.12b984"]]},{"id":"ae6b0f1d.c9ab","type":"talk","z":"1509049e.9012cb","text":"There is a problem in the Bathroom by the Toilet!","voicename":"Joey","bargein":false,"loop":"10","level":"","x":2640,"y":660,"wires":[["3323826.9eabf7e"]]},{"id":"751a8bb1.12b984","type":"debug","z":"1509049e.9012cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3060,"y":660,"wires":[]},{"id":"6f5edb68.ef05e4","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":660,"wires":[["ae6b0f1d.c9ab"]]},{"id":"270a1810.2960f8","type":"debug","z":"1509049e.9012cb","name":"Alarm By Bath","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":520,"y":1140,"wires":[]},{"id":"7887f8dd.692a28","type":"switch","z":"1509049e.9012cb","name":"Alarm by Bath Room Bath","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":1180,"wires":[["a7c528e0.faaaf8"],["af1383cd.23c68"]]},{"id":"af1383cd.23c68","type":"debug","z":"1509049e.9012cb","name":"false","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":1280,"wires":[]},{"id":"a7c528e0.faaaf8","type":"change","z":"1509049e.9012cb","name":"Trigger Alarm in Bathroom by Bath","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":1140,"wires":[["7da2f9c8.9f0228","79da2dab.fd2f94"]]},{"id":"636a84d8.14ecec","type":"createcall","z":"1509049e.9012cb","creds":"","endpoint":"phone","to":"{{msg.payload}}","dtmfanswer":"","wsuri":"","headers":"","sipuri":"","extension":"","from":"","ringingtimer":"","lengthtimer":"","machinedetection":"","answer":"","answertype":"fixed","eventurl":"","x":2830,"y":1140,"wires":[["a3386b7b.4caf58"]]},{"id":"7d251373.9894fc","type":"talk","z":"1509049e.9012cb","text":"There is a problem in the Bathroom by the Bath!","voicename":"Joey","bargein":false,"loop":"10","level":"","x":2640,"y":1140,"wires":[["636a84d8.14ecec"]]},{"id":"a3386b7b.4caf58","type":"debug","z":"1509049e.9012cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3060,"y":1140,"wires":[]},{"id":"7f6cbf43.63e41","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1140,"wires":[["7d251373.9894fc"]]},{"id":"5a41f50c.d05c0c","type":"play audio","z":"1509049e.9012cb","name":"","voice":"5","x":1730,"y":960,"wires":[]},{"id":"7a51f2bf.7f02ec","type":"file in","z":"1509049e.9012cb","name":"","filename":"/home/pi/thereisaprobleminthebathroombythebath.wav","format":"","chunk":false,"sendError":false,"encoding":"none","x":1420,"y":960,"wires":[["5a41f50c.d05c0c","7289a671.fefe88"]]},{"id":"e8836591.3e60f8","type":"play audio","z":"1509049e.9012cb","name":"","voice":"5","x":1750,"y":520,"wires":[]},{"id":"453175b0.82262c","type":"file in","z":"1509049e.9012cb","name":"","filename":"/home/pi/thereisaprobleminthebathroombythetoilet.wav","format":"","chunk":false,"sendError":false,"encoding":"none","x":1400,"y":520,"wires":[["e8836591.3e60f8","745b1a6b.86a774"]]},{"id":"aec50c07.3fd0d","type":"play audio","z":"1509049e.9012cb","name":"","voice":"5","x":1710,"y":80,"wires":[]},{"id":"959992fd.45a37","type":"file in","z":"1509049e.9012cb","name":"","filename":"/home/pi/thereisaprobleminpatient001sroom.wav","format":"","chunk":false,"sendError":false,"encoding":"none","x":1380,"y":80,"wires":[["aec50c07.3fd0d","ccb3a93d.aeb2d8"]]},{"id":"b444791e.7db058","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":260,"wires":[["ad2c6827.d49fe8"]]},{"id":"ad2c6827.d49fe8","type":"sendsms","z":"1509049e.9012cb","creds":"","to":"{{msg.payload}}","fr":"","text":"There is a problem in Patient 001s Room!","unicode":false,"x":2830,"y":260,"wires":[[]]},{"id":"a2344b34.f48258","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":700,"wires":[["aab0bd4b.a6833"]]},{"id":"aab0bd4b.a6833","type":"sendsms","z":"1509049e.9012cb","creds":"","to":"{{msg.payload}}","fr":"","text":"There is a problem in Bathroom by the Toilet!","unicode":false,"x":2830,"y":700,"wires":[[]]},{"id":"60e122d1.6ac05c","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1180,"wires":[["44837d1e.608be4"]]},{"id":"44837d1e.608be4","type":"sendsms","z":"1509049e.9012cb","creds":"","to":"{{msg.payload}}","fr":"","text":"There is a problem in the Bathroom by the Bath!","unicode":false,"x":2830,"y":1180,"wires":[[]]},{"id":"168d4e66.c779c2","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1080,"y":80,"wires":[["959992fd.45a37"]]},{"id":"ccb3a93d.aeb2d8","type":"delay","z":"1509049e.9012cb","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1360,"y":120,"wires":[["8d9512af.c99ca"]]},{"id":"8d9512af.c99ca","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":180,"wires":[["168d4e66.c779c2"]]},{"id":"745b1a6b.86a774","type":"delay","z":"1509049e.9012cb","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1360,"y":560,"wires":[["790ec102.085bb"]]},{"id":"790ec102.085bb","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":620,"wires":[["333f867d.a177ba"]]},{"id":"333f867d.a177ba","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1080,"y":520,"wires":[["453175b0.82262c"]]},{"id":"7289a671.fefe88","type":"delay","z":"1509049e.9012cb","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1360,"y":1000,"wires":[["dee8593e.ddcb88"]]},{"id":"dee8593e.ddcb88","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":1060,"wires":[["79da2dab.fd2f94"]]},{"id":"79da2dab.fd2f94","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1100,"y":960,"wires":[["7a51f2bf.7f02ec"]]},{"id":"2ab2bb1b.d68554","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1640,"y":1660,"wires":[["bb7ecc8e.4acd8","90e7b794.bb98f8"]]},{"id":"c004b327.1813a","type":"ui_button","z":"1509049e.9012cb","name":"","group":"1c187378.63b42d","order":0,"width":"6","height":"3","passthru":false,"label":"Reset Patient 001s Fall Sensor Alarm","tooltip":"","color":"","bgcolor":"{{bgcolour}}","icon":"","payload":"false","payloadType":"str","topic":"","topicType":"str","x":1450,"y":1720,"wires":[["2ab2bb1b.d68554","810030b5.dcd01"]]},{"id":"bf852eaa.a722c","type":"http in","z":"1509049e.9012cb","name":"Fall sensor Alarm","url":"/fallsensoralarm","method":"get","upload":false,"swaggerDoc":"","x":100,"y":1660,"wires":[["3f568082.6eef4","9c20dc3a.4a44","310dcf25.c6763"]]},{"id":"3f568082.6eef4","type":"debug","z":"1509049e.9012cb","name":"Fall Sensor Alarm","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":1660,"wires":[]},{"id":"9c20dc3a.4a44","type":"http response","z":"1509049e.9012cb","name":"","statusCode":"","headers":{},"x":310,"y":1720,"wires":[]},{"id":"310dcf25.c6763","type":"switch","z":"1509049e.9012cb","name":"Fall Sensor Alarm","property":"payload.set","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"eq","v":"false","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":1700,"wires":[["887467c3.e5ef88"],["58ceadec.6f0224"]]},{"id":"58ceadec.6f0224","type":"debug","z":"1509049e.9012cb","name":"false","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":530,"y":1800,"wires":[]},{"id":"887467c3.e5ef88","type":"change","z":"1509049e.9012cb","name":"Trigger Fall Sensor Alarm","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1660,"wires":[["2ab2bb1b.d68554","823371ba.94e4f"]]},{"id":"b03622c1.68cb","type":"file in","z":"1509049e.9012cb","name":"","filename":"/home/pi/patient001hashadafall.wav","format":"","chunk":false,"sendError":false,"encoding":"none","x":1360,"y":1480,"wires":[["cfa86ff0.04c55","b0e92d44.e4e77"]]},{"id":"cfa86ff0.04c55","type":"delay","z":"1509049e.9012cb","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1360,"y":1520,"wires":[["9090bdde.8d0d5"]]},{"id":"9090bdde.8d0d5","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":1580,"wires":[["823371ba.94e4f"]]},{"id":"823371ba.94e4f","type":"trigger","z":"1509049e.9012cb","name":"","op1":"true","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","outputs":1,"x":1100,"y":1480,"wires":[["b03622c1.68cb"]]},{"id":"b0e92d44.e4e77","type":"play audio","z":"1509049e.9012cb","name":"","voice":"5","x":1730,"y":1480,"wires":[]},{"id":"bb7ecc8e.4acd8","type":"debug","z":"1509049e.9012cb","name":"Fall Sensor Alarm","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1850,"y":1640,"wires":[]},{"id":"90e7b794.bb98f8","type":"switch","z":"1509049e.9012cb","name":"Check State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1810,"y":1700,"wires":[["4b4902c2.558f5c","dc167e9d.e7a4a","c28ae165.a6094"]]},{"id":"4b4902c2.558f5c","type":"change","z":"1509049e.9012cb","name":"Set Active Alarm Color to RED","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2150,"y":1720,"wires":[["c004b327.1813a"]]},{"id":"810030b5.dcd01","type":"change","z":"1509049e.9012cb","name":"Set In-Active Alarm Color to GREEN","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2170,"y":1820,"wires":[["c004b327.1813a"]]},{"id":"70f5c976.084638","type":"createcall","z":"1509049e.9012cb","creds":"","endpoint":"phone","to":"{{msg.payload}}","dtmfanswer":"","wsuri":"","headers":"","sipuri":"","extension":"","from":"","ringingtimer":"","lengthtimer":"","machinedetection":"","answer":"","answertype":"fixed","eventurl":"","x":2830,"y":1660,"wires":[["ac28edc4.57df7"]]},{"id":"3edf079f.162e68","type":"talk","z":"1509049e.9012cb","text":"Patient 001 has had a fall!","voicename":"Joey","bargein":false,"loop":"10","level":"","x":2640,"y":1660,"wires":[["70f5c976.084638"]]},{"id":"ac28edc4.57df7","type":"debug","z":"1509049e.9012cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3060,"y":1660,"wires":[]},{"id":"dc167e9d.e7a4a","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1660,"wires":[["3edf079f.162e68"]]},{"id":"c28ae165.a6094","type":"change","z":"1509049e.9012cb","name":"Phone (number)","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1700,"wires":[["420b7ab9.edc8f4"]]},{"id":"420b7ab9.edc8f4","type":"sendsms","z":"1509049e.9012cb","creds":"","to":"{{msg.payload}}","fr":"","text":"Patient 001 has had a fall!","unicode":false,"x":2830,"y":1700,"wires":[[]]},{"id":"5c1dc520.2e250c","type":"rpi-gpio in","z":"1509049e.9012cb","name":"Patients Room Alarm","pin":"29","intype":"down","debounce":"25","read":false,"x":120,"y":160,"wires":[["b94b2e69.8ff79"]]},{"id":"8139d8fa.190f08","type":"rpi-gpio in","z":"1509049e.9012cb","name":"Patients Toilet Alarm","pin":"31","intype":"down","debounce":"25","read":false,"x":110,"y":580,"wires":[["501d7bdf.c53b74"]]},{"id":"dd9cc645.49e638","type":"rpi-gpio in","z":"1509049e.9012cb","name":"Patients Bath Alarm","pin":"33","intype":"down","debounce":"25","read":true,"x":110,"y":1080,"wires":[["61387c33.c6bca4"]]},{"id":"6ca0f6e6.b63e68","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"","payloadType":"date","x":1200,"y":380,"wires":[["715cd902.588918"]]},{"id":"715cd902.588918","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1390,"y":380,"wires":[["d044b261.c45b6"]]},{"id":"27a4f085.6f68e","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"","payloadType":"date","x":1190,"y":800,"wires":[["11a541d1.a53bfe"]]},{"id":"11a541d1.a53bfe","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":800,"wires":[["83dab218.4a73e"]]},{"id":"85572b47.9adcc8","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"","payloadType":"date","x":1190,"y":1300,"wires":[["2a95bb32.16bcd4"]]},{"id":"2a95bb32.16bcd4","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":1300,"wires":[["90ce13ee.a44a8"]]},{"id":"3cc86726.d87908","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"","payloadType":"date","x":1190,"y":1840,"wires":[["d4ac1f86.0ee54"]]},{"id":"d4ac1f86.0ee54","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"bgcolour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":1840,"wires":[["c004b327.1813a"]]},{"id":"237e3a78.68f4c6","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":130,"y":1160,"wires":[["2914415f.33f90e"]]},{"id":"61387c33.c6bca4","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"bathalarm","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":1080,"wires":[[]]},{"id":"2914415f.33f90e","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"bathalarm","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":1160,"wires":[["270a1810.2960f8","7887f8dd.692a28"]]},{"id":"501d7bdf.c53b74","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"toiletalarm","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":580,"wires":[[]]},{"id":"fcb56e14.e4caa","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"toiletalarm","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":680,"wires":[["9919486b.1c7e38","40e07793.14c968"]]},{"id":"c13d7508.8c69a8","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":110,"y":680,"wires":[["fcb56e14.e4caa"]]},{"id":"16c8414f.eb57bf","type":"inject","z":"1509049e.9012cb","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":110,"y":240,"wires":[["7fad67db.484008"]]},{"id":"b94b2e69.8ff79","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"patientsroom","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":160,"wires":[[]]},{"id":"7fad67db.484008","type":"change","z":"1509049e.9012cb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"patientsroom","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":240,"wires":[["857c81af.e225b","fc13aa8c.a5fc08"]]}]