Skip to content
terc edited this page Feb 5, 2018 · 6 revisions

t-motion-detector

A NodeJS Motion detector, initially aimed for Raspberry Pi. The Motion Detectors detect changes in the environment and the Notifiers receive the Motion Detectors's event changes.
Author: Tiago Cardoso


Code snippet:

var n = new ent.BaseNotifier();
var e = new ent.Environment();
var m = new ent.MotionDetector();
n.on('pushedNotification', function(message, text){
    console.log("A new notification has arrived!", message, text);
})
var result = false;
main.Start({
  environment: e,
  initialNotifier: n,
  initialMotionDetector: m
});

e.AddChange(10);

To be notified via Slack first update your hook URL file (I'm working on overriding this in a local.js file so that this does not have to be done on the config.js of the package itself (I know it is uglyish for now):

profiles = {
  default: {
	slack: {
	  hook: 'https://hooks.slack.com/services/<Your_Slack_URL_Should_Go_Here>'
	}
  },
}

exports.profiles = profiles;
exports.default = profiles.default;
Clone this wiki locally