Global

Members

(constant) deviceLibrary

Description:
  • This file is part of Domotz Agent.
License:
  • Domotz Agent is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Domotz Agent is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Domotz Agent. If not, see .
This file is part of Domotz Agent.

Type Definitions

CheerioAPI

Description:
  • The Cheerio Library Loaded Document Interface. Can be used to traverse and manipulate the loaded document.
See:
The Cheerio Library Loaded Document Interface. Can be used to traverse and manipulate the loaded document.
Type:
  • Object

CheerioOptions

Description:
  • The Cheerio Library Accepted Options
See:
The Cheerio Library Accepted Options
Type:
  • Object

ColumnHeader

Description:
  • Custom Driver table Column Header
Properties:
Name Type Attributes Description
label string The table column label. Max 30 Characters
unit string <optional>
The Unit of measurement of the column values (eg %). Max 10 characters
valueType ValueType <optional>
The value of the column values (used for display purposes)
Custom Driver table Column Header
Type:
  • Object

ConfigurationBackup

Description:
  • Custom Driver configuration backup Validated version is returned by D.createBackup, should be passed to D.success()
Properties:
Name Type Attributes Description
label string <optional>
The name of the backup, default is "Custom Driver Configuration Backup"
running string The configuration currently running on the device, must be less than 1mb
startup string <optional>
The optional configuration which will be active when the device is restarted, must be less than 1mb
ignoredLines Array.<string> <optional>
List of regular expressions They are used to decide if a line should be considered when comparing configurations for misalignment. The regex engine directly substitutes the match text with an empty string. Do not pass flags in the regex, the format is not supported.
Custom Driver configuration backup Validated version is returned by D.createBackup, should be passed to D.success()
Type:
  • Object

DeviceCredentials

Description:
  • Custom Driver device credentials
Properties:
Name Type Description
username string The device username
password string The device password
Custom Driver device credentials
Type:
  • Object

DriverTableResult

Description:
  • Custom Driver table Result
Properties:
Name Type Description
label string The table Label. Max 50 characters
columnHeaders Array.<ColumnHeader> The column headers list
rows Array.<Array.<any>> The table rows
Custom Driver table Result
Type:
  • Object

ErrorResult

Description:
  • Used when the result of a call towards a device is in an erroneous state
Properties:
Name Type Description
message string The Error Message
Used when the result of a call towards a device is in an erroneous state
Type:
  • Object

ErrorType

Description:
  • Known Domotz Context Error types
Properties:
Name Type Description
TOO_MANY_VARIABLES_ERROR string Too many variables have been defined in this driver execution
MISSING_DEVICE_ERROR string No device was found for execution
RESOURCE_UNAVAILABLE string The Resource you are trying to access is not available
AUTHENTICATION_ERROR string Authentication with the device has failed
PARSING_ERROR string Failed to parse the response
TIMEOUT_ERROR string The remote call has resulted in a timeout
IMPORT_NOT_ALLOWED string Import statements are not allowed in the sandbox environment
REQUIRE_NOT_ALLOWED string Require statements are not allowed in the sandbox environment
GENERIC_ERROR string A Generic/Unknown error has occurred
Known Domotz Context Error types
Example
D.errorType.TIMEOUT_ERROR

HttpCallback

Description:
  • The Http library callback
Properties:
Name Type Attributes Description
error string <optional>
The HTTP response error
response object The HTTP response object
body string <optional>
The HTTP response body
The Http library callback
Type:
  • callback

HttpOptions

Description:
  • The Http Library Options
Properties:
Name Type Attributes Default Description
url string The url suffix of the request target
headers object <optional>
The Request HTTP Headers defined as key value pairs. Eg {'Accept': 'text/html'}
body string <optional>
The Request HTTP Body
port integer <optional>
80 The port to use for the request. If protocol is set to https the default is 443
auth string | object <optional>
The authentication to use. Eg 'basic' / {'bearer': 'the token'}
username string <optional>
The device username. If not set the custom driver management purpose one is used
password string <optional>
The device password. If not set the custom driver management purpose one is used
jar boolean <optional>
false if true, remember cookies for future use
useHostname boolean <optional>
true if false, ip address is used as host. If true or not set the device host_name is used as host
protocol http | https <optional>
http The protocol to use in the request
The Http Library Options
Type:
  • object

SshAlgorithms

Description:
  • The SSH authentication algorithm parameters
Properties:
Name Type Description
kex Array.<string> A List of SSH key exchange methods to use
cipher Array.<string> A List of SSH ciphers to use
The SSH authentication algorithm parameters
Type:
  • Object
Example
{
    cipher: [
        'aes128-gcm',
        'aes128-gcm@openssh.com',
        'aes256-gcm',
        'aes256-gcm@openssh.com'
    ],
    kex: [
        'diffie-hellman-group-exchange-sha1',
        'diffie-hellman-group-exchange-sha256',
        'ecdh-sha2-nistp256',
        'ecdh-sha2-nistp384',
        'ecdh-sha2-nistp521'
    ]

}

SshCallback

Description:
  • The SSH Command Execution Result
