Author Topic: Gateway node labels in description  (Read 1348 times)

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Gateway node labels in description
« on: November 16, 2018, 06:12:08 PM »
Hi Felix,
I like the tip you gave on another thread
Quote
And 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Gateway node labels in description
« Reply #1 on: November 19, 2018, 01:41:59 PM »
This is already supported, the syntax is:
Code: [Select]
{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
« Last Edit: November 20, 2018, 10:23:08 AM by Felix »

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Gateway node labels in description [Solved]
« Reply #2 on: November 19, 2018, 10:51:14 PM »
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