From 1c9c18fe8f174ac18c9953189aa04847d04e569d Mon Sep 17 00:00:00 2001 From: Bruce Conrad Date: Tue, 11 Jul 2017 08:56:05 -0600 Subject: [PATCH] add timestamp to battery reading --- krl/wovyn_router.krl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/krl/wovyn_router.krl b/krl/wovyn_router.krl index 32508aa..8e70dc2 100644 --- a/krl/wovyn_router.krl +++ b/krl/wovyn_router.krl @@ -1,6 +1,7 @@ ruleset wovyn_router { meta { - shares __testing, lastHeartbeat, lastHumidity, lastTemperature, lastPressure, reading, battery + shares __testing, lastHeartbeat, lastHumidity, lastTemperature, lastPressure, + reading, battery } global { __testing = { "queries": [ { "name": "__testing" } ], @@ -48,7 +49,8 @@ ruleset wovyn_router { pct = ent:lastHeartbeat.genericThing.healthPercent; vlt = ent:lastHeartbeat.specificThing.battery.currentVoltage; device = ent:lastHeartbeat.property.name; - {"text":"battery: " + pct + "% " + vlt + "v","username":device} + ans = "battery: " + pct + "% " + vlt + "v"; + {"text":ans + " (as of " + ent:lastTimestamp + ")","username":device} } }