Skip to content
Gregory Sitnin edited this page Aug 20, 2013 · 2 revisions

Home Automation system adjusted in the way to create abstracted layer ontop of hardware realization. Because of this we introduced Virtual Devices concept.

Virtual device is a class which inherits from VirtualDevice base class consists of any number of public metrics and actions, defines by the developer of the particular vDev.

Any automation module can expose any number of Virtual Devices.

vDev Metrics

To set bDev Metric value developer must call setMetricValue() method of the vDev instance. This method has two arguments – String “name” (which is name of the metric to change) and Mixed “value” (which is a new value of this metric).

When metric value changes, vDev emits “metricUpdate.vDevId” message to the global event bus with two arguments (name & newValue). “vDevId” in that case is a unique Virtual Device identifier.

Vdev Commands (Actions)

Every vDev expose performCommand() method with one argument – command name (String).

This method can be overrided by the particular Virtual Device descendant class and shoud return true if command was handled or false otherwise.

Clone this wiki locally