Giter Site home page Giter Site logo

synology-diskstation's Introduction

synology-diskstation

Node module for turning on and off a Synology DiskStation. Tested with a DS214play but is expected to work with all DiskStations.

Installation

Install using npm install --save git+ssh://[email protected]/simonbs/synology-diskstation.git

Usage

Create an instance of Synology by passing the IP address and port of your DiskStation as arguments.

var synology = new Synology('192.168.1.1', 5000)

Turn on

The DiskStation can be turned on by sending a Wake on Lan request. The MAC address of the DiskStation is required in order to send a WOL request. The MAC address can be found in the DS finder iOS application and the DS finder Android application.

synology.wol('00:11:22:AA:BB:CC', function(err) {
  console.log(err)
})

Shutdown

You must be authorized with the DiskStation in order to shut it down. Pass your account name and password as arguments. On a successfull login, you'll obtain a sid, which is used to shutdown the DiskStation.

synology.login('myaccountname', 'mypassword', function(err, sid) {
  if (err) {
    console.log(err)
    return
  }
  synology.shutdown(sid, function(err) {
    console.log(err)
  })
})

Checking if the DiskStation Is On

Invoke the isOn function to check if the DiskStation is turned on.

synology.isOn(function(err, isOn) {
  console.log(isOn)
})

synology-diskstation's People

Contributors

simonbs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.