Lox Nexus

SDK reference

This is the place to look things up: every class, method, type and helper of the plugin SDK, with what it does, what it returns and what to watch out for. It is generated from the comments in the SDK's source, so it matches the code you install.

New to writing plugins? Start with the tutorial, which builds a complete plugin step by step, and come back here when you want the details of one class.

The classes you meet first

In the order you need them when you write a plugin:

  1. Plugin: the class you write once per integration. It starts the work (usually a poller), holds what the sensors share and offers a catalog and a panel.
  2. Sensor: a value that comes from the device. It sends values with emit().
  3. Actuator: a command that goes to the device. Its run() receives the value a Loxone output sent.
  4. Action: something the user starts with a button on the instance page, such as pairing a device.
  5. Disposable: the base of all of the above. Timers, listeners and child objects you register with every(), after(), listen() and own() are cleaned up for you.
  6. PluginEntry: the one line that exports your plugin so Nexus can load it.
  7. The settings helpers, which mark config fields so the form shows the right input: secret, token, duration, slider, file and more. Find them under "Settings form".
  8. PluginTestHost and TestClock: run your plugin in a test without a Nexus server and move time by hand.

The four modules

How to read a class page

  • Static declarations (static readonly id, config, sensors, ...) are not members of the class page. You write them in your subclass; the plugin's, sensor's, actuator's and action's declarations are listed on the PluginClass, SensorClass, ActuatorClass and ActionClass types on the main module page.
  • Instance members are what you call or override on this: properties and accessors such as this.config, this.log and this.plugin, and methods such as start() and run().
  • Protected members (emit(), fail(), recover(), every(), own(), ...) are for your subclass only: call them from inside your class, not from outside.
  • Inherited from shows members that come from Disposable.
  • Examples on a page use the smart plug from the tutorial: a plug read over HTTP, with a meter sensor and a switch actuator.

Modules