Graphing Temperatures with Tasker December 23, 2019

To monitor the environment you will need 3 things. First, either the envrionmental sensor or the Rugged External Temperature Sensor. Second, the Tasker application that will read that sensor and log the values. Third, the Grapher application to graph the data logged from Tasker.

INTEG resells an environmental sensor from Embedded Data Systems. The sensor itself wont work directly with the JNIOR until it is wired. They have several different models that provide different environmental metrics. Temperature and humidity have been the consistent requests. INTEG also sells a rugged external sensor that tracks just temperature.

NOTE: Only the Environmental Sensor records humidity.

Set Up

The first thing to check when setting up is the sensor module you connect to the JNIOR. In the Console Tab of the JNIOR Web Tool, commands you can use to see what sensor is connected are the extern command to tell you what modules you have connected, and the extern -r command to remove a module on your device that is no longer connected. To tell which sensor module you have connected, look at the ID of the device from the extern command. If it ends with 7E its the Humidity Sensor, if its 28 its the Rugged External Temperature sensor.

After that, you’ll want to make sure that you have the applications to graph the data logged.

You’ll want to do an update project one at a time, publishing these to the JNIOR you have the sensor connected to. After that, to get to the Grapher application, you can either type (JNIOR’s IP)/Grapher into the URL or you can select it under the tools tab of Tasker to take you to the application. There you can create the graph to monitor your Temperature. 

Once on the Grapher application page, you’ll want to go to the Grapher Configuration page to enter settings for creating a graph. To start, you can go down to the Graphs section and add a graph.

At the top, you can define the directory path of the file you want monitored, but keep in mind whatever path and file name is set here should match what you set in the Tasker application. The column values represent the different data points that can be pulled from Log that will be created in Tasker. The Date format can be set to MM-DD-YY HH:mm:ss.SSS. The file count is specified to how many files you want added. After setting this, you can configure the chart data described below that will be monitored for the graph.

Here you can create the chart name, and then set the range of the chart and also the time range being charted. Below that you can create the lines that go into the graph that are tracked. You can add their names, what the units they are measured in are called, and the color of the line. Once this is all set you’ll now want to open the Tasker application by typing in the URL (JNIOR’s IP)/tasker, or by clicking the link for it from the JNIOR Web Page in the applications section of the configure tab.

In the Tasker application, the first thing we’ll want to do is create a Logger using the Logger Tab. Once on the Logger Tab of Tasker, clicking the “add Logger” button will create an empty Logger in the Logger Tab, which you can name. This is where the file will be create that Grapher pulls the data from to graph.

Like in the picture above, you’ll want to set the log file path. The one in the example is called temps-{{date(YYMMDD)}}.csv, just like the one named in the file section in Grapher of this example. (The date.format part of the file name auto inputs the date when creating the file). The columns are defined as separate values that will act as the lines we created in the graph section of Grapher.

For how the column values work, the double squiggly brackets and comma between each value are needed to separate each value. The env_ is what you have to preface each value with in the text if you are using the environmental sensor. Otherwise you’ll use temp to preface each value for the rugged external temperature sensor. The “.fahrenheit” has to be replaced with “.celsius”, “.humidity”, or each words first letter like “.f”, “.c”, or “.h” depending on what type of value you are trying to monitor. The number surrounded by brackets represents which module is getting that value so if you only have on module you’d label every bracket with a 1. An example of the column values from Grapher would be {temp[1].fahrenheit}}, {{temp[1].celsius}}. (These values would get the temperature in Celsius and Fahrenheit from a Rugged External temperature sensor you have plugged in.)

After defining the values for the Logger in Tasker, we’ll now want to create a Task in the Task Tab of Tasker. Once in the Task Tab, we’ll select the “add Task” button. This will add an empty Task to Tasker that you can name. Once we do that, we’ll want to selcet the “add Action” button to add an action to the Task to run the Logger we just created. In the action submenu we’ll want to select the Force Log Profile action. Once its added, we’ll enter the Logger name we created earlier to the action so it’ll run that Logger every time the Task runs.

Once that is done, we’ll now add a schedule that runs every two minutes so the graph is constantly getting more data every two minutes.

Going to the schedule Tab, we’ll click the “add Schedule” button to add an empty schedule to Tasker. We’ll then select the “add Rule” button to open the rule submenu. Here we’ll set the Schedule to run every two minutes, every day, from Midnight to Midnight like shown in the picture below. We’ll also set the schedule to run the Task that activates Logger to every two minutes.

Once this is all set up, going back to the Grapher application should now give you a graph of the logged temperatures!

By | On December 23, 2019 4:36 pm | No Comments | Categorized in: , ,