[Music] i'm kevin mamajek and you're watching niagara pro tips [Music] all right in the age of covet i have i've actually changed my shirt so being in the basement and i record these you know every couple weeks um i like to wear the same shirt so my colleagues have said hey you gotta go change your shirt so i changed my shirt got my hair cut had to wear the mask so i didn't want to do the bowl thing so we're all ready to go here so today i'm going to talk about how to detect comfort
and evaluate the co2 level based upon the ashrae standard that they've placed out there so what i'm going to do is kind of walk you through this cooking right so it's kind of like a cooking show where i have um i have the ingredients and then i have the finished product so i'll walk you through how i got all the components here because this is a brand new station so there's an example station out there on the tritium talk page that has this example where you can go and do the same thing so the first
thing i had to do is in the examples i had to copy the actual ashrae co2 algorithm out and paste it into this station and then the second thing was there's an example uh app that has a ui and so since i have icons that one little icon kind of can throw you for a loop so what i did is i created a template that way everything is all bundled up and all the references are correct so once i created a reference of that i went in and deployed that as a template just so i
didn't have to do that work so that's my kind of the prebaked outcome and then i'll walk you through how i created it so let's take a look at the service or at the algorithm actual algorithm so if we look at this it's you know i've got a small recording here but it's it's kind of a it's not a it's a it's not a sophisticated algorithm it's just i had to do some blocks to kind of come up with what i wanted out of this and so part of when you create an algorithm you have
to think about this result whether you want true or false you want a number i was trying to get a string out of there and that kind of worked but what i wanted was an enumeration on the back end so that the px page can change color based on what it is in that enumeration so i'll show you how i kind of trick that out so let me zoom back in here all right so first thing i do is you know again in the analytic palette um you know i if you were creating this from
scratch which you could if you wanted to follow along you can drop an algorithm in and then lay out these blocks yourselves which i highly recommend doing this actually helps understand the algorithms and the analytics so here i'm i'm showing you the already one because this could you know take a long time to wire it out so here i'm going to just drop a data source which is looking for the co2 tag so i have a haystack co2 tag and a haystack sensor tag applied to this point that i want to evaluate so it has
to have both of those tags in order for this to work so that's the first thing i did then the second thing you know i probably did this algorithm a couple times i did it the long way which was pretty funny because as i try to do these and and teach them i realize i can do them much better so i know there's many ways of doing this but i did it with this you know greater than and then i found a range switch so it will behoove you to go through and look at what's
available so you don't duplicate uh the effort so there was a range switch which was pretty nice so all i had to do is plumb in the high range so if you look at this all of these ranges i'm doing a range on normal a range on poor and a range on high and a range on critical and those are the four designators that the ashrae chart gave us so i have constants of high so zero to a thousand low and high get plumbed into the first range the second one is a thousand one to
two thousand which was the poor range then i have a 2001 to 4000 which is a high range and then i have four thousand one to two hundred thousand i think they stop at five i added two because i think somebody mentioned that it might be death i i added and maybe i should do another range but don't quote me on that so four ranges have to be evaluated and then once those four ranges are evaluated i do some um simple switches to allow me to know which one i want set right and so if
you look at the range all the range is going to do is true false one or zeros i plumb in a one or zero just to stay consistent so the ranges are true false once i get there i start to do a another switch that says all right if it is true i need it to pass a value so if it is normal i need it to send one okay if it is poor i need it to send the numeric 2 right and so you'll see a 2 here being plumbed in if it's true if
it is true for the high i need to send it a value of 3 if it is true on four or on the the last one which is critical i need to send it to four so those those map to what my enumeration will be on the other side and then what i do is i have to somehow get them all into one value so i add them all up so if if you you will never have a range uh two ranges come up true at the same time right if you look at the way
i did the numbers so when i add all these up it's really going to be if it's normal it's going to add a 1 and a 0. if it's down here it's going to add a 0 and then a 2 right depending on if they're true or not so i just add those all up and then i tried this value map block which allows me to kind of define normal high critical and you'll see i'll use that in another place and then i just plummet to the result okay so that the algorithm is done we're
ready to go so now what i'll do is again i applied a template down here so i just took the template dropped it into apps the only thing i had to do is we look at the template these wouldn't render because in the example station my algorithm for co2 was inside a comfort folder up in the algorithms so i just had to chop that out and then we were all set and again i did that for that lonely icon up there so if we look at the wire sheet now all i had to do was
put in an analytic proxy point so if you go again to the analytics palette down here under the points i can drag out an enumerated writable so i did that for the main algorithm so if we look at that i left the default which is relative to where it's at so the the point i'm going after is right here it's right on the same wire sheet so really i didn't have to go point to anything i just say look at that same level execute the algorithm and then this was actually the default puller from the
other station so i just had to select it and i chose the only polar available which was default and then i said save so now that's ready to go now the default polar you have to remember is five minutes right so if i go over there and look it's it's set at um five minutes so um just keep that in mind that when you first fire this station up and you refresh the cache you won't have any values until that polar runs so what i'm going to do is i could actually go and right click
and then say action poll and that kicks the kicks the engine there to go do the actual poll and then i could do the same for these two since they're both together they're actually you know this one is just showing you the value down here that it's coming through and this is showing you the um actual string that i set up for the facets right so if you come down here and you look at this i have a series of facets that actually give me what i want to have right so i have normal high
or normal poor high and critical based on those numbers that i pass through okay and again i did it this way so that i could actually trap that instead of doing a number i didn't want to trap um you know from one from zero to one is this right so this just allows me to do the animation a little easier in the px page okay so this is tagged this is my actual um thing it has to be in parts per million i didn't put an actual facet to say parts per minute just i'm using
parts per million so my ranges are the zero to a thousand i had to tag it so you'll see co2 and sensor i you know i'm breaking my my own rule no pun intended but you should use tag rules you shouldn't manually tag your points so i should have a rule that's looking for room studio 2. the reason why i'm doing this is if you pull this out i need to make sure you understand that this is the tags that have to be applied to that point so use a rule don't do manual tags as
i do here and i'm also alerting you to if it doesn't have the a colon a tag you don't have auto tagging turned on and it won't execute so that's just a little troubleshooting thing okay so with that then i'm ready to go with the px page and you'll see that again this is the ui this is just allowing me to change the values i can go up here and since i don't want to wait for the polar to go every five minutes i'm just going to kind of kick start them there for this recording
and you can see that they change so on the point on the wire sheet here right next to it is evaluating that 1500 and it says it's poor so i can copy this and paste it anywhere in the station it will execute and look right next to itself what that co2 level is and report back on whether it's high normal poor right so i don't have to memorize those ranges and so now once this is all done with that equation in there again cut copy and paste and you're off to the races and you don't
have to worry about setting those facets you don't have to worry about coming up with what that range is if ashrae would ever change that range i would just change it in my actual equation um or algorithm up there this again is just visualizing what's happening inside the algorithm you don't have to have any of that stuff you just need this right and so again we can make it critical go and tell it to execute the polar down here and again why i had to do it in two places is just i have that second
proxy point and so if i manually pull it i have to tell both to go if it passes through the five minute mark they both execute at the same time and you're all set so there is a way of looking at co2 evaluating it with the ashrae standard to tell me whether it is normal high poor normal poor high or critical and drop that into your station and you're up and running with that evaluation of comfort [Music] you