device

D. Namespace

device

Description:
  • The Domotz Device object. Exposes device related libraries for http, ssh, tcp, telnet remote call executions. Contains device information such as its Custom Driver Management credentials and IP address
Example
D.device

Namespaces

http

Methods

(static) createSNMPSession(options) → {snmpSession}

Description:
  • Starts an SNMP session with the device.
Example
// returns an snmpSession object to use for snmp related queries
D.device.createSNMPSession()
See SNMP Driver Examples
Parameters:
Name Type Description
options snmpSessionOptions The SNMP Session Options
Returns:
Type
snmpSession

(static) ip() → {string}

Description:
  • Returns the IP address of the device object.
Example
// returns '192.168.1.1' for a device with this local IP address
D.device.ip()
Returns:
Type
string

(static) macAddress() → {string}

Description:
  • Returns the MAC address of the device object.
Example
// returns '00:11:22:33:44:AA' for a device
D.device.macAddress()
Returns:
Type
string

(static) password() → {string}

Description:
  • Returns the stored password of a device.
Example
// returns 'the device password'
D.device.password()
Returns:
Type
string

(static) sendSSHCommand(options, callback)

Description:
  • Sends a command to the device via SSH.
Examples
D.device.sendSSHCommand(options, callback)
See SSH Driver Examples
Parameters:
Name Type Description
options SshOptions The SSH Command execution options
callback SshCallback The SSH Command execution callback function

(static) sendTCPCommand(options, callback)

Description:
  • Sends a command to the device via TCP.
Example
D.device.sendTCPCommand(options, callback)
See TCP Driver Examples
Parameters:
Name Type Description
options TCPOptions The TCP Command execution options
callback TCPCallback The TCP Command execution callback function

(static) sendTelnetCommand(options, callback)

Description:
  • Sends a command to the device via Telnet.
Example
D.device.sendTelnetCommand(options, callback)
See Telnet Driver Examples
Parameters:
Name Type Description
options TelnetOptions The Telnet Command execution options
callback TelnetCallback The Telnet Command execution callback function

(static) sendWinRMCommand(options, callback)

Description:
Examples
D.device.sendWinRMCommand(options, callback)
See WinRM Driver Examples
Parameters:
Name Type Description
options WinRMOptions The WinRM Command execution options
callback WinRMCallback The WinRM Command execution callback function

(static) serial() → {string}

Description:
  • Returns the serial number of the device object.
Example
// returns 'serial_number' for a device
D.device.serial()
Returns:
Type
string

(static) username() → {string}

Description:
  • Returns stored username of a device.
Example
// returns 'the device username'
D.device.username()
Returns:
Type
string