Class Product

Each product that is registered at the KLF-200 interface will be created as an instance of the Product class.

Product

Hierarchy (view full)

Constructors

Properties

Connection: IConnection

The connection object that handles the communication to the KLF interface.

NodeID: number

NodeID is an Actuator index in the system table, to get information from. It must be a value from 0 to 199.

propertyChangedEvent: TypedEvent<PropertyChangedEvent> = ...

The event will be emitted when any of the public properties has changed. The event object contains a reference to the product, the name of the property that has changed and the new value of that property.

Accessors

  • get Category(): string
  • String representation of the TypeID and SubType.

    Returns string

  • get CurrentPosition(): number
  • The current position of the product in percent.

    The value is derived from the raw value and depending on the type ID it is inverted, so that 100% means e.g. window is fully open, roller shutter is fully closed, light is at full power etc.

    Returns number

  • get CurrentPositionRaw(): number
  • Raw value of the current position of the product.

    Returns number

  • get FP1CurrentPositionRaw(): number
  • Raw value of the current position of the functional paramter 1.

    Returns number

  • get FP2CurrentPositionRaw(): number
  • Raw value of the current position of the functional paramter 2.

    Returns number

  • get FP3CurrentPositionRaw(): number
  • Raw value of the current position of the functional paramter 3.

    Returns number

  • get FP4CurrentPositionRaw(): number
  • Raw value of the current position of the functional paramter 4.

    Returns number

  • get LimitationMaxRaw(): readonly number[]
  • A read only array of the raw limitations' max values.

    Returns readonly number[]

  • get LimitationMinRaw(): readonly number[]
  • A read only array of the raw limitations' min values.

    Returns readonly number[]

  • get LimitationTimeRaw(): readonly number[]
  • A read only array of the limitation time raw values.

    Returns readonly number[]

  • get Name(): string
  • Name of the product.

    Returns string

  • get Order(): number
  • The order in which the products should be displayed by a client application.

    Returns number

  • get Placement(): number
  • The placement of the product. Either a house index or a room index number.

    Returns number

  • get ProductAlias(): ActuatorAlias[]
  • Contains the position values to move the product to a special position. The special position is defined by the alias value.

    E.g. for a window the alias ID for secured ventilation if 0xD803. To move a product into secured ventilation position you have to read the value of the alias for the alias ID 0xD803 and set the raw target position to that value. Different types of windows may return different raw positions.

    Returns ActuatorAlias[]

  • get ProductType(): number
  • Type of the product, eg. KMG, KMX.

    Returns number

  • get RemainingTime(): number
  • Remaining time in seconds to reach the desired target position.

    Returns number

  • get SerialNumber(): Buffer
  • The serial number of the product.

    Returns Buffer

  • get SubType(): number
  • Details the node type and depends on the TypeID property.

    Returns number

  • get TargetPosition(): number
  • The target position in percent.

    Returns number

  • get TargetPositionRaw(): number
  • Raw value of the target value for the position of the product.

    Returns number

  • get TimeStamp(): Date
  • Timestamp of the last change to any of the properties.

    Returns Date

