How to distinguish between current transformers in the emonhub configuration file?

Hi,

How do I set up emonhub.conf so that I know which data comes from which transformer ?

From the EmonHubSmapReporter i can see that:

# databuffer is of format:
# [[timestamp, nodeid, datavalues][timestamp, nodeid, datavalues]]
# [[1399980731, 10, 150, 250 ...]]

It converts the databuffer to json:

data_string = json.dumps(databuffer, separators=(',', ':'))

Which results in: 

# Prepare URL string of the form
# http://domain.tld/emoncms/input/bulk.json?apikey=12345
# &data=[[0,10,82,23],[5,10,82,23],[10,10,82,23]]
# &sentat=15' (requires emoncms >= 8.0)

So, the first field is the timestamp, second field is the ID of the node (current transformer), and the rest of the fields are data values for the node.

I would like to attach some additional information for each node such as: unit of measure, special URL for the data to go and so on. 

So of I am recieving data from node id: 10, it has to go to a specific URL that i set in the config file.

I was thinking about adding another section to the configuration file like this:

#######################################################################
#######################          SENSORS          #####################
#######################################################################
[sensors]
[sensor1]

    nodeID = 10
    sourceName = "Name"
    unit = "kW"
    path = "/5DPB/elt-B/ABC/true_power"
    uuid = "87c395ee-5ee3-5713-8928-c29e32937877"
    timezone = "Europe/Copenhagen"
    readingType = "double"

And retieving the values from there.

But how do I know which current transformer attached to the emonTx has which ID?

Thanks

Robert Wall's picture

Re: How to distinguish between current transformers in the emonhub configuration file?

If you look at the sketch in your emonTx, the data values are sent in the order that they appear in the PayloadTX structure. Normally, for the default sketch, the order is the powers (CT1 - CT4), Vrms, then the temperature(s).

xzuttz's picture

Re: How to distinguish between current transformers in the emonhub configuration file?

Thanks :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.