Proyecto Smart Home

Smart Home Proyect

[{"id":"19f5c9d9.3b2b86","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"260f4dcd.c128b2","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"12","set":false,"level":"1","freq":"","out":"pwm","x":1000,"y":160,"wires":[]},{"id":"fa834c58.eff5b","type":"rpi-gpio in","z":"19f5c9d9.3b2b86","name":"Sensor movimiento","pin":"11","intype":"tri","debounce":"25","read":false,"x":110,"y":420,"wires":[["1941263c.f8bafa","715fb55c.2dcb7c","7ca69633.d0ecb8"]]},{"id":"ae6b2f10.fd726","type":"debug","z":"19f5c9d9.3b2b86","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":570,"y":360,"wires":[]},{"id":"1941263c.f8bafa","type":"function","z":"19f5c9d9.3b2b86","name":"funcionMovimiento","func":"if(msg.payload == 1){\n    return msg;\n}\n","outputs":1,"noerr":0,"x":350,"y":420,"wires":[["ae6b2f10.fd726","db22c6e6.915678"]]},{"id":"792d1bc1.51a334","type":"template","z":"19f5c9d9.3b2b86","name":"","field":"payload.content","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Hola ☺️","output":"str","x":436,"y":931,"wires":[["5e3d4a08.3c0214"]]},{"id":"645c381f.7d8fa8","type":"camerapi-takephoto","z":"19f5c9d9.3b2b86","filemode":"1","filename":"photo2.JPEG","filedefpath":"0","filepath":"/home/pi/Pictures/","fileformat":"jpeg","resolution":"9","rotation":"0","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","quality":"80","imageeffect":"none","exposuremode":"auto","iso":"0","agcwait":"1.0","led":"0","awb":"auto","name":"Take photo","x":309,"y":821,"wires":[["2c5fdca3.389ca4"]]},{"id":"84f62b69.cd1118","type":"debug","z":"19f5c9d9.3b2b86","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":833,"y":950,"wires":[]},{"id":"2cbb6847.7bf718","type":"switch","z":"19f5c9d9.3b2b86","name":"Chat","property":"payload.content","propertyType":"msg","rules":[{"t":"eq","v":"Hola","vt":"str"},{"t":"eq","v":"hola","vt":"str"},{"t":"eq","v":"Que hace?","vt":"str"},{"t":"eq","v":"Gracias","vt":"str"},{"t":"eq","v":".","vt":"str"},{"t":"eq","v":"ummm 🙄","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":250,"y":1000,"wires":[["792d1bc1.51a334"],["792d1bc1.51a334"],["b9476ef2.123f2"],["da1bcb5b.404168"],["43fd1db7.d63074"],["5ee5dd47.60d604"]]},{"id":"b9476ef2.123f2","type":"template","z":"19f5c9d9.3b2b86","name":"","field":"payload.content","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Cuido tu casa 😌","output":"str","x":436,"y":971,"wires":[["5e3d4a08.3c0214"]]},{"id":"18cb49da.4c6b16","type":"function","z":"19f5c9d9.3b2b86","name":"TomarFoto","func":"msg.payload.content=\"Esta fue la imagen que capturo la camara de seguridad 📷\"\nreturn msg;","outputs":1,"noerr":0,"x":311,"y":877,"wires":[["8295e141.e0667"]]},{"id":"9c5cdf19.f9b6b","type":"function","z":"19f5c9d9.3b2b86","name":"Lista de acciones","func":"msg.payload.content=\"Aqui una lista de comandos que podras usar como enlace directos a diferntes acciones que puedo hacer por ti \\n Cada comando estara subrayado con color azul, tan solo con que le des clilk en el enlace se enviara el comando sin necesidad de que lo escribas de nuevo \\n \\n \"\n+\"Lista de comandos: \\n\\n\"\n+\"Comando: /tomarFoto \\n\"\n+\"Descripción: Con este comando puedes tomar fotos que seran enviadas a tu chat de Telegram \\n \\n\"\n\n+\"Comando: /temperatura \\n\"\n+\"Descripción: Con este comando podras obtener la temperatura actual de tu hogar  \\n \\n\"\n\n+\"Comando: /humedad \\n\"\n+\"Descripción: Con este comando podras obtener el nivel de humedad de tu hoga \\n \\n\"\n\n+\"Comando: /emergencia \\n\"\n+\"Descripción: Con este comando podras obtener el nivel de humedad de tu hoga \\n \\n\"\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":1760,"wires":[["40af2ed5.a3ea9"]]},{"id":"41a77fc5.f1b86","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"37","set":true,"level":"0","freq":"","out":"out","x":620,"y":1100,"wires":[]},{"id":"715fb55c.2dcb7c","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"29","set":true,"level":"0","freq":"","out":"out","x":360,"y":360,"wires":[]},{"id":"b8ad32a1.779a4","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLuces","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":1100,"wires":[["41a77fc5.f1b86","c156ffd3.8274d"]]},{"id":"e121a9fd.3da6d8","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"37","set":true,"level":"0","freq":"","out":"out","x":620,"y":1147,"wires":[]},{"id":"114e71ed.bcccde","type":"function","z":"19f5c9d9.3b2b86","name":"ApagarLuces","func":"msg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":1147,"wires":[["e121a9fd.3da6d8","9e701d3c.92782"]]},{"id":"12045853.ee7768","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"35","set":true,"level":"0","freq":"","out":"out","x":700,"y":1220,"wires":[]},{"id":"307e40d.e0df6c","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLuces","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":1220,"wires":[["12045853.ee7768","2bc6eb72.1da164"]]},{"id":"7728ff0a.7ce0e","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"35","set":true,"level":"0","freq":"","out":"out","x":700,"y":1260,"wires":[]},{"id":"49a6f5de.03838c","type":"function","z":"19f5c9d9.3b2b86","name":"ApagarLuces","func":"msg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":1260,"wires":[["7728ff0a.7ce0e","2b8731e4.55e19e"]]},{"id":"476d999f.ea55a8","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"33","set":true,"level":"0","freq":"","out":"out","x":700,"y":1340,"wires":[]},{"id":"3a44bd6f.61ec72","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLuces","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":1340,"wires":[["476d999f.ea55a8","46c55b41.9c4e44"]]},{"id":"60fc2f3c.cda0c","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"33","set":true,"level":"0","freq":"","out":"out","x":700,"y":1380,"wires":[]},{"id":"2e0dcdb5.dc2d32","type":"function","z":"19f5c9d9.3b2b86","name":"ApagarLuces","func":"msg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":1380,"wires":[["60fc2f3c.cda0c","97dde4ce.d411c8"]]},{"id":"ceb65692.c224a8","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"37","set":true,"level":"0","freq":"","out":"out","x":700,"y":1460,"wires":[]},{"id":"45f39508.35cd4c","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLuces","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":1500,"wires":[["ceb65692.c224a8","6924fb23.f689c4","86e11c8f.4ad66","ba26bbda.cfea78"]]},{"id":"2dbd13c7.b061fc","type":"function","z":"19f5c9d9.3b2b86","name":"ApagarLuces","func":"msg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":1633,"wires":[["d400a1a.b941a6","dd163b61.a71c98","9c569b91.de9188","156c4a54.036616"]]},{"id":"6924fb23.f689c4","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"35","set":true,"level":"0","freq":"","out":"out","x":700,"y":1500,"wires":[]},{"id":"86e11c8f.4ad66","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"33","set":true,"level":"0","freq":"","out":"out","x":700,"y":1540,"wires":[]},{"id":"d400a1a.b941a6","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"37","set":true,"level":"0","freq":"","out":"out","x":700,"y":1600,"wires":[]},{"id":"dd163b61.a71c98","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"35","set":true,"level":"0","freq":"","out":"out","x":700,"y":1640,"wires":[]},{"id":"9c569b91.de9188","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"33","set":true,"level":"0","freq":"","out":"out","x":700,"y":1680,"wires":[]},{"id":"fb8accba.d65e9","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLuces","func":"msg.payload = true\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":220,"wires":[["260f4dcd.c128b2"]]},{"id":"6931cc1f.7400f4","type":"function","z":"19f5c9d9.3b2b86","name":"ApagarLuces","func":"msg.payload = false\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":260,"wires":[["260f4dcd.c128b2"]]},{"id":"2c9a6d60.5917e2","type":"rpi-gpio in","z":"19f5c9d9.3b2b86","name":"Sensor Metano","pin":"13","intype":"tri","debounce":"25","read":false,"x":100,"y":600,"wires":[["8b16ad98.5428e","1e87f684.2b3b89","9e5485eb.570418","7cf5ae8.591455","151f80f9.f2bd0f"]]},{"id":"8b16ad98.5428e","type":"debug","z":"19f5c9d9.3b2b86","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":310,"y":560,"wires":[]},{"id":"1e87f684.2b3b89","type":"function","z":"19f5c9d9.3b2b86","name":"funcionMovimiento","func":"if(msg.payload == 1){\n    return msg;\n}\n","outputs":1,"noerr":0,"x":330,"y":600,"wires":[[]]},{"id":"7cf5ae8.591455","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"31","set":true,"level":"0","freq":"","out":"out","x":300,"y":680,"wires":[]},{"id":"151f80f9.f2bd0f","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Registro gas metano en la casa🤢!!!, puede ser una fuga. ","parseMode":"","x":320,"y":740,"wires":[]},{"id":"7ca69633.d0ecb8","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Se registro movimento en la casa, fuiste tu 😟😳? puedo tomar una foto si quires /tomarfoto","parseMode":"","x":339,"y":474,"wires":[]},{"id":"2c5fdca3.389ca4","type":"telegrambot-payload","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","sendMethod":"sendPhoto","payload":"{\n    \"photo\":\"/home/pi/Pictures/photo2.JPEG\"\n}","x":529,"y":812,"wires":[[]]},{"id":"1ff73f3b.458c51","type":"telegram receiver","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","saveDataDir":"","x":90,"y":1000,"wires":[["2cbb6847.7bf718"],["2cbb6847.7bf718"]]},{"id":"cae3c461.e751d8","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/tomarfoto","bot":"2e504da3.a10ef2","strict":false,"x":143,"y":911,"wires":[["645c381f.7d8fa8","18cb49da.4c6b16"],[]],"outputLabels":["f","on"]},{"id":"3e5d0450.0c57dc","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/help","bot":"2e504da3.a10ef2","strict":false,"x":192,"y":1758,"wires":[["9c5cdf19.f9b6b"],[]]},{"id":"d534ab32.003af8","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/prenderluzdelasala","bot":"2e504da3.a10ef2","strict":false,"x":210,"y":1100,"wires":[["b8ad32a1.779a4"],[]]},{"id":"d7b6991c.5757b8","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/apagarluzdelasala","bot":"2e504da3.a10ef2","strict":false,"x":210,"y":1147,"wires":[["114e71ed.bcccde"],[]]},{"id":"9b14228.be15fe","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/prenderluzdelahabitacion","bot":"2e504da3.a10ef2","strict":false,"x":230,"y":1220,"wires":[["307e40d.e0df6c"],[]]},{"id":"cd6bfb37.7a92f8","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/apagarluzdelahabitacion","bot":"2e504da3.a10ef2","strict":false,"x":230,"y":1267,"wires":[["49a6f5de.03838c"],[]]},{"id":"3b836b82.5f5fb4","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/prenderluzcentral","bot":"2e504da3.a10ef2","strict":false,"x":210,"y":1340,"wires":[["3a44bd6f.61ec72"],[]]},{"id":"b1e8aad6.d4fb68","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/apagarluzcentral","bot":"2e504da3.a10ef2","strict":false,"x":200,"y":1387,"wires":[["2e0dcdb5.dc2d32"],[]]},{"id":"5f61c576.d62a9c","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/prendertodaslasluces","bot":"2e504da3.a10ef2","strict":false,"x":200,"y":1500,"wires":[["45f39508.35cd4c"],[]]},{"id":"54e9201e.31dad","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/apagartodaslasluces","bot":"2e504da3.a10ef2","strict":false,"x":220,"y":1640,"wires":[["2dbd13c7.b061fc"],[]]},{"id":"32896359.b4277c","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/prendersensormovimiento","bot":"2e504da3.a10ef2","strict":false,"x":510,"y":220,"wires":[["fb8accba.d65e9"],[]]},{"id":"50b6cb0f.9a55c4","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/apagarsensormovimiento","bot":"2e504da3.a10ef2","strict":false,"x":510,"y":267,"wires":[["6931cc1f.7400f4"],[]]},{"id":"8295e141.e0667","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","x":547,"y":876,"wires":[["84f62b69.cd1118"]]},{"id":"5e3d4a08.3c0214","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","x":626,"y":951,"wires":[["84f62b69.cd1118"]]},{"id":"40af2ed5.a3ea9","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","x":610,"y":1760,"wires":[[]]},{"id":"362733c9.03046c","type":"ui_switch","z":"19f5c9d9.3b2b86","name":"","label":"Sensor de movimiento (on/off)","group":"63942e78.6aa8a","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":150,"y":160,"wires":[["260f4dcd.c128b2"]]},{"id":"afabe0de.3dae6","type":"ui_switch","z":"19f5c9d9.3b2b86","name":"","label":"Sensor de humedad (on/off)","group":"63942e78.6aa8a","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":160,"y":220,"wires":[[]]},{"id":"68bafcf9.3eb544","type":"ui_switch","z":"19f5c9d9.3b2b86","name":"","label":"Sensor de metano (on/off)","group":"63942e78.6aa8a","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":160,"y":260,"wires":[[]]},{"id":"5e6e5b90.5b2214","type":"ui_switch","z":"19f5c9d9.3b2b86","name":"","label":"Camara (on/off)","group":"63942e78.6aa8a","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":120,"y":300,"wires":[[]]},{"id":"8dadf6f3.8c2458","type":"ui_gauge","z":"19f5c9d9.3b2b86","name":"","group":"d2cd9d32.aed9f","order":0,"width":"0","height":"0","gtype":"donut","title":"Nivel de Humedad","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":737,"y":1931,"wires":[]},{"id":"cc1130f3.dc5fc","type":"ui_gauge","z":"19f5c9d9.3b2b86","name":"","group":"9cbdde99.3debf","order":0,"width":"0","height":"0","gtype":"donut","title":"Nivel de Temperatura ","label":"ºC","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":767,"y":1891,"wires":[]},{"id":"9e5485eb.570418","type":"ui_chart","z":"19f5c9d9.3b2b86","name":"","group":"3c8fc55d.fa437a","order":0,"width":0,"height":0,"label":"Niveles de metano","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#2dcc21","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":330,"y":640,"wires":[[],[]]},{"id":"db22c6e6.915678","type":"ui_toast","z":"19f5c9d9.3b2b86","position":"top right","displayTime":"","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"Se ha registrado movimiento en la propiedad !!!","name":"","x":590,"y":400,"wires":[]},{"id":"2d717797.bc0a78","type":"rpi-dht22","z":"19f5c9d9.3b2b86","name":"","topic":"rpi-dht11","dht":"11","pintype":"0","pin":4,"x":357.5,"y":1918,"wires":[["f854a167.6a9e5","e42396eb.14d078","7a660cc1.20efe4","75a12aa0.d8a754"]]},{"id":"3e6573bf.007b9c","type":"inject","z":"19f5c9d9.3b2b86","name":"","topic":"","payload":"","payloadType":"date","repeat":"15","crontab":"","once":false,"onceDelay":0.1,"x":168.5,"y":1916,"wires":[["2d717797.bc0a78"]]},{"id":"f854a167.6a9e5","type":"debug","z":"19f5c9d9.3b2b86","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":565.5,"y":1848,"wires":[]},{"id":"e42396eb.14d078","type":"function","z":"19f5c9d9.3b2b86","name":"Temperatura","func":"msg.payload=msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":571.5,"y":1889,"wires":[["cc1130f3.dc5fc"]]},{"id":"7a660cc1.20efe4","type":"function","z":"19f5c9d9.3b2b86","name":"Humedad","func":"msg.payload=msg.humidity\nreturn msg;","outputs":1,"noerr":0,"x":560.5,"y":1932,"wires":[["8dadf6f3.8c2458"]]},{"id":"75a12aa0.d8a754","type":"switch","z":"19f5c9d9.3b2b86","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"30","vt":"num","v2":"40","v2t":"num"},{"t":"gt","v":"41","vt":"num"},{"t":"lt","v":"30","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":533.5,"y":2023,"wires":[["33edea18.c026e6","1f5118b6.a83d77"],["e8e10064.bfdc1","1f5118b6.a83d77"],["ebd4bfdb.8171c"]]},{"id":"e8e10064.bfdc1","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Alerta !!! registro temperaturas superiores a 40 ºc 🔥","parseMode":"","x":707,"y":2045,"wires":[]},{"id":"33edea18.c026e6","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"La temperatura esta muy alta 🤔 deberias revisar de que no sea una emergencia","parseMode":"","x":706,"y":1993,"wires":[]},{"id":"ba26bbda.cfea78","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! prendi las luces💡","parseMode":"","x":875,"y":1494,"wires":[]},{"id":"46c55b41.9c4e44","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! prendi las luces💡","parseMode":"","x":878,"y":1344,"wires":[]},{"id":"2bc6eb72.1da164","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! prendi las luces💡","parseMode":"","x":875,"y":1221,"wires":[]},{"id":"c156ffd3.8274d","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! prendi las luces💡","parseMode":"","x":819,"y":1101,"wires":[]},{"id":"156c4a54.036616","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! apague las luces 😎","parseMode":"","x":875,"y":1630,"wires":[]},{"id":"97dde4ce.d411c8","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! apague las luces 😎","parseMode":"","x":882,"y":1384,"wires":[]},{"id":"2b8731e4.55e19e","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! apague las luces 😎","parseMode":"","x":877,"y":1265,"wires":[]},{"id":"9e701d3c.92782","type":"telegrambot-notify","z":"19f5c9d9.3b2b86","name":"","bot":"fb8c9602.c925b8","chatId":"663228086","message":"Listo!!! apague las luces 😎","parseMode":"","x":821,"y":1145,"wires":[]},{"id":"525fd439.535dcc","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"22","set":true,"level":"0","freq":"","out":"out","x":1166,"y":2016,"wires":[]},{"id":"1f5118b6.a83d77","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLucesTemperatura","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":947,"y":2016,"wires":[["525fd439.535dcc"]]},{"id":"ebd4bfdb.8171c","type":"function","z":"19f5c9d9.3b2b86","name":"PrenderLucesTemperatura","func":"msg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":947,"y":2053,"wires":[["99566bd1.245378"]]},{"id":"99566bd1.245378","type":"rpi-gpio out","z":"19f5c9d9.3b2b86","name":"","pin":"22","set":true,"level":"0","freq":"","out":"out","x":1168,"y":2053,"wires":[]},{"id":"b43d4bab.939838","type":"function","z":"19f5c9d9.3b2b86","name":"Lista de acciones","func":"msg.payload.content=\" 🔔 Alertas de emergencia, la casa cuenta con leds de 3 diferentes colores a continuación su significado 🚥 \\n\\n\"\n+\"💡 Led de color rojo: \\n\"\n+\"Descripción: Este se activa cuando el sensor de movimiento detecta movimiento en la casa \\n\"\n+\"Acciones:Puedes llamar a la policía el número se mostrará cuando se genere la alerta \\n\\n\"\n\n+\"💡 Led de color verde: \\n\"\n+\"Descripción: Este de activara cuando se decten fugas de gas \\n\"\n+\"Acciones:Puedes llamar a los bomberos el número se mostrará cuando se genere la alerta \\n\\n\"\n\n+\"💡 Luz de color amarillo: \\n\"\n+\"Descripción: Esta se activa cuando se registran altas temperaturas al interior de la casa \\n\"\n+\"Acciones:Puedes llamar a los bomberos el número se mostrará cuando se genere la alerta \\n\"\n\nreturn msg;","outputs":1,"noerr":0,"x":396,"y":2148,"wires":[["1c69846.997327c"]]},{"id":"58f23af9.5ccff4","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/emergencia","bot":"2e504da3.a10ef2","strict":false,"x":192,"y":2149,"wires":[["b43d4bab.939838"],[]]},{"id":"1c69846.997327c","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","x":619,"y":2147,"wires":[[]]},{"id":"794698ea.015638","type":"telegram command","z":"19f5c9d9.3b2b86","name":"","command":"/contactosparaemergencias","bot":"2e504da3.a10ef2","strict":false,"x":180,"y":2270,"wires":[["ff41bfc6.56db7"],[]]},{"id":"ff41bfc6.56db7","type":"function","z":"19f5c9d9.3b2b86","name":"Contacto de emergencia","func":"msg.payload.content=\" 🚨 En caso de emergencia puedes llamar a estos numero: \\n\\n 👮‍ Policia:123 \\n 👨‍🚒 Bomberos:119 \\n 👨‍⚕️Cruz Roja:132\"\n\nreturn msg;","outputs":1,"noerr":0,"x":435,"y":2267,"wires":[["dd768ce1.ccb63"]]},{"id":"dd768ce1.ccb63","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"","bot":"2e504da3.a10ef2","x":646,"y":2268,"wires":[[]]},{"id":"e2abdb69.771548","type":"catch","z":"19f5c9d9.3b2b86","name":"","x":141,"y":2574,"wires":[["8ff1e944.077fa8"]]},{"id":"8ff1e944.077fa8","type":"debug","z":"19f5c9d9.3b2b86","name":"Debug","active":true,"console":"false","complete":"payload","x":613,"y":2570,"wires":[]},{"id":"c9ad6a4c.1aee48","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"show keyboard","bot":"2e504da3.a10ef2","x":627,"y":2399,"wires":[[]]},{"id":"12eef590.04769a","type":"function","z":"19f5c9d9.3b2b86","name":"confirmation message","func":"context.global.keyboard = { pending : true };\n\nvar opts = {\n  reply_to_message_id: msg.payload.messageId,\n  reply_markup: JSON.stringify({\n    keyboard: [\n      ['Help'],\n      ['Emergencia'],\n      ['Contactos de emergencia'],\n      ['Tomar Foto'],\n      ['Prender todas las luces'],\n      ['Apagar todas las luces'],\n      ['Prender sector 1'],\n      ['Apagar sector 1'],\n      ['Prender sector 2'],\n      ['Apagar sector 2'],\n      ['Prender sector 3'],\n      ['Apagar sector 3'],\n      ['Prender sensore de movimiento'],\n      ['Apagar sensore de movimiento']],\n      'resize_keyboard' : true, \n      'one_time_keyboard' : true\n  })\n};\n\nmsg.payload.content = 'Keyboard';\nmsg.payload.options = opts;\n\nreturn [ msg ];\n","outputs":"1","noerr":0,"x":361,"y":2399,"wires":[["c9ad6a4c.1aee48","d6ce5d5.2df3ca"]]},{"id":"73d5d80.85d4d28","type":"telegram command","z":"19f5c9d9.3b2b86","name":"/keyboard","command":"/keyboard","bot":"2e504da3.a10ef2","strict":false,"x":151,"y":2426,"wires":[["12eef590.04769a"],["426ccf63.33eb1","d6ce5d5.2df3ca"]]},{"id":"5cbb00bc.6f411","type":"telegram sender","z":"19f5c9d9.3b2b86","name":"send response","bot":"2e504da3.a10ef2","x":631,"y":2452,"wires":[[]]},{"id":"d6ce5d5.2df3ca","type":"switch","z":"19f5c9d9.3b2b86","name":"","property":"payload.content","propertyType":"msg","rules":[{"t":"eq","v":"Help","vt":"str"},{"t":"eq","v":"Emergencia","vt":"str"},{"t":"eq","v":"Contactos de emergencia","vt":"str"},{"t":"eq","v":"Tomar Foto","vt":"str"},{"t":"eq","v":"Prender todas las luces","vt":"str"},{"t":"eq","v":"Apagar todas las luces","vt":"str"},{"t":"eq","v":"Prender sector 1","vt":"str"},{"t":"eq","v":"Apagar sector 1","vt":"str"},{"t":"eq","v":"Prender sector 2","vt":"str"},{"t":"eq","v":"Apagar sector 2","vt":"str"},{"t":"eq","v":"Prender sector 3","vt":"str"},{"t":"eq","v":"Apagar sector 3","vt":"str"},{"t":"eq","v":"Prender sensore de movimiento","vt":"str"},{"t":"eq","v":"Apagar sensore de movimiento","vt":"str"}],"checkall":"true","repair":false,"outputs":14,"x":830.5,"y":2433,"wires":[["9c5cdf19.f9b6b"],["b43d4bab.939838"],["ff41bfc6.56db7"],["645c381f.7d8fa8"],["45f39508.35cd4c"],["2dbd13c7.b061fc"],["307e40d.e0df6c"],["49a6f5de.03838c"],["3a44bd6f.61ec72"],["2e0dcdb5.dc2d32"],["b8ad32a1.779a4"],["114e71ed.bcccde"],["fb8accba.d65e9"],["6931cc1f.7400f4"]]},{"id":"426ccf63.33eb1","type":"function","z":"19f5c9d9.3b2b86","name":"create response","func":"if(context.global.keyboard.pending)\n{\n    context.global.keyboard.pending = false;\n    \n    if(msg.payload == 'Tomar Foto')\n    {\n        msg.payload.content\n        return msg;\n    }\n    else\n    {\n        msg.payload.content = 'No';\n        return [null, msg];   \n    }\n}\n","outputs":"2","noerr":0,"x":345,"y":2458,"wires":[["5cbb00bc.6f411"],["8ff1e944.077fa8"]]},{"id":"da1bcb5b.404168","type":"template","z":"19f5c9d9.3b2b86","name":"","field":"payload.content","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"No hay porque 😊 igual para eso me programaste 👊","output":"str","x":433,"y":1010,"wires":[["5e3d4a08.3c0214"]]},{"id":"43fd1db7.d63074","type":"template","z":"19f5c9d9.3b2b86","name":"","field":"payload.content","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Ya termino la exposición?🤓 como nos fue?😳 si lesguto el proyecto?😀","output":"str","x":435,"y":1048,"wires":[["5e3d4a08.3c0214"]]},{"id":"5ee5dd47.60d604","type":"template","z":"19f5c9d9.3b2b86","name":"","field":"payload.content","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"jejeje sorry 🤭, estamos nerviosos 😳","output":"str","x":622,"y":1045,"wires":[["5e3d4a08.3c0214"]]},{"id":"fb8c9602.c925b8","type":"telegrambot-config","z":"","botname":"SmrtHome","usernames":"Kevin Ore","chatIds":"633820192","pollInterval":"300"},{"id":"2e504da3.a10ef2","type":"telegram bot","z":"","botname":"SmartHome ","usernames":"","chatids":"","baseapiurl":"","pollinterval":"300"},{"id":"63942e78.6aa8a","type":"ui_group","z":"","name":"Sensores","tab":"45b4033d.eb7bcc","disp":true,"width":"6","collapse":false},{"id":"d2cd9d32.aed9f","type":"ui_group","z":"","name":"Camara","tab":"f3df5938.a743e8","disp":true,"width":"6","collapse":false},{"id":"9cbdde99.3debf","type":"ui_group","z":"","name":"Nivel de Temperatura","tab":"f3df5938.a743e8","disp":true,"width":"6","collapse":false},{"id":"3c8fc55d.fa437a","type":"ui_group","z":"","name":"Gas Metano","tab":"f3df5938.a743e8","disp":true,"width":"6","collapse":false},{"id":"45b4033d.eb7bcc","type":"ui_tab","z":"","name":"Settings","icon":"dashboard","order":2},{"id":"f3df5938.a743e8","type":"ui_tab","z":"","name":"Panel Usuario","icon":"dashboard","order":1}]

Flow Info

Created 7 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • catch (x1)
  • debug (x5)
  • function (x22)
  • inject (x1)
  • switch (x3)
  • template (x5)
Other

Tags

  • IOT
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option