====== MAXTIME() Function ====== The MAXTIME() function can be used in a variety of ways to get the time of the maximum value of a variable. Usage: ''MAXTIME(variable, options, [days],[threshold],[format])'' - see below for description. variable - string in 'quotes' with ASCII variable name options - see below for range options days - Optional number of days to offset backwards in time threshold - Optional max value to ignore values above format - optional time formatting string in 'quotes' - see here [[https://www.php.net/manual/en/function.strftime.php]] ===== Generic Variables (per device type) ===== ''MAXTIME('INC1_AE', 5)'' Get the time of the maximum value for the selected period ===== Device - Specific Variables ===== For device specific variables use a . to separate the device name: ''MAXTIME('My Device.My Value',1)'' Get the time of maximum value of the variable for the current day. ===== Option Parameters ===== The second parameter, [options] is a number and can be any of the following |0 | latest value (Default) | |1 | DAY - Maximum value for current day | |2 | WEEK - Maximum value for current week | |3 | MONTH - Maximum value for current month | |4 | YEAR - Maximum value for current year | |5 | PERIOD - Maximum value for the selected range | |6 | SLICE - Maximum value for the slice in the range (i.e. in a graph segment) | The third optional parameter lets you shift the range by a specific amount of days - i.e. a value of 7 will calculate the maximum value for the selected period 1 week ago. ===== Example ===== Get the hour an minute of maximum inverter generation for a day: ''MAXTIME('inverter1_Total_Active',1,0,0,'%H:%M')''