Properties:
Name Type Attributes Description
output string The stdout from the SSH Command execution
error ErrorResult <optional>
Will be present if the execution resulted in an error
The SSH Command Execution Result
Type:
  • callback

SshOptions

Description:
  • The SSH Library Options
Properties:
Name Type Attributes Default Description
command string The ssh command to execute against the device
timeout int <optional>
The time to wait for the command execution
username string <optional>
The device username. If not set the custom driver management purpose one is used
password string <optional>
The device password. If not set the custom driver management purpose one is used
keyboard_interactive boolean <optional>
false Try keyboard-interactive user authentication if primary user authentication method fails
port string <optional>
22 The SSH port
algorithms SshAlgorithms <optional>
The SSH Kex and Ciphers to use
The SSH Library Options
Type:
  • Object

TCPCallback

Description:
  • The TCP library callback
Properties:
Name Type Attributes Description
output string The Result from the tcp command execution
error ErrorResult <optional>
Will be present if the execution resulted in an error
The TCP library callback
Type:
  • callback

TCPOptions

Description:
  • The TCP library Options
Properties:
Name Type Attributes Default Description
command string The tcp command to execute against the device
port int <optional>
23 The tcp port to connect to
timeout int <optional>
500 The time the tcp command will execute for at most (in milliseconds)
keepAlive boolean <optional>
false Boolean flag to use if the TCP connection should persist until the timeout value runs out. Disabled by default
encoding str <optional>
utf8 The tcp command response encoding. Default 'utf8'
The TCP library Options
Type:
  • Object

TelnetCallback

Description:
  • The Telnet library callback
Properties:
Name Type Attributes Description
output string The Result from the telnet command execution
error ErrorResult <optional>
Will be present if the execution resulted in an error
The Telnet library callback
Type:
  • callback

TelnetOptions

Description:
  • The Telnet library Options
Properties:
Name Type Attributes Default Description
command string The telnet command to execute against the device
port int <optional>
23 The telnet port to connect to
timeout int <optional>
500 The time the telnet session will persist for (in milisenconds)
negotiationMandatory boolean <optional>
false Set this to true if the telnet session requires authentication
shellPrompt string <optional>
/(?:\/ )?#\s/ The expected shell prompt regular expression for the telnet session
loginPrompt string <optional>
/login[: ]*$/i The expected username prompt regular expression for the telnet session
passwordPrompt string <optional>
/Password: /i The expected password prompt regular expression for the telnet session
The Telnet library Options
Type:
  • Object

ValueType

Description:
  • Domotz variable value types
Properties:
Name Type Description
STRING string String value
NUMBER string Numerical value
DATETIME string Datetime value
RATE string A numeric value that changes over time in an increasing manner. Only the rate of change is calculated and stored
MONOTONE_RATE string A numeric value similar to the RATE type but ignoring values lower than the previous collected value in the rate of change comparison
Domotz variable value types
Example
D.valueType.RATE

Variable

Description:
  • Custom Driver variable Created via D.createVariable
Properties:
Name Type Description
uid string The identifier of the variable. Must be Unique. Max 50 characters
cannot be one of the following reserved words: "table", "column", "history"
name string The Name/Label of the variable. Max 100 characters
value string The Value of the variable. Max 500 characters
unit string The Unit of measurement of the variable (eg %). Max 10 characters
valueType ValueType The type of the variable value (used for visualization purposes).
Custom Driver variable Created via D.createVariable
Type:
  • Object

WinRMCallback

Description:
  • The WinRM Command Execution Result
Properties:
Name Type Attributes Description
output WinRMOutput <optional>
Output of the execution, present if no error has occurred
error ErrorResult <optional>
Will be present if the execution resulted in an error
The WinRM Command Execution Result
Type:
  • callback

WinRMOptions

Description:
  • The WinRM Library Options
Properties:
Name Type Attributes Default Description
command string The winrm command to execute against the device
username string <optional>
The device username. If not set the custom driver management purpose one is used
password string <optional>
The device password. If not set the custom driver management purpose one is used
port string <optional>
5985 The WinRM port
The WinRM Library Options
Type:
  • Object

WinRMOutput

Description:
  • The WinRM Command Execution Result output
Properties:
Name Type Attributes Description
commandId string Id of the WinRM command
shellId string Id of the remote shell that executed the command
stdout string standard output produced by the command
stderr string <optional>
standard error produced by the command (should always be null)
exitCode int exit code of the command (should always be 0)
The WinRM Command Execution Result output
Type:
  • Object

snmpCallback

Description:
  • The SNMP query callback
Properties:
Name Type Attributes Description
output Object.<string, string> The output object from the snmp query execution as a key-value pair for each oid and it corresponding value
error ErrorResult <optional>
Will be present if the snmp query resulted in an error.
The SNMP query callback
Type:
  • callback

snmpSessionOptions

Description:
  • The SNMP Session Options
Properties:
Name Type Attributes Default Description
port integer <optional>
161 UDP port to send requests to
timeout integer <optional>
5000 The time the snmp session queries will persist for (in milisenconds).
maxRepetitions integer <optional>
24 How many rows of a table are to be retrieved in a single GetBulk operation. Used in SNMP Walk
The SNMP Session Options
Type:
  • Object