Table of Contents

LASTCHANGE() Function

The LASTCHANGE() function can be used to get the last time a variable was changed - it returns a human readable time.

Usage:

LASTCHANGE(variable, options, val)

variable - the variable name to check

options - see below

val - optional - the value you wish to check for

Generic Variables (per device type)

LASTCHANGE('genset_on',1)

Get the last time that the genset_on variable was changed today

LASTCHANGE('inverter_state',1,3)

Get the last time that the inverter_state variable was equal to 3 or 0

Device - Specific Variables

For device specific variables use a . to separate the device name:

LASTCHANGE('My Device.My Value',1)

Option Parameters

The second parameter, [options] is a number and can be any of the following

0 Returns No Change
1 DAY - Last time the variable changed during the day
2 WEEK - Last time the variable changed during the week
3 MONTH - Last time the variable changed during the month
4 YEAR - Last time the variable changed during the current year
5 PERIOD - Last time the variable changed during the selected range
6 SLICE - Last time the variable changed during the slice in the range (i.e. in a graph segment)

Example

Get the last time the variable changed this week

LASTCHANGE('delta0_kwh',1)

Possible return value: Tuesday, May 8, 2017 14:58