When setting the file name of a Logger, you are not only choosing where the file is created but naming it as well. Firstly, you are declaring where in the directory of the JNIOR you are saving the log file you wish to create.
Which is why most of the directory in the example above is /flash/tasker/logging/. Secondly, you are then naming the file that will be created at the end of the directory address.
In the example above, the last part of the directory is ExampleLog{{date("MMDDYY")}}
.csv, because thats what we want the name and filetype of the log file to be.
Looking at the file name of the Logger above, you'll notice that it has {{date("MMDDYY")}}
in it. This part of the file name adds the current date to the filename when it gets logged.
Since the date is a dynamic value, once a new day occurs the name won't be the same when logging from a different day. So instead of constantly overwritting itself, you'll have a new log at the start of each day.
Here is how the {{date("MMDDYY")}}
value works. Starting with the {{}}
, those curly braces are for defining values that will be logged.
Next is the date() which is used to call a function that will grab the current date. It then uses the "MMDDYY" inside the date() function as parameters to define how the date should be formatted, which in this case is month, day, year.
The "" around MMDDYY are to define those letters as a string, which is the required parameters for the date() function.
Now Looking at the schema of the Logger above, you'll see the values {{env[1].f}}
,{{TEMP_SENSOR_FAR}}
,{{$$Farhenheit1}}
. Each value is using a different way to log the temperature from the Environmental Sensor. To explain what these values do, lets start with {{env[1].f}}
.
As you can see in the value syntax section of this help document, the syntax to reference the Environmental Sensor for its farhenheit is env[1].f
. Adding this value with {{}}
around it to the schema of the logger will log farhenheit recorded from the Environmental Sensor,
replacing the # with either 1 or 2 letting you choose which sensor you pull the data from if you have 2 connected to the JNIOR at the same time. The next value {{TEMP_SENSOR_FAR}}
isn't listed in the Value Syntax of this help document like {{env[1].f}}
is.
This is because it is a signal created in the Signal tab that can be used as a value for logging.
Similarly, {{$$Farhenheit1}}
isn't listed either because it is set elsewhere like {{TEMP_SENSOR_FAR}}
.
{{$$Farhenheit1}}
is prefixed with two $$ because it is a global variable. Global variables are defined in the Task Tab by adding a Set Variable action to a Task and naming the variable with $$ in front of it.
Whatever is defined in the Set Variable action for the global variable will be its value. It can be set to a value like env[1].f
or to a Signal like TEMP_SENSOR_FAR
was.
So since {{env[1].f}}
,{{TEMP_SENSOR_FAR}}
, and {{$$Farhenheit1}}
are in the schema, they will all log the value of the Environmental Sensor in Farhenheit.
Additionally, if you are logging through the Log Entry action in the Task Tab you can use these values as shown in the schema of a Logger to log the values as well.