Created
January 15, 2021 14:02
-
-
Save janit/08db57c88017a8937ba3bfc107f55aa5 to your computer and use it in GitHub Desktop.
Powercycle UniFi PoE Port via adi using node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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