Skip to content

Instantly share code, notes, and snippets.

@janit
Created January 15, 2021 14:02
Show Gist options
  • Save janit/08db57c88017a8937ba3bfc107f55aa5 to your computer and use it in GitHub Desktop.
Save janit/08db57c88017a8937ba3bfc107f55aa5 to your computer and use it in GitHub Desktop.
Powercycle UniFi PoE Port via adi using node.js
// https://www.npmjs.com/package/node-unifi
var unifi = require('node-unifi');
var controller = new unifi.Controller("CONTROLLER_IP_HERE", 8443);
// LOGIN
controller.login("YOUR_USER_HERE", "YOUR_PASSWORD_HERE", function(err) {
if(err) {
console.log('ERROR: ' + err);
return;
}
controller.powerCycleSwitchPort('default','18:e8:29:29:03:87','1', function(err, sites){
console.log('Port 1 restarted');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment