1.0.7 • Published 5 months ago

@energy-mutual/data-ingester-js v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

About Energy Mutual

Energy Mutual helps owners of distributed energy assets make the most of their renewable resources. Check us out at energymutual.com

Getting Started

Prerequisites

You will need the following. Please contact Energy Mutual Support if you do not have them already. 1. Certificate files

  • private.pem.key
  • certificate.pem.crt
  • CA.pem
  1. Your clientId and topicName

Installation

  1. npm i @energy-mutual/data-ingester-js

Usage

All examples below assume the following:

  • clientId of EM123456
  • topicName of MyTopicName
  • All required key/certificate files in a certificates/ subdirectory

Creating EMDataIngester object and connecting

// Create Client
const client = new EMDataIngester(
  "EM123456",
  'MyTopicName',
  {
    key:'certificates/private.pem.key',
    cert: 'certificates/certificate.pem.crt',
    ca: 'certificates/CA.pem'
  }
);

// Connect
await client.connect()

Adding parameters to payload

  // Add powerOutput value to payload
  client.addToPayload('powerOutput', '123', new Date(), 'kW')

  // Add reservoirLevel value to payload
  client.addToPayload('reservoirLevel', 10, new Date(), 'm')

Note that adding the same attribute name to the payload will rewrite the previous value

Sending payload

  await client.sendPayload()

Note that this will clear the payload

Clearing payload

  await client.clearPayload()

Viewing payload

  console.log(client.payload)

Closing Connection (Important!)

  client.end()

Contact

Energy Mutual - info@energymutual.com

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.0

5 months ago