Methods

  • Clears the limitation for the parameter.

    Parameters

    • parameterActive: ParameterActive = ParameterActive.MP

      Parameter for which the limitation should be set.

    • commandOriginator: CommandOriginator = CommandOriginator.SAAC

      Command Originator.

    • priorityLevel: PriorityLevel = PriorityLevel.ComfortLevel2

      Priority Level.

    Returns Promise<void>

    Promise

  • Readonly

    The maximum value of a limitation of the product.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation should be returned.

    Returns number

  • Readonly

    The maximum value (raw) of a limitation of the product.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation should be returned.

    Returns number

  • Readonly

    The minimum value of a limitation of the product.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation should be returned.

    Returns number

  • Readonly

    The minimum value (raw) of a limitation of the product.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation should be returned.

    Returns number

  • Returns the limitation time in seconds for a functional parameter. You have to call refreshLimitationAsync to get the latest values first.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation time should be returned.

    Returns number

    The limitation time in seconds or Infinity.

  • Returns the raw value of the limitation time for a functional parameter. You have to call refreshLimitationAsync to get the latest values first.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitation time raw value should be returned.

    Returns number

    The raw limitation time value.

  • Returns a tuple of min and max values for the limitation of the provided parameter.

    Parameters

    • functionalParameter: ParameterActive

      Parameter for which the limitations should be returned.

    Returns [min: number, max: number]

    A tuple of the min and max values as percentage in the range [0, 1]. The first value of the tuple corresponds always to the min raw value and the second value corresponds always to the max raw value.

  • Refresh the data of this product and read the attributes from the gateway.

    This method re-reads the data from the KLF-200. If the product hasn't sent its recent data to the KLF-200, call Products.requestStatusAsync first.

    Returns Promise<void>

  • Refreshes the limitation data for the provided limitation type of a parameter.

    Parameters

    • limitationType: LimitationType

      The limitation type for which the data should be refreshed.

    • parameterActive: ParameterActive = ParameterActive.MP

      Parameter for which the limitation should be refreshed.

    Returns Promise<void>

    Promise

  • Sets a new limitation.

    Parameters

    • minValue: number

      Min value of the limitation in the range [0, 1].

    • maxValue: number

      Max value of the limitation in the range [0, 1].

    • parameterActive: ParameterActive = ParameterActive.MP

      Parameter for which the limitation should be set.

    • limitationTime: number = Infinity

      Limitation time in seconds. Must be a multiple of 30.

    • commandOriginator: CommandOriginator = CommandOriginator.SAAC

      Command Originator.

    • priorityLevel: PriorityLevel = PriorityLevel.ComfortLevel2

      Priority Level.

    Returns Promise<void>

    Promise

  • Sets a new limitation with raw values.

    Parameters

    • minValue: number

      Raw min value of the limitation.

    • maxValue: number

      Raw max value of the limitation.

    • parameterActive: ParameterActive = ParameterActive.MP

      Parameter for which the limitation should be set.

    • limitationTime: number = 253

      Limitation time.

    • commandOriginator: CommandOriginator = CommandOriginator.SAAC

      Command Originator.

    • priorityLevel: PriorityLevel = PriorityLevel.ComfortLevel2

      Priority Level.

    Returns Promise<void>

    Promise

  • Renames the product.

    Parameters

    • newName: string

      New name of the product.

    Returns Promise<void>

  • Sets the variation of a product to a new value.

    Parameters

    • newNodeVariation: NodeVariation

      New value for the variation of the product.

    Returns Promise<void>

  • Sets the order and placement of the product.

    Parameters

    • newOrder: number

      The new order value of the product.

    • newPlacement: number

      The new placement value of the product.

    Returns Promise<void>

  • Sets a new value for the order number of the product.

    Parameters

    • newOrder: number

      New value for the order property.

    Returns Promise<void>

  • Sets a new value for the placement of the product.

    Parameters

    • newPlacement: number

      New value for the placement property.

    Returns Promise<void>

  • Sets the product to a new position in percent.

    Parameters

    • newPosition: number

      New position value in percent.

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    • ParameterActive: ParameterActive = 0

      The parameter that should be returned in the notifications. MP or FP1-FP16.

    • FunctionalParameters: FunctionalParameter[] = []

      Additional functional paramters can be set during the command.

    • PriorityLevelLock: PriorityLevelLock = 0

      Flag if the priority level lock should be used.

    • PriorityLevels: PriorityLevelInformation[] = []

      Up to 8 priority levels.

    • LockTime: number = Infinity

      Lock time for the priority levels in seconds (multiple of 30 or Infinity).

    Returns Promise<number>

  • Sets the product to a new position as raw value.

    Parameters

    • newPosition: number

      New position value as raw value.

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    • ParameterActive: ParameterActive = 0

      The parameter that should be returned in the notifications. MP or FP1-FP16.

    • FunctionalParameters: FunctionalParameter[] = []

      Additional functional paramters can be set during the command.

    • PriorityLevelLock: PriorityLevelLock = 0

      Flag if the priority level lock should be used.

    • PriorityLevels: PriorityLevelInformation[] = []

      Up to 8 priority levels.

    • LockTime: number = Infinity

      Lock time for the priority levels in seconds (multiple of 30 or Infinity).

    Returns Promise<number>

  • Stops the product at the current position.

    Parameters

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    • ParameterActive: ParameterActive = 0

      The parameter that should be returned in the notifications. MP or FP1-FP16.

    • FunctionalParameters: FunctionalParameter[] = []

      Additional functional paramters can be set during the command.

    • PriorityLevelLock: PriorityLevelLock = 0

      Flag if the priority level lock should be used.

    • PriorityLevels: PriorityLevelInformation[] = []

      Up to 8 priority levels.

    • LockTime: number = Infinity

      Lock time for the priority levels in seconds (multiple of 30 or Infinity).

    Returns Promise<number>

  • Let the product "wink". Its main intention is to identify a product.

    Winking depends on the product, e.g. a window moves the handle a little bit.

    Parameters

    • EnableWink: boolean = true

      If false wink will be stopped.

    • WinkTime: number = 254

      Wink time in seconds (up to 253) or 254 for manufactor defined or 255 for infinite time.

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    Returns Promise<number>