Custom Metrics

Started by Drake.Lewis, August 13, 2020, 12:41:21 PM

Drake.Lewis

Hey everyone,

I've finally got my nodes and gateway moteino working as wanted and sending the date in the correct format
[NodeID] Temp:xx Ft:xx


This is displaying in the serial/log of the gateway exactly as shown....but I'm having issues getting the gateway to do anything with this data. It is logging that it received the NodeID in the db, but the other data points are going into the unknown database

How do i setup a custom metrics file to handle this data? I've tried making one, but when I put it into the metrics folder it does not appear in the drop down menu when adding a new node to the gateway. I'm using a RPI 4 if that makes any difference.

Thank you

Felix

FWIW there are no metrics called Ft and Temp, thats why it doesnt know what to do with those tokens.

To log anything, it will have to be logged as numeric.
Something can come in as alphanumeric, but it will have to be interpreted as numeric to be logged. For instance MOTION is just ... that. We log it as 1, when there is a 1, it means MOTION occured at that time, simple.

To create a new metric, follow the example file, create a new file for your new metric. You can also look at other default metrics, like the weather node metrics definitions.

Drake.Lewis

Okay understood, so if I'm transmitting a depth and a temperature I can basically take those two from the weather node and sonar more metrics?
I guess I misunderstood how metrics worked, I'll play with it some tonight and see what I can do.
Thank you

Drake.Lewis

Felix,

I was able to figure it out once I realized what I was looking at.

On a secondary note what are the limitations of the units portion, for example the degree symbol works, but using " ' " a foot symbol does not. Is there a way to use the symbol for feet or am I stuck with using "ft" as my unit?

sparky

Quote from: Drake.Lewis on August 13, 2020, 10:49:17 PM
Felix,

On a secondary note what are the limitations of the units portion, for example the degree symbol works, but using " ' " a foot symbol does not. Is there a way to use the symbol for feet or am I stuck with using "ft" as my unit?

Try this;

unit:'&#39'

Drake.Lewis

I'll give that a shot when I get home this evening!
Thanks Sparky