Gateway node labels in description

Started by wile1411, November 16, 2018, 06:12:08 PM

wile1411

Hi Felix,
I like the tip you gave on another thread
QuoteAnd as a tip:
Now use the labels of your metrics to include them in the node descriptions, that's something I use a lot in my UI to see my most relevant metrics right in the dashboard. So in your case:

Internet speed {DOWNSPEED}/{UPSPEED}

This might be more of a thing to add to the to-do list....
I was wondering if it's possible to grab the last known update time from a data node and have that available to put in the description for quick reference.
eg: Motion sensor that shows time since last motion alert.

Type: Motion Sensor
Label: Shed Motion Sensor
Description: Node 60 - Batt:{V}  LastUpdate:{M:ago}

Results in a Description: Node 60 - Batt:4.13V  LastUpdate:4d14h

Felix

#1
This is already supported, the syntax is:
{Metric:updated}

That will put the metric's last updated timestamp instead of the metric value.
This is resolved by the nodeResolveString() function in index.html

wile1411

Thanks you!
I've been trying to go through the index.html code during my lunch periods. I was getting hung up on looking at where the number was generated, and never got around to looking for the code that parses the strings that are entered into the description.

Github link to subroutine in index.html of PiGateway repository for future readers