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
Methods
(static) createSNMPSession(options) → {snmpSession}
Starts an SNMP session with the device.
Parameters:
Name | Type | Description |
---|---|---|
options |
snmpSessionOptions | The SNMP Session Options |
Returns:
- Type
- snmpSession
Example
// returns an snmpSession object to use for snmp related queries
D.device.createSNMPSession()
See SNMP Driver Examples
(static) ip() → {string}
Returns the IP address of the device object.
Returns:
- Type
- string
Example
// returns '192.168.1.1' for a device with this local IP address
D.device.ip()
(static) macAddress() → {string}
Returns the MAC address of the device object.
Returns:
- Type
- string
Example
// returns '00:11:22:33:44:AA' for a device
D.device.macAddress()
(static) password() → {string}
Returns the stored password of a device.
Returns:
- Type
- string
Example
// returns 'the device password'
D.device.password()
(static) sendSSHCommand(options, callback)
Sends a command to the device via SSH.
Parameters:
Name | Type | Description |
---|---|---|
options |
SshOptions | The SSH Command execution options |
callback |
SshCallback | The SSH Command execution callback function |
Examples
D.device.sendSSHCommand(options, callback)
See SSH Driver Examples
(static) sendTCPCommand(options, callback)
Sends a command to the device via TCP.
Parameters:
Name | Type | Description |
---|---|---|
options |
TCPOptions | The TCP Command execution options |
callback |
TCPCallback | The TCP Command execution callback function |
Example
D.device.sendTCPCommand(options, callback)
See TCP Driver Examples
(static) sendTelnetCommand(options, callback)
Sends a command to the device via Telnet.
Parameters:
Name | Type | Description |
---|---|---|
options |
TelnetOptions | The Telnet Command execution options |
callback |
TelnetCallback | The Telnet Command execution callback function |
Example
D.device.sendTelnetCommand(options, callback)
See Telnet Driver Examples
(static) sendWinRMCommand(options, callback)
Sends a command to the device via WinRM. Only basic authentication is supported.
WinRM setup instructions
Parameters:
Name | Type | Description |
---|---|---|
options |
WinRMOptions | The WinRM Command execution options |
callback |
WinRMCallback | The WinRM Command execution callback function |
Examples
D.device.sendWinRMCommand(options, callback)
See WinRM Driver Examples
(static) serial() → {string}
Returns the serial number of the device object.
Returns:
- Type
- string
Example
// returns 'serial_number' for a device
D.device.serial()
(static) username() → {string}
Returns stored username of a device.
Returns:
- Type
- string
Example
// returns 'the device username'
D.device.username()