Skip to content

Instantly share code, notes, and snippets.

@cmaneu
Last active December 21, 2021 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmaneu/b68c94f92d5b2d4f4c18913714dbfbac to your computer and use it in GitHub Desktop.
Save cmaneu/b68c94f92d5b2d4f4c18913714dbfbac to your computer and use it in GitHub Desktop.
Covid Room Ventilation Alert
{"components":[],"type":"atom-matrix","versions":"Beta","units":[{"id":"_sBXbaVo2zA4-zdV","createTime":1639864046031,"hidden":false,"type":"tvoc","name":"tvoc_1","port":"A","default":["A","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"TVOC.png"}],"hats":[],"blockly":"<variables><variable id=\"1*`vu/c`9Ft``01o8J:[\">co2value</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"59\" y=\"90\"><next><block type=\"variables_set\" id=\"PjCBqSbGR`G4kPtBK}8V\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field><value name=\"VALUE\"><block type=\"math_number\" id=\"(;Ap@Rc)A(vinA.rCIBL\"><field name=\"NUM\">300</field></block></value><next><block type=\"basic_on_loop\" id=\"Qg#{Lm4j7eMb$-zI#usq\"><statement name=\"LOOP\"><block type=\"text_print\" id=\"9#*nw4EsSL5zFGzJkwh;\"><value name=\"TEXT\"><block type=\"text_add\" id=\"L7Z/S126ZF,:~*ZGF;B.\"><value name=\"arg0\"><shadow type=\"text\" id=\"?9C$+ucI?ke~2K6ZI!;G\"><field name=\"TEXT\">IAP baseline: </field></shadow></value><value name=\"arg1\"><block type=\"tvoc_get_iaq_baseline\" id=\"Um)NL8TkqMX)h]pcJ|O%\"><field name=\"NAME\">tvoc_1</field></block></value></block></value><next><block type=\"text_print\" id=\"T_4:=OAJdH)7=E3339{E\"><value name=\"TEXT\"><block type=\"text_add\" id=\"Hh;YiptPu(rpSl[ox5}`\"><value name=\"arg0\"><shadow type=\"text\" id=\"^}3%bmCOoru}4%qB@0!w\"><field name=\"TEXT\">TVOC now</field></shadow></value><value name=\"arg1\"><block type=\"tvoc_get_tvoc\" id=\"A)mx(i6p:1hC^U+Z7^N*\"><field name=\"NAME\">tvoc_1</field></block></value></block></value><next><block type=\"text_print\" id=\")n(*.qtWsU`uV#D$$N5*\"><value name=\"TEXT\"><block type=\"text_add\" id=\"g_Q?D!jX20/EZ~/%K6SJ\"><value name=\"arg0\"><shadow type=\"text\" id=\"2g+lhDY*7)^=VEz]}jkg\"><field name=\"TEXT\">eCO2 now</field></shadow></value></block></value><next><block type=\"text_print\" id=\"5F%]?1tJ;?oV8vuEe,(J\"><value name=\"TEXT\"><block type=\"text_add\" id=\";[c8;w4kq_((j;()wtfy\"><value name=\"arg0\"><shadow type=\"text\" id=\"[^Q}.EK4p0wgV;YpTY.2\"><field name=\"TEXT\">H2 now</field></shadow></value><value name=\"arg1\"><block type=\"tvoc_get_h2\" id=\"YxI]o/giNv0$)Y37mPMI\"><field name=\"NAME\">tvoc_1</field></block></value></block></value><next><block type=\"text_print\" id=\"lpTzRuhV6W;B`@~kxfr~\"><value name=\"TEXT\"><block type=\"text_add\" id=\"h5$ua}e0cCSRs_c#Z,.h\"><value name=\"arg0\"><shadow type=\"text\" id=\"%.P%pg{UREKc+x}7lLk}\"><field name=\"TEXT\">Ethanol now</field></shadow></value><value name=\"arg1\"><block type=\"tvoc_get_ethanol\" id=\"N^t?pd(yMqSBno*x@_,K\"><field name=\"NAME\">tvoc_1</field></block></value></block></value><next><block type=\"timer_delay\" id=\"ls`d6,wpfC,Kv(a@;C_x\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"`L{aK6Y7BTyd%[[?,516\"><field name=\"NUM\">0.5</field></shadow></value><next><block type=\"variables_set\" id=\"~MOu*Ga[S$K?JvT,}M!i\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field><value name=\"VALUE\"><block type=\"tvoc_get_eco2\" id=\"^mQBKMllMVVO8Z+|WH9b\"><field name=\"NAME\">tvoc_1</field></block></value><next><block type=\"controls_if\" id=\"{IL+1ASRBTypzl=[^.CZ\"><value name=\"IF0\"><block type=\"button_ispressed\" id=\"Lgzm-rIaaa6e~}-|ZRx2\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">isPressed</field></block></value><statement name=\"DO0\"><block type=\"variables_set\" id=\"npCncQ,YeI%Vc}I3Jf#!\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field><value name=\"VALUE\"><block type=\"math_arithmetic_arr\" id=\"8+(XA9b_j!5|LCdR8OPT\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get\" id=\"12Q/y-DQS7xr_J[Q!K}c\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"os%H^GKG1)BwQ*dUiLk`\"><field name=\"NUM\">200</field></block></value></block></value><next><block type=\"controls_if\" id=\"/*(rU$J`=J+8p:^3-s}a\"><value name=\"IF0\"><block type=\"logic_compare\" id=\",!;;.YOo]1+Ox)g}xWzK\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"variables_get\" id=\"oWuXy{}/`H)^~6J#?iSX\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"`(t%:SP5^)1}Vne+FM0o\"><field name=\"NUM\">1200</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set\" id=\"o@tBk%8gcbYBp)fk93C7\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field><value name=\"VALUE\"><block type=\"math_number\" id=\"e.;2%,Of`)V{kG+lDa`e\"><field name=\"NUM\">300</field></block></value></block></statement></block></next></block></statement><next><block type=\"controls_ifelse\" id=\"qU~(^=%G;J`sMF$khAe-\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"841wHUX.QRI8l?$+FNDI\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\";Zoue*`u@oCg|66.j{v_\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"y%fm6JoMYp}A*Pyt`Njk\"><field name=\"NUM\">400</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_brightness\" id=\"b2!L8N+Hza@RLs^zL-WK\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"X9Mf%3~%$9M*+k!?^F_7\"><field name=\"NUM\" max=\"100\" step=\"1\">20</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"%S4BR2Hah*]oUer7RVQ2\"><field name=\"COLOUR\">#001dfa</field><field name=\"MATRIX\" matrix=\"#001dfa,#001dfa,#001dfa,#001dfa,#29bd00,#001dfa,#001dfa,#001dfa,#29bd00,#001dfa,#29bd00,#001dfa,#29bd00,#001dfa,#001dfa,#001dfa,#29bd00,#001dfa,#001dfa,#001dfa,#001dfa,#001dfa,#001dfa,#001dfa,#001dfa\"></field></block></next></block></statement><statement name=\"ELSE\"><block type=\"controls_ifelse\" id=\"sjRUY=nanmn?Cu^YOvKp\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"E|e[O+e_d1JAgs~R#(|a\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"@kiS8afSqgDKQZuxT$?H\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"!}Za}ERqMUz8GEOp*Tpk\"><field name=\"NUM\">600</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_brightness\" id=\"GP4w)RrDgItHN{FR7SvW\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"7PeQ(Cl#RN#{HRn(f!1i\"><field name=\"NUM\" max=\"100\" step=\"1\">20</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"amv[eqa/:F;9`MjNGjD8\"><field name=\"COLOUR\">#188802</field><field name=\"MATRIX\" matrix=\"#0091ff,#0091ff,#0091ff,#0091ff,#0091ff,#0091ff,#008bf5,#008502,#008bf5,#0091ff,#0091ff,#008502,#008502,#008502,#0091ff,#188802,#188802,#188802,#188802,#188802,#0091ff,#0091ff,#0091ff,#0091ff,#0091ff\"></field></block></next></block></statement><statement name=\"ELSE\"><block type=\"controls_ifelse\" id=\".hkUsB4Q;;;b!0x*[IxD\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"e|bQE}lgZG#6s/=fo$.3\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"(uxej%yVuPQ/aQm0aUQ)\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"lV)8oYU4_Q?W0NuhJSTp\"><field name=\"NUM\">800</field></block></value></block></value><statement name=\"DO0\"><block type=\"controls_repeat\" id=\"Q}ba#Ph@a[Al/X!`MOV9\"><field name=\"TIMES\">5</field><statement name=\"DO\"><block type=\"rgb_set_led_matrix\" id=\"[{byJLQFoHfOEC=[=U7%\"><field name=\"COLOUR\">#ff7b00</field><field name=\"MATRIX\" matrix=\"#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#ff7b00,#000000,#000000,#000000,#ff7b00,#ff7b00,#ff7b00,#000000,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a\"></field><next><block type=\"rgb_set_brightness\" id=\"9j{0~%BA#45/%m!m0@6K\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"z0(`|.X!IzbPnuL*XBVQ\"><field name=\"NUM\" max=\"100\" step=\"1\">20</field></shadow></value><next><block type=\"timer_delay\" id=\"%/m4[l2ObpXQZV#z$#~E\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"e:l[ZSCLO|W5QmGYue#u\"><field name=\"NUM\">2</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"UdH.(,4#.H8T!O1e.,%a\"><field name=\"COLOUR\">#cc5200</field><field name=\"MATRIX\" matrix=\"#000000,#000000,#000000,#000000,#000000,#000000,#000000,#ff751a,#000000,#000000,#000000,#ff751a,#ff751a,#ff751a,#000000,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a,#ff751a\"></field><next><block type=\"rgb_set_brightness\" id=\"]n!svZKEX{|rc=yg;S3z\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"D|vC5V`PgPD*TN,AIWR]\"><field name=\"NUM\" max=\"100\" step=\"1\">60</field></shadow></value><next><block type=\"timer_delay\" id=\"3g}0W`EdbsZfn6=v(N?T\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"W.yP:h;K-5BKunc}%WwW\"><field name=\"NUM\">2</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"f#:!P+7)Lc1a!i6ULZ1%\"><field name=\"COLOUR\">#c02b11</field><field name=\"MATRIX\" matrix=\"#000000,#000000,#c02b11,#000000,#000000,#000000,#c02b11,#c02b11,#c02b11,#000000,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11,#c02b11\"></field><next><block type=\"timer_delay\" id=\"/f)|aJ_1rqssDDTX=zUV\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"T%J%DRLMT`tQS*+HrR$m\"><field name=\"NUM\">2</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement><statement name=\"ELSE\"><block type=\"controls_ifelse\" id=\"4JW,HRxk|+b,k/av!$vT\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"COpwfR]J+dcqg]vxR?c.\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\")irt4J2lX/i`_-r.PPBR\"><field name=\"VAR\" id=\"1*`vu/c`9Ft``01o8J:[\">co2value</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"xqX}WT^GP=Hr~4]]1e2_\"><field name=\"NUM\">1000</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_led_matrix\" id=\"!FVvG!6s-Yma3lf!k$Cq\"><field name=\"COLOUR\">#ff0000</field><field name=\"MATRIX\" matrix=\"#ffa200,#ffa200,#ff0000,#ffa200,#ffa200,#ffa200,#e00000,#e00000,#e00000,#ffa200,#ffa200,#e00000,#e00000,#e00000,#ffa200,#ff0000,#e00000,#e00000,#e00000,#ff0000,#ffa200,#ffa200,#ffa200,#ffa200,#ffa200\"></field><next><block type=\"controls_repeat\" id=\"Yh?;htU]aP%qg2w@/N*s\"><field name=\"TIMES\">5</field><statement name=\"DO\"><block type=\"rgb_set_brightness\" id=\"BEHUmn=M;L;U|I2N8:_/\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"(UxIU_E%Zj46yW4^:iLi\"><field name=\"NUM\" max=\"100\" step=\"1\">20</field></shadow></value><next><block type=\"timer_delay\" id=\"x+dv/Xw-Kt62sQPHlyYc\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"/qIT/_8`Zuysq*Y6NYV3\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"rgb_set_brightness\" id=\"+/+H:{mljs/0yMvU!_2K\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"YEr9c*q$^Epd)$:G4Y_#\"><field name=\"NUM\" max=\"100\" step=\"1\">100</field></shadow></value><next><block type=\"timer_delay\" id=\"?Wu#1p|-{F(Y;}Z`d~pA\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"J,,$+DI.Lk-0jDj.4ts|\"><field name=\"NUM\">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_led_matrix\" id=\"}L-MPfo#{H|lmJANp2-x\"><field name=\"COLOUR\">#ff0000</field><field name=\"MATRIX\" matrix=\"#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#e00000,#e00000,#e00000,#ff0000,#ff0000,#e00000,#e00000,#e00000,#ff0000,#ff0000,#e00000,#e00000,#e00000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000\"></field><next><block type=\"controls_repeat\" id=\"OdE4Vu`EMe~NM,Am1wfS\"><field name=\"TIMES\">20</field><statement name=\"DO\"><block type=\"rgb_set_brightness\" id=\"(3?G|/dn|xjtzu^aD{U+\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"pmtLSf[jEG]]q+F,VxoG\"><field name=\"NUM\" max=\"100\" step=\"1\">20</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"o|:tWl{n2-DK=Fym.%XS\"><field name=\"COLOUR\">#ff0000</field><field name=\"MATRIX\" matrix=\"#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#e00000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000,#000000\"></field><next><block type=\"timer_delay_ms\" id=\"%T9n43BJAUKNRu8}$2|$\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"PKet6[NEo?mDn7?UI/,L\"><field name=\"NUM\">300</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"_6S#t=.L!:y4_)Yyk@]u\"><field name=\"COLOUR\">#fa0000</field><field name=\"MATRIX\" matrix=\"#000000,#000000,#000000,#000000,#000000,#000000,#fa0000,#fa0000,#fa0000,#000000,#000000,#fa0000,#000000,#fa0000,#000000,#000000,#fa0000,#fa0000,#fa0000,#000000,#000000,#000000,#000000,#000000,#000000\"></field><next><block type=\"rgb_set_brightness\" id=\"^U,r}jc4R(B)T(!m$pGz\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"I@-9CZ1{{_V~{]m0|U|/\"><field name=\"NUM\" max=\"100\" step=\"1\">50</field></shadow></value><next><block type=\"timer_delay_ms\" id=\"!IRY6aK~,0{]1e32HL7t\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"EOXmWA}YH],tlIgPomAR\"><field name=\"NUM\">300</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"sm^+Ef!cENvzAfN*hJQp\"><field name=\"COLOUR\">#ff0000</field><field name=\"MATRIX\" matrix=\"#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#000000,#000000,#000000,#ff0000,#ff0000,#000000,#ff0000,#000000,#ff0000,#ff0000,#000000,#000000,#000000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000\"></field><next><block type=\"rgb_set_brightness\" id=\"ptRu$0*W8{$qGukh,nK$\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"f/nl8zx5or85GeO$BA6m\"><field name=\"NUM\" max=\"100\" step=\"1\">30</field></shadow></value><next><block type=\"timer_delay_ms\" id=\"daBHrEOm+m~`KQqNLoMU\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"yu`z6yX{0Sc*.OwiY-tr\"><field name=\"NUM\">300</field></shadow></value><next><block type=\"rgb_set_led_matrix\" id=\"F]-95Fr?3:dLxzul}w{2\"><field name=\"COLOUR\">#fa00b7</field><field name=\"MATRIX\" matrix=\"#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#fa00b7,#fa00b7,#fa00b7,#ff0000,#ff0000,#fa00b7,#ff0000,#fa00b7,#ff0000,#ff0000,#fa00b7,#fa00b7,#fa00b7,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000,#ff0000\"></field><next><block type=\"rgb_set_brightness\" id=\"{oNEVBir0]-Efa^uK~_)\"><value name=\"BRIGHTNESS\"><shadow type=\"math_slider\" id=\"1eW;f]xb*Eji]8Qse85h\"><field name=\"NUM\" max=\"100\" step=\"1\">100</field></shadow></value><next><block type=\"timer_delay_ms\" id=\"jm~K2Uczs%#Jw*ztZ3d8\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"58`b?_,#5(e8NmJ9eu]p\"><field name=\"NUM\">300</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></statement></block></statement></block></statement></block></statement><next><block type=\"timer_delay\" id=\"UYSs8MpdtiFm$8f!;J2/\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"hF1Wi6Ppdfj$2=4q?sTD\"><field name=\"NUM\">5</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1639861323201,"name":"M5RemoteTitle","dragAndDrop":false,"resizable":false,"options":{"minWidth":1,"minHeight":1,"maxWidth":6,"maxHeight":10,"defaultWidth":2,"defaultHeight":1},"w":2,"h":1,"bgColor":"#0080FF","color":"#fff","fontsize":"M","label":"M5Remote","interval":3000,"code":"","event":"","dataSource":"none","ezdataToken":"","topic":"","type":"title","x":null,"y":null}],"modules":["rgb"],"matrix":["#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111","#111111"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment