sammysnake
Active Member
I do server monitor type stuff as an occupation and I have recently been introduced to a monitoring service called Datadog. They have a free offering up to 5 servers, so it's easy to get started with them.
Anyways I had the idea to use their service to create some dashboards to monitor pH / temperature / humidity of my grow room.
Data collection is done with a Raspberry Pi + pH Sensor via USB
Live Dashboard (Only pH sensor so far)
Setting up alert notices when pH level goes to high/low:
Code that runs on RaspberryPi (Node):
Anyways I had the idea to use their service to create some dashboards to monitor pH / temperature / humidity of my grow room.
Data collection is done with a Raspberry Pi + pH Sensor via USB
Live Dashboard (Only pH sensor so far)
Setting up alert notices when pH level goes to high/low:
Code that runs on RaspberryPi (Node):
import dogapi from 'dogapi';
var SerialPort = require("serialport");
var port = new SerialPort("/dev/ttyUSB0", {
baudRate: 9600,
parser: SerialPort.parsers.readline('\r')
});
var options = {
api_key: "",
app_key: "",
};
dogapi.initialize(options);
port.on('open', () => {
// Enable continous mode
port.write('C,1', function(err) {
if (err) {
return console.log('Error on write: ', err.message);
}
console.log('message written');
});
});
let count = 0;
port.on('data', function (data) {
count++;
console.log('Data: ' + data);
// Reduce reporting rate, only report every 10th time
if (count < 60) {
return;
}
dogapi.metric.send("sensor.pH", parseFloat(data), {
host: 'pi',
tags: ['indoor', 'pH']
},
(err, results) => {
console.dir(results);
});
count = 0;
});