Smick_all_001_007

All nodes 001-007

[{"id":"35add6f9.6f79aa","type":"tab","label":"Smick_001_console"},{"id":"5ce9b4ba.37af7c","type":"tab","label":"Smick_002_LED_digital"},{"id":"e11a21a.8f4d4e","type":"tab","label":"Smick_003_LED_PWM"},{"id":"43b92460.43099c","type":"tab","label":"Smick_004_button"},{"id":"1603a5ba.b22cfa","type":"tab","label":"Smick_005_PIR"},{"id":"c50576d5.b7af18","type":"tab","label":"Smick_006_analog_in"},{"id":"d86c452a.8b5f88","type":"tab","label":"Smick_007_Soil_Moisture"},{"id":"4a6f853.f367a7c","type":"tab","label":"Flow 2"},{"id":"af63b5c1.460d38","type":"subflow","name":"Subflow 1","info":"","in":[{"x":100,"y":120,"wires":[]}],"out":[{"x":160,"y":30,"wires":[{"id":"af63b5c1.460d38","port":0}]},{"x":215,"y":30,"wires":[]},{"x":270,"y":30,"wires":[]}]},{"id":"5fee3e12.eff6a","type":"mqtt-broker","z":"","broker":"ffacraspberry.ddns.net","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":"true","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"true","birthPayload":""},{"id":"362fd24a.bb08ee","type":"ui_group","z":"","name":"Default","tab":"","disp":true,"width":"6"},{"id":"1bd261b.245d39e","type":"ui_group","z":"","name":"MYGROUP","tab":"","disp":true,"width":"6"},{"id":"ee6bce96.bc967","type":"ui_group","z":"","name":"RGB LED","tab":"","disp":true,"width":"6"},{"id":"2e07ed06.5645a2","type":"ui_base","name":"Smick","theme":"theme-light"},{"id":"5a019b4.bb4ac64","type":"ui_group","z":"","name":"Default","tab":"","disp":true,"width":"6"},{"id":"2b829d41.9896e2","type":"mqtt-broker","z":"","broker":"io.adafruit.com","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"740a9861.8dce58","type":"ui_tab","z":"","name":"Console","icon":"dashboard","order":1},{"id":"5e36b7c5.bef018","type":"ui_group","z":"","name":"LED","tab":"9f185bbc.98cc78","order":1,"disp":true,"width":"6"},{"id":"3d9d3a1b.1d4626","type":"ui_group","z":"","name":"Console","tab":"740a9861.8dce58","order":1,"disp":true,"width":"6"},{"id":"96729c5e.264ec","type":"ui_group","z":"","name":"Button","tab":"ad0a83de.40b3a","order":1,"disp":false,"width":"6"},{"id":"601d1e1b.43926","type":"ui_link","z":"","name":"web link","link":"http://smartbrick.altervista.org/","icon":"open_in_browser","target":"newtab","order":1},{"id":"eb3e99e0.ccd778","type":"twitter-credentials","z":"","screen_name":"@infosmick"},{"id":"9f185bbc.98cc78","type":"ui_tab","z":"","name":"LED","icon":"dashboard","order":2},{"id":"ad0a83de.40b3a","type":"ui_tab","z":"","name":"Button","icon":"dashboard","order":3},{"id":"7482d054.817ee","type":"ui_tab","z":"","name":"PIR alarm","icon":"dashboard","order":4},{"id":"43f2185.a7a3fe8","type":"ui_group","z":"","name":"PIR alarm","tab":"7482d054.817ee","order":1,"disp":false,"width":"6"},{"id":"b07a13ec.60f27","type":"ui_tab","z":"","name":"Analogic input","icon":"dashboard","order":5},{"id":"7c709b15.0385b4","type":"ui_group","z":"","name":"Analogic sensor","tab":"b07a13ec.60f27","order":1,"disp":true,"width":"6"},{"id":"d364a88e.ef3468","type":"ui_tab","z":"","name":"Soil Moisture","icon":"dashboard","order":6},{"id":"394dacb6.3739c4","type":"ui_group","z":"","name":"Soil Moisture","tab":"d364a88e.ef3468","order":1,"disp":true,"width":"6"},{"id":"a9a923ec.3a3fa","type":"ui_group","z":"","name":"Connection state","tab":"740a9861.8dce58","order":2,"disp":true,"width":"6"},{"id":"e192fa90.cfab68","type":"ui_switch","z":"5ce9b4ba.37af7c","name":"","label":"Off/On","group":"5e36b7c5.bef018","order":1,"width":0,"height":0,"passthru":false,"topic":"","style":"","onvalue":"d8=0","onvalueType":"str","onicon":"","oncolor":"","offvalue":"d8=1","offvalueType":"str","officon":"","offcolor":"","x":150,"y":260,"wires":[["76792d1c.717924"]]},{"id":"19c12462.66b3bc","type":"mqtt out","z":"35add6f9.6f79aa","name":"smick command","topic":"borot/feeds/I3300460880","qos":"0","retain":"true","broker":"2b829d41.9896e2","x":960,"y":260,"wires":[]},{"id":"c4845dca.f1ada","type":"debug","z":"35add6f9.6f79aa","name":"debug command","active":true,"console":"false","complete":"payload","x":960,"y":200,"wires":[]},{"id":"9d66070d.ef1148","type":"ui_text_input","z":"35add6f9.6f79aa","name":"","label":"command","group":"3d9d3a1b.1d4626","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","x":580,"y":260,"wires":[["19c12462.66b3bc","c4845dca.f1ada"]]},{"id":"189e33a8.68461c","type":"ui_text","z":"35add6f9.6f79aa","group":"3d9d3a1b.1d4626","order":2,"width":"0","height":"0","name":"","label":"response/event","format":"{{msg.payload}}","layout":"col-center","x":960,"y":540,"wires":[]},{"id":"b2782229.91ed3","type":"mqtt in","z":"35add6f9.6f79aa","name":"smick response/event","topic":"borot/feeds/O3300460880","qos":"0","broker":"2b829d41.9896e2","x":200,"y":540,"wires":[["189e33a8.68461c","e25d39ab.fd0ba8","290027bd.4e4828","ef58ae73.272f"]]},{"id":"d00f3010.4b85b","type":"link in","z":"35add6f9.6f79aa","name":"command","links":["5f462c.328339d4","76792d1c.717924","82283593.256f98","82435511.10dbd8","b844a46a.517bf8","d025d81e.e6dcd8","411cecf.b196714"],"x":275,"y":260,"wires":[["9d66070d.ef1148"]]},{"id":"76792d1c.717924","type":"link out","z":"5ce9b4ba.37af7c","name":"command","links":["d00f3010.4b85b"],"x":375,"y":260,"wires":[]},{"id":"e25d39ab.fd0ba8","type":"debug","z":"35add6f9.6f79aa","name":"debug event","active":true,"console":"false","complete":"payload","x":950,"y":480,"wires":[]},{"id":"95bc9b60.213bc8","type":"ui_slider","z":"e11a21a.8f4d4e","name":"","label":"slider","group":"5e36b7c5.bef018","order":2,"width":0,"height":0,"passthru":true,"topic":"","min":"0","max":"10","step":"1","x":110,"y":260,"wires":[["25fe4efd.213742"]]},{"id":"d025d81e.e6dcd8","type":"link out","z":"e11a21a.8f4d4e","name":"command","links":["d00f3010.4b85b"],"x":675,"y":260,"wires":[]},{"id":"c40efbbf.d8b2c8","type":"function","z":"e11a21a.8f4d4e","name":"D8=n","func":"msg.payload=\"d8=\"+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":260,"wires":[["d025d81e.e6dcd8"]]},{"id":"25fe4efd.213742","type":"range","z":"e11a21a.8f4d4e","minin":"0","maxin":"10","minout":"1023","maxout":"0","action":"scale","round":true,"name":"0..1023","x":320,"y":260,"wires":[["c40efbbf.d8b2c8"]]},{"id":"b844a46a.517bf8","type":"link out","z":"43b92460.43099c","name":"command","links":["d00f3010.4b85b"],"x":995,"y":280,"wires":[]},{"id":"ca352d98.ec7ee","type":"trigger","z":"43b92460.43099c","op1":"d8=0","op2":"d8=1","op1type":"str","op2type":"str","duration":"3","extend":false,"units":"s","reset":"","name":"led on 5sec","x":610,"y":280,"wires":[["b844a46a.517bf8"]]},{"id":"693188c.3068078","type":"function","z":"43b92460.43099c","name":"setup","func":"\nmsg.payload=\"click==d3=0\";\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":220,"wires":[["7ca22f45.002db"]]},{"id":"73ec4db8.253c34","type":"ui_gauge","z":"43b92460.43099c","name":"Button","group":"96729c5e.264ec","order":2,"width":0,"height":0,"gtype":"donut","title":"","label":"click","format":"{{value}}","min":0,"max":"1","colors":["#00b500","#e6e600","#ca3838"],"x":810,"y":420,"wires":[]},{"id":"21501a44.0f51f6","type":"ui_chart","z":"43b92460.43099c","name":"click","group":"96729c5e.264ec","order":3,"width":0,"height":0,"label":"","chartType":"line","legend":"false","xformat":"%H:%M:%S","interpolate":"step-after","nodata":"push switch","ymin":"0","ymax":"1","removeOlder":"10","removeOlderUnit":"60","x":810,"y":480,"wires":[[],[]]},{"id":"845f1095.1313a","type":"trigger","z":"43b92460.43099c","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"3","extend":true,"units":"s","reset":"","name":"","x":580,"y":440,"wires":[["73ec4db8.253c34","21501a44.0f51f6"]]},{"id":"774179d7.7c4aa8","type":"comment","z":"43b92460.43099c","name":"actions on actuators","info":"","x":610,"y":140,"wires":[]},{"id":"fe6222d2.fd27d","type":"comment","z":"43b92460.43099c","name":"actions on dashboard","info":"","x":620,"y":380,"wires":[]},{"id":"a62e314.68d61d","type":"e-mail","z":"43b92460.43099c","server":"smtp.gmail.com","port":"465","name":"[email protected]","dname":"mail","x":790,"y":560,"wires":[]},{"id":"431e8a2a.fb3594","type":"twitter out","z":"43b92460.43099c","twitter":"eb3e99e0.ccd778","name":"tweet","x":790,"y":640,"wires":[]},{"id":"2f98cc74.3b1624","type":"comment","z":"43b92460.43099c","name":"actions on social","info":"","x":600,"y":540,"wires":[]},{"id":"519e2505.fb4bec","type":"function","z":"43b92460.43099c","name":"alarm msg","func":"function timeDate(tz) {\n    var d = new Date(Date.now()+tz*3600000);\n\n    return  d.getUTCHours() + \":\" +\n            d.getUTCMinutes() + \":\" +\n            d.getUTCSeconds() + \" \" +\n            d.getUTCDate()\t+\"/\" +\n            (d.getUTCMonth()+1) + \"/\" +\n            d.getUTCFullYear();\n}\n\nmsg.payload=\"alarm from Smick at \" +\n            timeDate(1);\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":600,"wires":[["e4cf3287.65c7a"]]},{"id":"611d37b9.54d4f8","type":"comment","z":"e11a21a.8f4d4e","name":"analogic output (PWM)","info":"","x":160,"y":160,"wires":[]},{"id":"bf91673.1e8b498","type":"comment","z":"5ce9b4ba.37af7c","name":"digital output","info":"","x":150,"y":160,"wires":[]},{"id":"bf85c3a8.c0ddb","type":"comment","z":"43b92460.43099c","name":"digital input","info":"","x":250,"y":160,"wires":[]},{"id":"d03c930f.15d4a","type":"comment","z":"43b92460.43099c","name":"Description","info":"Questo flusso mostra come configurare smick per generare un evento CLICK ogni volta che si preme il puslante collegato.\nLa configurazione dell'evento è eseguita all'accensione di smick che genera l'evento CONN. \nQuando si preme il pulsante smick genera l'evento CLICK che viene riconosciuto per compiere tre attività:\n- azione su smick\n- notifica su cruscotto\n- invio messaggio di allarme su e-mail e twitter.\n\n\nThis flow shows how to configure Smick to generate a CLICK event each time you press the button switch connected.\nThe event configuration is performed at power of Smick generating the event CONN. \nWhen you press the button generates Smick the CLICK event that is recognized to accomplish three tasks:\n- Action on Smick\n- Notification on the dashboard\n- Send an alarm message on e-mail and twitter.\n","x":150,"y":40,"wires":[]},{"id":"3593bc93.78e1a4","type":"comment","z":"43b92460.43099c","name":"Licence & History","info":"Package : Smick v.1\nModule  : LED - digital output\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis","x":320,"y":40,"wires":[]},{"id":"690addf8.a76594","type":"comment","z":"43b92460.43099c","name":"BOM","info":"Bill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 LED connected to smick \n    1 micro button switch\n\nHW Connections:\n\n    Device  pin     Smick pin\n    LED     +       3.3V\n    LED     -       D8\n    Switch  1       D3\n    Switch  2       GND\n\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n    E-mail\n    Twitter\n","x":470,"y":40,"wires":[]},{"id":"5f462c.328339d4","type":"link out","z":"1603a5ba.b22cfa","name":"command","links":["d00f3010.4b85b"],"x":875,"y":380,"wires":[]},{"id":"df06890c.3e3848","type":"trigger","z":"1603a5ba.b22cfa","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":true,"units":"s","reset":"","name":"","x":320,"y":520,"wires":[["114400fe.b4db3f","e083b16d.b0cc4","7cd8f38f.bccb2c"]]},{"id":"b84f0c59.2bd47","type":"comment","z":"1603a5ba.b22cfa","name":"actions on actuators","info":"","x":510,"y":320,"wires":[]},{"id":"b33eb37e.0bea9","type":"comment","z":"1603a5ba.b22cfa","name":"actions on dashboard","info":"","x":780,"y":460,"wires":[]},{"id":"3c181883.eca398","type":"e-mail","z":"1603a5ba.b22cfa","server":"smtp.gmail.com","port":"465","name":"[email protected]","dname":"mail","x":730,"y":720,"wires":[]},{"id":"a5f30042.c809c","type":"twitter out","z":"1603a5ba.b22cfa","twitter":"eb3e99e0.ccd778","name":"tweet","x":730,"y":780,"wires":[]},{"id":"377a199b.519666","type":"comment","z":"1603a5ba.b22cfa","name":"actions on social","info":"","x":760,"y":660,"wires":[]},{"id":"114400fe.b4db3f","type":"function","z":"1603a5ba.b22cfa","name":"alarm msg","func":"function timeDate(tz) {\n    var d = new Date(Date.now()+tz*3600000);\n\n    return  d.getUTCHours() + \":\" +\n            d.getUTCMinutes() + \":\" +\n            d.getUTCSeconds() + \" \" +\n            d.getUTCDate()\t+\"/\" +\n            (d.getUTCMonth()+1) + \"/\" +\n            d.getUTCFullYear();\n}\n\nmsg.payload=\"motion detected in the living room at \" +\n            timeDate(1);\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":580,"wires":[["d5ab1a8b.ed5ba8","fe07f077.ee471"]]},{"id":"888f6c55.0931e","type":"comment","z":"1603a5ba.b22cfa","name":"events","info":"","x":170,"y":300,"wires":[]},{"id":"1c914744.1b3cc9","type":"comment","z":"1603a5ba.b22cfa","name":"Description","info":"Questo flusso mostra l'uso di un senore PIR.\nSi apprenderà come configurare smick per generare l'evento ALARM quando il sensore rileva un movimento.\nLa dashboard associata consente di:\n- abilitare/disabilitare il suddetto evento;\n- di visualizzare in tempo reale un allarme ricevuto;\n- di visualizzare l'ultimo allarme rilevato ed inviato su e-mail e twitter.\n\n\nThis flow shows the use of a PIR sensor.\nYou will learn how to configure Smick to generate the ALARM event when the sensor detects motion.\nThe associated dashboard allows you to:\n- Enable / disable the said event;\n- Real-time view a received alarm;\n- Displays the last alarm detected and sent to e-mail and twitter.\n","x":130,"y":60,"wires":[]},{"id":"8a9531fb.2f078","type":"comment","z":"1603a5ba.b22cfa","name":"Licence & History","info":"Package : Smick v.1\nModule  : LED - digital output\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis","x":300,"y":60,"wires":[]},{"id":"a6a3af6e.8b597","type":"comment","z":"1603a5ba.b22cfa","name":"BOM","info":"Bill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 PIR\n\nHW Connections:\n\n    Device  pin     Smick pin\n    PIR     -       GND\n    PIR     out     D2\n    PIR     +       5V\n\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n    E-mail\n    Twitter\n","x":450,"y":60,"wires":[]},{"id":"e083b16d.b0cc4","type":"ui_gauge","z":"1603a5ba.b22cfa","name":"alarm","group":"43f2185.a7a3fe8","order":2,"width":0,"height":0,"gtype":"wave","title":"living room","label":"","format":"","min":0,"max":"1","colors":["#00b500","#e6e600","#ca3838"],"x":730,"y":520,"wires":[]},{"id":"7cd8f38f.bccb2c","type":"function","z":"1603a5ba.b22cfa","name":"internal led","func":"\nmsg.payload=\"led=\" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":380,"wires":[["5f462c.328339d4"]]},{"id":"267f99af.2d3286","type":"ui_switch","z":"1603a5ba.b22cfa","name":"","label":"alarm enable","group":"43f2185.a7a3fe8","order":1,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"alarm==d2=1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"alarm==null","offvalueType":"str","officon":"","offcolor":"","x":690,"y":240,"wires":[["5f462c.328339d4"]]},{"id":"eb729a1.74e5568","type":"comment","z":"1603a5ba.b22cfa","name":"enable/disable","info":"","x":700,"y":200,"wires":[]},{"id":"d5ab1a8b.ed5ba8","type":"debug","z":"1603a5ba.b22cfa","name":"","active":true,"console":"false","complete":"payload","x":750,"y":840,"wires":[]},{"id":"fe07f077.ee471","type":"ui_text","z":"1603a5ba.b22cfa","group":"43f2185.a7a3fe8","order":3,"width":0,"height":0,"name":"alarm msg","label":"Last","format":"{{msg.payload}}","layout":"row-spread","x":750,"y":580,"wires":[]},{"id":"e4cf3287.65c7a","type":"debug","z":"43b92460.43099c","name":"","active":true,"console":"false","complete":"false","x":810,"y":720,"wires":[]},{"id":"82283593.256f98","type":"link out","z":"c50576d5.b7af18","name":"command","links":["d00f3010.4b85b"],"x":935,"y":400,"wires":[]},{"id":"b05f8481.58d868","type":"comment","z":"c50576d5.b7af18","name":"actions on actuators","info":"","x":750,"y":300,"wires":[]},{"id":"182a53b5.e0602c","type":"comment","z":"c50576d5.b7af18","name":"actions on dashboard","info":"","x":760,"y":700,"wires":[]},{"id":"7b9c1fec.633c3","type":"e-mail","z":"c50576d5.b7af18","server":"smtp.gmail.com","port":"465","name":"[email protected]","dname":"mail","x":710,"y":500,"wires":[]},{"id":"68b0bc07.f7e484","type":"twitter out","z":"c50576d5.b7af18","twitter":"eb3e99e0.ccd778","name":"tweet","x":710,"y":560,"wires":[]},{"id":"92c8a391.39b3f","type":"comment","z":"c50576d5.b7af18","name":"actions on social","info":"","x":740,"y":440,"wires":[]},{"id":"dba2835f.b5b5d","type":"function","z":"c50576d5.b7af18","name":"alarm msg","func":"function timeDate(tz) {\n    var d = new Date(Date.now()+tz*3600000);\n\n    return  d.getUTCHours() + \":\" +\n            d.getUTCMinutes() + \":\" +\n            d.getUTCSeconds() + \" \" +\n            d.getUTCDate()\t+\"/\" +\n            (d.getUTCMonth()+1) + \"/\" +\n            d.getUTCFullYear();\n}\n\nmsg.payload=msg.payload + \" level alarm at \" + timeDate(1);\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":700,"wires":[["390ea4e5.d7bf1c","38b4d5ef.66eb5a"]]},{"id":"52b00a19.992274","type":"comment","z":"c50576d5.b7af18","name":"events","info":"","x":250,"y":320,"wires":[]},{"id":"e213e6f9.afc0c8","type":"comment","z":"c50576d5.b7af18","name":"Description","info":"Questo flusso mostra l'uso di sensori analogici (Potentiometer, LDR,...).\nSi apprenderà come configurare smick per generare:\n- sequenze di misure lette dal sensore;\n- l'evento LOW quando le misure scendono al di sotto di una soglia data;\n- l'evento HIGH quando le misure superano una soglia data.\nLa dashboard associata consente di:\n- abilitare/disabilitare i suddetti eventi;\n- di visualizzare in tempo reale le misure ricevute su un indicatore (gauge);\n- di visualizzare l'ultimo allarme LOW/HIGH rilevato ed inviato su e-mail e twitter.\n\n\nThis flow shows the use of analog sensors (potentiometer, LDR, ...).\nYou will learn how to configure Smick to generate:\n- Measurement sequences read from the sensor;\n- The LOW event when measurements fall below a certain threshold;\n- The High event when measurements exceed a certain threshold.\nThe associated dashboard allows you to:\n- Enable / disable these events;\n- Measurements of real-time display on a received indicator (gauge);\n- Displays the last LOW / HIGH detected and sent to e-mail alarm and Twitter.","x":110,"y":80,"wires":[]},{"id":"d2515f8c.357ef","type":"comment","z":"c50576d5.b7af18","name":"Licence & History","info":"Package : Smick v.1\nModule  : LED - digital output\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis","x":280,"y":80,"wires":[]},{"id":"9b87b83d.556c68","type":"comment","z":"c50576d5.b7af18","name":"BOM","info":"Bill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 Pot | LDR + 10kohm resistor\n\nHW Connections:\n\n    Device  pin     Smick pin\n    Pot     left    GND\n    Pot     center  A0\n    Pot     right   3.3V\n    \n    or \n    \n    Device  pin     Smick pin    \n    LDR     1       GND\n    LDR     2       A0\n    R 10k   1       A0\n    R 10k   2       GND\n\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n    E-mail\n    Twitter\n","x":430,"y":80,"wires":[]},{"id":"cad53aa1.dde3e8","type":"ui_gauge","z":"c50576d5.b7af18","name":"analogic sensor","group":"7c709b15.0385b4","order":2,"width":0,"height":0,"gtype":"gage","title":"sensor","label":"","format":"{{value}}","min":0,"max":"1023","colors":["#00b500","#e6e600","#ca3838"],"x":740,"y":900,"wires":[]},{"id":"71f47e0a.f5777","type":"comment","z":"c50576d5.b7af18","name":"enable/disable","info":"","x":740,"y":220,"wires":[]},{"id":"390ea4e5.d7bf1c","type":"debug","z":"c50576d5.b7af18","name":"","active":true,"console":"false","complete":"payload","x":730,"y":620,"wires":[]},{"id":"38b4d5ef.66eb5a","type":"ui_text","z":"c50576d5.b7af18","group":"7c709b15.0385b4","order":3,"width":0,"height":0,"name":"alarm msg","label":"last alarm","format":"{{msg.payload}}","layout":"col-center","x":730,"y":760,"wires":[]},{"id":"ab2b777e.f734a8","type":"comment","z":"43b92460.43099c","name":"enable/disable","info":"","x":880,"y":160,"wires":[]},{"id":"7ca22f45.002db","type":"ui_switch","z":"43b92460.43099c","name":"","label":"button enable","group":"96729c5e.264ec","order":1,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"click==d3=0","onvalueType":"str","onicon":"","oncolor":"","offvalue":"click==null","offvalueType":"str","officon":"","offcolor":"","x":820,"y":220,"wires":[["b844a46a.517bf8"]]},{"id":"5d74af2b.64375","type":"ui_dropdown","z":"c50576d5.b7af18","name":"","label":"mode","group":"7c709b15.0385b4","order":1,"width":0,"height":0,"passthru":true,"options":[{"label":"disable","value":"A0==NULL","type":"str"},{"label":"enable","value":"A0@1","type":"str"},{"label":"set LOW alarm","value":"LOW==A0<340","type":"str"},{"label":"set HIGH alarm","value":"HIGH==A0>680","type":"str"}],"payload":"","topic":"","x":710,"y":360,"wires":[["82283593.256f98"]]},{"id":"da035eef.f0ae6","type":"debug","z":"c50576d5.b7af18","name":"","active":true,"console":"false","complete":"payload","x":730,"y":840,"wires":[]},{"id":"82435511.10dbd8","type":"link out","z":"d86c452a.8b5f88","name":"command","links":["d00f3010.4b85b"],"x":935,"y":360,"wires":[]},{"id":"6d497ad8.a565a4","type":"comment","z":"d86c452a.8b5f88","name":"actions on actuators","info":"","x":750,"y":260,"wires":[]},{"id":"36f877bb.ff76c8","type":"comment","z":"d86c452a.8b5f88","name":"actions on dashboard","info":"","x":780,"y":580,"wires":[]},{"id":"6dd255c3.c14c1c","type":"e-mail","z":"d86c452a.8b5f88","server":"smtp.gmail.com","port":"465","name":"[email protected]","dname":"mail","x":710,"y":460,"wires":[]},{"id":"939d133d.1e25f","type":"twitter out","z":"d86c452a.8b5f88","twitter":"eb3e99e0.ccd778","name":"tweet","x":710,"y":520,"wires":[]},{"id":"6e49feaa.a7289","type":"comment","z":"d86c452a.8b5f88","name":"actions on social","info":"","x":740,"y":400,"wires":[]},{"id":"79ade2b4.cd35cc","type":"function","z":"d86c452a.8b5f88","name":"alarm msg","func":"function timeDate(tz) {\n    var d = new Date(Date.now()+tz*3600000);\n\n    return  d.getUTCHours() + \":\" +\n            d.getUTCMinutes() + \":\" +\n            d.getUTCSeconds() + \" \" +\n            d.getUTCDate()\t+\"/\" +\n            (d.getUTCMonth()+1) + \"/\" +\n            d.getUTCFullYear();\n}\n\nmsg.payload=msg.payload + \" level alarm at \" + timeDate(1);\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":640,"wires":[["272a5e87.4356d2","c0e3f285.429a8"]]},{"id":"360231a3.319a9e","type":"comment","z":"d86c452a.8b5f88","name":"events","info":"","x":250,"y":280,"wires":[]},{"id":"2e5366e1.c42d6a","type":"comment","z":"d86c452a.8b5f88","name":"Description","info":"Questo flusso mostra l'uso del sensore analogico Soil Moisture per misurare il grado di umidità del suolo.\nSi apprenderà come configurare smick per generare:\n- sequenze di misure lette dal sensore;\n- l'evento DRY (secco) quando le misure scendono al di sotto di una soglia data;\n- l'evento WET (umido) quando le misure superano una soglia data.\nLa dashboard associata consente di:\n- abilitare/disabilitare i suddetti eventi;\n- di visualizzare in tempo reale le misure ricevute su un indicatore (gauge);\n- di visualizzare l'ultimo allarme LOW/HIGH rilevato ed inviato su e-mail e twitter.\n\n\nThis flow shows the use of analog sensors (potentiometer, LDR, ...).\nYou will learn how to configure Smick to generate:\n- Measurement sequences read from the sensor;\n- The LOW event when measurements fall below a certain threshold;\n- The High event when measurements exceed a certain threshold.\nThe associated dashboard allows you to:\n- Enable / disable these events;\n- Measurements of real-time display on a received indicator (gauge);\n- Displays the last LOW / HIGH detected and sent to e-mail alarm and Twitter.","x":110,"y":40,"wires":[]},{"id":"e20a83db.438a5","type":"comment","z":"d86c452a.8b5f88","name":"Licence & History","info":"Package : Smick v.1\nModule  : LED - digital output\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis","x":280,"y":40,"wires":[]},{"id":"6af68079.2e2fc","type":"comment","z":"d86c452a.8b5f88","name":"BOM","info":"Bill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 Pot | LDR + 10kohm resistor | Soil Moisture sensor + 10kohm resistor\n\nHW Connections:\n\n    Device  pin     Smick pin\n    Pot     left    GND\n    Pot     center  A0\n    Pot     right   3.3V\n    \n    or \n    \n    Device  pin     Smick pin    \n    LDR     1       GND\n    LDR     2       A0\n    R 10k   1       A0\n    R 10k   2       3.3V\n\n    or\n    \n    Device  pin     Smick pin    \n    SM      1       GND\n    SM      2       A0\n    R 10k   1       A0\n    R 10k   2       3.3V\n    \nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n    E-mail\n    Twitter\n","x":430,"y":40,"wires":[]},{"id":"c2460e79.0941a","type":"ui_gauge","z":"d86c452a.8b5f88","name":"soil moisture","group":"394dacb6.3739c4","order":2,"width":0,"height":0,"gtype":"gage","title":"sensor","label":"","format":"{{value}}%","min":0,"max":"100","colors":["#ff0000","#00ff00","#0000ff"],"x":790,"y":860,"wires":[]},{"id":"a87d5f44.bf3ee","type":"comment","z":"d86c452a.8b5f88","name":"enable/disable","info":"","x":740,"y":180,"wires":[]},{"id":"272a5e87.4356d2","type":"debug","z":"d86c452a.8b5f88","name":"","active":true,"console":"false","complete":"payload","x":790,"y":700,"wires":[]},{"id":"c0e3f285.429a8","type":"ui_text","z":"d86c452a.8b5f88","group":"394dacb6.3739c4","order":3,"width":0,"height":0,"name":"alarm msg","label":"last alarm","format":"{{msg.payload}}","layout":"col-center","x":790,"y":640,"wires":[]},{"id":"66aa6c62.11ec94","type":"ui_dropdown","z":"d86c452a.8b5f88","name":"","label":"mode","group":"394dacb6.3739c4","order":1,"width":0,"height":0,"passthru":true,"options":[{"label":"disable","value":"A0==NULL","type":"str"},{"label":"enable","value":"A0@1","type":"str"},{"label":"set DRY alarm","value":"DRY==A0<100","type":"str"},{"label":"set WET alarm","value":"WET==A0>500","type":"str"}],"payload":"","topic":"","x":710,"y":320,"wires":[["82435511.10dbd8"]]},{"id":"b983a1a0.63139","type":"debug","z":"d86c452a.8b5f88","name":"","active":true,"console":"false","complete":"payload","x":790,"y":800,"wires":[]},{"id":"1bdf2ee.17d20d1","type":"range","z":"d86c452a.8b5f88","minin":"0","maxin":"600","minout":"0","maxout":"100","action":"roll","round":true,"name":"%","x":550,"y":820,"wires":[["c2460e79.0941a","b983a1a0.63139"]]},{"id":"65c026c0.fda4e8","type":"ui_toast","z":"35add6f9.6f79aa","position":"bottom right","displayTime":"3","name":"conn/disc notification","x":980,"y":680,"wires":[]},{"id":"f227495f.309fd8","type":"ui_text","z":"35add6f9.6f79aa","group":"3d9d3a1b.1d4626","order":3,"width":0,"height":0,"name":"state","label":"Connection state","format":"{{msg.payload}}","layout":"col-center","x":930,"y":600,"wires":[]},{"id":"76d5ef63.be81d","type":"change","z":"35add6f9.6f79aa","name":"event to msg","rules":[{"t":"change","p":"payload","pt":"msg","from":"DISC","fromt":"str","to":"Disconnected","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"CONN","fromt":"str","to":"Connected","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":640,"wires":[["75d0abe2.e4fe04"]]},{"id":"defcf5b1.08b048","type":"switch","z":"43b92460.43099c","name":"parse","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"CONN","vt":"str"},{"t":"cont","v":"CLICK","vt":"str"}],"checkall":"false","outputs":2,"x":330,"y":440,"wires":[["693188c.3068078"],["ca352d98.ec7ee","845f1095.1313a","519e2505.fb4bec"]]},{"id":"290027bd.4e4828","type":"link out","z":"35add6f9.6f79aa","name":"response_event","links":["4a2e69f2.1bb9e8","b4d0698e.ffcdc8","c8f76d6f.f022e","e6305255.f5035"],"x":895,"y":380,"wires":[]},{"id":"b4d0698e.ffcdc8","type":"link in","z":"43b92460.43099c","name":"response_event","links":["290027bd.4e4828"],"x":195,"y":440,"wires":[["defcf5b1.08b048"]]},{"id":"c8f76d6f.f022e","type":"link in","z":"1603a5ba.b22cfa","name":"response_event","links":["290027bd.4e4828"],"x":115,"y":420,"wires":[["5c6246da.962ec8"]]},{"id":"5c6246da.962ec8","type":"switch","z":"1603a5ba.b22cfa","name":"parse","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"ALARM","vt":"str"}],"checkall":"false","outputs":1,"x":230,"y":420,"wires":[["df06890c.3e3848"]]},{"id":"4a2e69f2.1bb9e8","type":"link in","z":"c50576d5.b7af18","name":"response_event","links":["290027bd.4e4828"],"x":195,"y":700,"wires":[["187b99d0.1afeb6"]]},{"id":"187b99d0.1afeb6","type":"switch","z":"c50576d5.b7af18","name":"parse","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"HIGH|LOW","vt":"str","case":false},{"t":"else"}],"checkall":"false","outputs":2,"x":310,"y":700,"wires":[["dba2835f.b5b5d","390ea4e5.d7bf1c"],["da035eef.f0ae6","cad53aa1.dde3e8"]]},{"id":"e6305255.f5035","type":"link in","z":"d86c452a.8b5f88","name":"response_event","links":["290027bd.4e4828"],"x":175,"y":660,"wires":[["1ad78b9f.f2fe54"]]},{"id":"1ad78b9f.f2fe54","type":"switch","z":"d86c452a.8b5f88","name":"parse","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"DRY|WET","vt":"str","case":false},{"t":"else"}],"checkall":"false","outputs":2,"x":270,"y":660,"wires":[["79ade2b4.cd35cc","272a5e87.4356d2"],["1bdf2ee.17d20d1"]]},{"id":"ef58ae73.272f","type":"switch","z":"35add6f9.6f79aa","name":"parse","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"CONN|DISC","vt":"str","case":true}],"checkall":"false","outputs":1,"x":410,"y":640,"wires":[["76d5ef63.be81d"]]},{"id":"75d0abe2.e4fe04","type":"function","z":"35add6f9.6f79aa","name":"state msg","func":"function timeDate(tz) {\n    var d = new Date(Date.now()+tz*3600000);\n\n    return  d.getUTCHours() + \":\" +\n            format00(d.getUTCMinutes()) + \":\" +\n            format00(d.getUTCSeconds()) + \" \" +\n            d.getUTCDate()\t+\"/\" +\n            (d.getUTCMonth()+1) + \"/\" +\n            d.getUTCFullYear();\n}\n\nfunction format00(n) {\n    if (n<10) return \"0\"+n; else return n;\n}\n\nmsg.payload+=\" at \"+ timeDate(1);\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":640,"wires":[["f227495f.309fd8","65c026c0.fda4e8"]]},{"id":"875ab495.2be8c8","type":"mqtt in","z":"4a6f853.f367a7c","name":"Matrix","topic":"frafin/feeds/O2351743180","qos":"0","broker":"5fee3e12.eff6a","x":210,"y":460,"wires":[["c1c0b73f.ce9118"]]},{"id":"e4dcb2cf.e38cc","type":"mqtt out","z":"4a6f853.f367a7c","name":"Matrix","topic":"frafin/feeds/I2351743180","qos":"0","retain":"true","broker":"5fee3e12.eff6a","x":990,"y":240,"wires":[]},{"id":"c1c0b73f.ce9118","type":"debug","z":"4a6f853.f367a7c","name":"","active":true,"console":"false","complete":"false","x":990,"y":460,"wires":[]},{"id":"c227a035.791d2","type":"inject","z":"4a6f853.f367a7c","name":"","topic":"","payload":"MATRIX=  Smart Brick for IoT DIY <<<<<<","payloadType":"str","repeat":"","crontab":"","once":false,"x":610,"y":240,"wires":[["e4dcb2cf.e38cc","81189903.462df8"]]},{"id":"81189903.462df8","type":"debug","z":"4a6f853.f367a7c","name":"","active":true,"console":"false","complete":"false","x":1000,"y":360,"wires":[]},{"id":"64c614ca.39f28c","type":"comment","z":"4a6f853.f367a7c","name":"Retained msg","info":"Normalmente quando un client si sottoscrive su un feed, riceverà il primo msg quando ne arriverà uno nuovo.\nSe si vuole invece che un sottoscrittore riceva subito un msg (l'ultimo pubblicato) occorre pubblicare il msg come trattenuto (retained).\nIn node red per pubblicare msg retained occorre impostare l'attributo \"Retain=true\".\n\n","x":1000,"y":200,"wires":[]},{"id":"a79f05ff.d7b598","type":"comment","z":"4a6f853.f367a7c","name":"Description","info":"Smick_Matrix_2351743180\n_______________________________________________________________________________\nPackage : Smick v.1\nModule  : Matrix brick\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike 4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis\n_______________________________________________________________________________\n\nDescription\n\nQuesto flusso mostra l'uso di un brick Matrix.\nCol node inject inietto un msg che sarà visualiizato su brick Matrix.\nSi noti che il msg è pubblicato in modo \"Retained\".\n\nThis flow shows the use of a brick Matrix.\nWith node inject inject a msg that will visualiizato of brick Matrix.\nNote that the message is published in \"Retained\".\n_______________________________________________________________________________\n\nBill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Matrix Brick Wi-Fi connected to the internet\n\nHW Connections:\n\n\tNone\n\t\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n","x":210,"y":160,"wires":[]},{"id":"dc4e3932.268d58","type":"comment","z":"35add6f9.6f79aa","name":"Description","info":"Smick_001_console\n_______________________________________________________________________________\nPackage : Smick v.1\nModule  : console\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis\n_______________________________________________________________________________\n\nDescription\n\nQuesto flusso costruisce un cruscotto console per interagire con smick tramite feed mqtt.\nSi possono inviare comandi sul feed di input di smick e ricevere risposte o eventi dal feed di output di smick.\nContiene inoltre un nodo link di input per consentire ad altri flussi l'invio di comandi e un nodo link di output per smistare risposte/eventi ricevuti ad altri flussi.\nInfine i messaggi inviati e le risposte / eventi ricevuti sono elencati su debug tab mediante nodi debug.\n\n\nThis flow builds a dashboard console to interact with Smick through MQTT feed.\nYou can send commands on Smick input feed and receive answers or events from Smick output feed.\nIt also contains an input node link to allow other flows sending commands and an output node link to direct responses / events received to other streams.\nFinally sent messages and replies / received events are listed on debug tab using debug nodes.\n\n_______________________________________________________________________________\n\nBill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n\nHW Connections:\n\n    None.\n\nFlow Connections:\n\n    None\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n","x":120,"y":60,"wires":[]},{"id":"dfbe47e2.b63df8","type":"comment","z":"5ce9b4ba.37af7c","name":"Description","info":"Smick_002_LED_dgital\n_______________________________________________________________________________\nPackage : Smick v.1\nModule  : console\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis\n_______________________________________________________________________________\n\nDescription\n\nQuesto flusso costruisce un cruscotto contenente un nodo switch per accendere o spegnere il LED.\nI comandi generati sono inviati a smick tramite il flusso \"dasboard console\".\n\nThis flow builds a dashboard that contains a switch node to switch on or off the LED.\nThe generated commands are sent to Smick through \"dasboard console\" flow\".\n_______________________________________________________________________________\n\nBill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 LED connected to smick \n\nHW Connections:\n\n    Device  pin     Smick pin\n    LED     +       3.3V\n    LED     -       D8\n\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n","x":140,"y":100,"wires":[]},{"id":"c6eefcb2.8d6da","type":"comment","z":"e11a21a.8f4d4e","name":"Description","info":"Smick_002_LED_PWM\n_______________________________________________________________________________\nPackage : Smick v.1\nModule  : console\nAuthor  : Curci\nLicence : (CC) BY-NC-SA\n\nThis work is licensed under a Creative Commons \nAttribution-NonCommercial-ShareAlike \n4.0 International License.\n\nHistory\n\nDate        Author  Description\n2016.12.17  Curci   genesis\n_______________________________________________________________________________\n\nDescription\n\nQuesto flusso costruisce un cruscotto contenente un nodo slider per regolare la luminosità del LED.\nI comandi generati sono inviati a smick tramite il flusso \"dasboard console\".\n\nThis flow builds a dashboard that contains a slider node to regulate the LED brightness.\nThe generated commands are sent to Smick through \"dasboard console\" flow\".\n_______________________________________________________________________________\n\nBill Of Material\n\nHardware:\n\n    1 Human internet terminal (PC, tablet or smartphone) connected to the internet\n    1 Smick Wi-Fi connected to the internet\n    1 LED connected to smick \n\nHW Connections:\n\n    Device  pin     Smick pin\n    LED     +       3.3V\n    LED     -       D8\n\nFlow Connections:\n\n    Smick_001_console\n\nAccount:\n\n    Wi-Fi credentials\n    MQTT broker\n    FRED\n","x":120,"y":60,"wires":[]}]

Flow Info

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

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x39)
  • debug (x10)
  • function (x8)
  • inject (x1)
  • link in (x5)
  • link out (x7)
  • mqtt in (x2)
  • mqtt out (x2)
  • mqtt-broker (x2)
  • range (x2)
  • switch (x5)
  • trigger (x3)
Other
  • e-mail (x4)
  • subflow (x1)
  • tab (x8)
  • twitter out (x4)
  • twitter-credentials (x1)
  • ui_base (x1)
  • ui_chart (x1)
  • ui_dropdown (x2)
  • ui_gauge (x4)
  • ui_group (x11)
  • ui_link (x1)
  • ui_slider (x1)
  • ui_switch (x3)
  • ui_tab (x6)
  • ui_text (x5)
  • ui_text_input (x1)
  • ui_toast (x1)

Tags

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