ItemHistory

items. ItemHistory

Class representing the historic state of an openHAB Item

Methods

averageSince(timestamp, serviceIdopt) → {Number|null}

Source:

Gets the average value of the state of a given Item since a certain point in time.

Example
var item = items.getItem("KitchenDimmer");
console.log("KitchenDimmer averageSince", item.history.averageSince(yesterday));
Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
Number | null

changedSince(timestamp, serviceIdopt) → {boolean}

Source:

Checks if the state of a given item has changed since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
boolean

deltaSince(timestamp, serviceIdopt) → {Number|null}

Source:

Gets the difference value of the state of a given item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
Number | null

deviationSince(timestamp, serviceIdopt) → {Number|null}

Source:

Gets the standard deviation of the state of the given Item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
Number | null

evolutionRate(timestamp, serviceIdopt) → {Number|null}

Source:

Gets the evolution rate of the state of a given Item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
Number | null

historicState(timestamp, serviceIdopt) → {*}

Source:

Retrieves the historic item state for a given item at a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*

lastUpdate(serviceIdopt) → {ZonedDateTime|null}

Source:

Query the last update time of a given item.

Parameters:
Name Type Attributes Description
serviceId string <optional>

optional persistance service ID

Returns:
Type
ZonedDateTime | null

maximumSince(timestamp, serviceIdopt) → {*}

Source:

Gets the historic item with the maximum value of the state of a given item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*

minimumSince(timestamp, serviceIdopt) → {*}

Source:

Gets the historic item with the minimum value of the state of a given item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*

persist(serviceIdopt)

Source:

Persists the state of a given item

Parameters:
Name Type Attributes Description
serviceId string <optional>

optional persistance service ID

previousState(skipEqualopt, serviceIdopt) → {*}

Source:

Returns the previous state of a given item.

Parameters:
Name Type Attributes Description
skipEqual boolean <optional>

optional, if true, skips equal state values and searches the first state not equal the current state

serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*

sumSince(timestamp, serviceIdopt) → {Number|null}

Source:

Gets the sum of the state of a given item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
Number | null

updatedSince(timestamp, serviceIdopt) → {boolean}

Source:

Checks if the state of a given item has been updated since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:
Type
boolean

varianceSince(timestamp, serviceIdopt) → {*}

Source:

Gets the variance of the state of the given Item since a certain point in time.

Parameters:
Name Type Attributes Description
timestamp Date | ZoneDateTime
serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*

latestState(serviceIdopt) → {*}

Source:

Retrieves the historic item state for a given item at the current point in time.

Parameters:
Name Type Attributes Description
serviceId string <optional>

optional persistance service ID

Returns:

state

Type
*