Creates a new connection object that connect to the given host.
Host name or IP address of the KLF-200 interface.
Optional
CA: BufferA buffer with a certificate of the certificate authority. Currently, the interface uses a self-signed certificate thus a certificate has to be provided for the CA. This parameter is optional and in case the certificate will be changed with subsequent firmware updates you can provide the matching certificate with this parameter.
Optional
fingerprint: stringThe fingerprint of the certificate. This parameter is optional.
Creates a new connection object that connect to the given host.
Host name or IP address of the KLF-200 interface.
Options that will be provided to the connect method of the TLS socket.
Readonly
CAOptional
Readonly
connectionReadonly
fingerprintReadonly
hostGets the [[KLF200SocketProtocol]] object used by this connection. This property has a value after calling [[loginAsync]], only.
Logs in to the KLF interface by sending the GW_PASSWORD_ENTER_REQ.
The password needed for login. The factory default password is velux123.
Optional
timeout: number = 60A timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise that resolves to true on success or rejects with the errors.
Logs out from the KLF interface and closes the socket.
Optional
timeout: number = 10A timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise that resolves to true on successful logout or rejects with the errors.
Add a handler to listen for confirmations and notification. You can provide an optional filter to listen only to specific events.
Callback functions that is called for an event
Optional
filter: GatewayCommand[]Array of GatewayCommand entries you want to listen to. Optional.
Returns a Disposable that you can call to remove the handler.
Add a handler to listen for sent frames. You can provide an optional filter to listen only to specific events.
Callback functions that is called for an event
Optional
filter: GatewayCommand[]Array of GatewayCommand entries you want to listen to. Optional.
Returns a Disposable that you can call to remove the handler.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Sends a request frame to the KLF interface.
The frame that should be sent to the KLF interface.
Optional
timeout: numberA timeout in seconds. After the timeout the returned promise will be rejected.
Returns a promise with the corresponding confirmation message as value. In case of an error frame the promise will be rejected with the error number. If the request frame is a command (with a SessionID) than the promise will be resolved by the corresponding confirmation frame with a matching session ID.
Start a keep-alive timer to send a message at least every [[interval]] minutes to the interface. The KLF-200 interface will close the connection after 15 minutes of inactivity.
Optional
interval: number = ...Keep-alive interval in minutes. Defaults to 10 min.
The Connection class is used to handle the communication with the Velux KLF interface. It provides login and logout functionality and provides methods to run other commands on the socket API.
Connection