Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SwitchingDevice

Z-Bus switching device which controls a single light, heating valve, etc

Hierarchy

  • SwitchingDevice

Implements

Index

Constructors

constructor

  • Creates a new Z-Bus SwitchingDevice

    Example

    const { SwitchingDevice } = require('@z-bus/api');
    //Switches address 0 on
    new SwitchingDevice(0).transmit('on');
    

    Parameters

    • address: number

      Address between 0 and 242 to which the device will be linked

    Returns SwitchingDevice

Properties

address

address: number[]

Addresses the Z-Bus device is linked to. The device will react when receiving a corresponding DeviceEvent and change its state accordingly.

Optional id

id: string

Unique id that identifies the Z-Bus device in the database

Optional name

name: string

Display name of the Z-Bus device

Optional profile

profile: string

Display profile for the Z-Bus device (determines state descriptions and symbols), e.g.:

  • a lamp
  • a heating,
  • ...

Optional state

state: "on" | "off"

Current state the Z-Bus device is in, e.g.:

  • 'undefined'
  • 'on'
  • 'off'
  • 'up'
  • 'down'
  • 'stop'

type

type: DeviceType = 'switch'

Identifies the different types of Z-Bus devices:

Static Machine

Machine: MachineDefinition = ...

Static Profiles

Profiles: { description: string; profile: string; states: { description: string; state: string }[]; transitions: { description: string; transition: string }[] }[] = ...

Static description

description: "Schaltempfänger (Licht, Heizung, ...)"

Methods

off

  • off(): void

on

  • on(): void

toggle

  • toggle(): void
  • Toggles the Z-Bus SwitchingDevice. The device will alternate

    • from off to on, or
    • from on to off

    Returns void

transmit

  • transmit(command: number | "toggle" | "up-stop" | "down-stop" | "start" | "end" | "on" | "off" | "up" | "down" | "stop"): void
  • Controls the Z-Bus SwitchingDevice

    Parameters

    • command: number | "toggle" | "up-stop" | "down-stop" | "start" | "end" | "on" | "off" | "up" | "down" | "stop"

      Command used to control the device between 0 and 255 (values see Command)

    Returns void

Generated using TypeDoc