Please note: This project is not actively maintained, it may no longer work and may depend on out of date dependencies.
Kauri Energy Monitor is a cloud-based system for monitoring your off-grid energy systems.
Kauri Bridge communicates with your sensor devices, collects data and sends it to your Kauri server.
Read more about the development of Kauri in "Monitoring an off-grid system with Kauri"
- Supports communication with several sensor devices on a single bridge.
- Can handle failed network connections - keeps readings until the Kauri server is reachable.
- Highly configurable, e.g.: can configure how often data is read and sent to Kauri.
- Sends data to Kauri in batches to lower server and network load.
- Can be expanded to work with additional sensor devices.
- Can run on most hardware - you just need to be able to run NodeJS.
All supported devices and how to implement your own device.
-
Install Node on your system.
-
From the project's folder, run
npm install
to install dependencies. -
Run
node start.js [relative path to config file]
to start the bridge.
PM2 is a process manager for Node. When used with the bridge it restart the process if the bridge crashes, starts the bridge at boot, and lets you view the logs.
-
Install PM2 with
npm install -g pm2
. -
Run
pm2 start start.js --name="Bridge" -- [config file]
. -
Run
pm2 startup
to start PM2 automatically at boot. -
Run
pm2 save
to save your current PM2 processes.
The configuration file is a JSON file. Below is a list of top level values that must be provided. For an example of a configuration file, see examples/config.json
.
The name of the configuration file. To be displayed in diagnostic messages. e.g.: "Bridge PC"
This object defines all configuration needed to upload readings to the API.
It requires the following options:
-
apiEndpoint
(string)This is the full path the API endpoint, including the protocol, port, etc.
-
bridgeId
(string)The bridge ID is required to identify readings from this bridge. You can get this by creating a bridge in Kauri Energy Monitor under "Configuration" -> "Data Collection".
-
bridgeSecret
(string)The bridge secret is like the password for your bridge. This ensures only your can upload readings for your building! This is provided in Kauri Energy Monitor under "Configuration" -> "Data Collection".
The device poll frequency is how often all devices will be checked for data in seconds. This should be something divisible by 60 (for consistency between bridge clients), otherwise 10 will be used.
The data send frequency is how often readings will be pushed to the API as a batch. This should be something divisible by 60 (for consistency between bridge clients), otherwise 10 will be used.
A device is not a concept known to the API. A device is a single physical device which will contain multiple sensors.
A device is an object which consists of:
-
name
(string)Used for diagnostic output purposes.
-
type
(string)Used to determine which driver to use.
-
sensors
(array of sensor objects as defined below)
A device contains several sensors. Sensors must be configured in Kauri Energy Monitor under "Configuration" -> "Data Collection" -> [your bridge] -> "Sensors". Here, the sensor ID is available.
Each sensor is an object consisting of:
-
id
(string)The API ID for the sensor (sensor setup in API prior to use).
-
Additional fields will be required by the device to identify the sensor. Please see the read me for the device you are using for these options.
There are two approaches you can use for testing. Fake sensors (see devices for information) can be configured to send fake data to the API. This is useful if you need to test the API's live data processing.
Alternatively, you can use the fake bridge to bulk send data from a fake sensor to the API. This works great if you need a way to back populate a large amount of data into the API. See testing for more information about this.