From c1b0a0fa2fca2715603228a21379e8bc2df96bed Mon Sep 17 00:00:00 2001 From: jwaes <50528773+jwaes@users.noreply.github.com> Date: Sun, 9 Feb 2020 17:40:02 +0100 Subject: [PATCH] additional example for non default persistence service For me it was confusing how to pass on the serviceId into methods that already had an argument. An extra example is always good. Signed-off-by: jaco --- configuration/persistence.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration/persistence.md b/configuration/persistence.md index 9daf4165ea..c6dd0f1b81 100644 --- a/configuration/persistence.md +++ b/configuration/persistence.md @@ -193,6 +193,8 @@ You may specify a different persistence service by appending a String as an opti **Example** To persist an Item called `Lights` in an rrd4j database, you would enter the following: `Lights.persist("rrd4j")` +To get the average temperature over the last 5 minues from the Item called `Temperature` in the influxdb persistence service, you would use: +`Temperature.averageSince(now.minusMinutes(5,"influxdb"))` The most useful methods of the HistoricItem object returned by some queries, are `.state` and `.getTimestamp`