Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ node-openzwave

This is a node.js add-on which wraps the [Open
Z-Wave](https://code.google.com/p/open-zwave/) library to provide access to a
Z-Wave network from JavaScript.
Z-Wave network from [Node.JS](https://nodejs.org) (server-side JavaScript.)

It is currently able to scan a Z-Wave network, report on connected devices,
monitor the network for changes, and has rudimentary write support.

## NOTE:
this is essentially [a fork from jperkin's work](https://github.com/jperkin/node-openzwave)
so all the credit is due to him, not me, I (ekarak) only added support for
multi-instance ZWave devices (eg the Fibaro FGS-221).

## Install

The module currently builds only on OS X and Linux. On Linux you will need to
Expand Down Expand Up @@ -71,9 +76,15 @@ zwave.switchOff(nodeid);
/*
* Set arbitrary values.
*/
zwave.setValue(nodeid, commandclass, index, value);
zwave.setValue(nodeid, commandclass, index, instance, value);
```
This is useful for multi-instance devices, such as the Fibaro FGS-221 eg:
```js
zwave.setValue(8, 37, 0, 1, true); // turn on 1st output relay
zwave.setValue(8, 37, 0, 2, true); // turn on 2nd output relay
```


Writing to device metadata (stored on the device itself):

```js
Expand Down
82 changes: 82 additions & 0 deletions deps/open-zwave/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Minimal Install Guide for OpenZWave!

For Unix's (including Mac, bsd's etc)
=================
execute Make in the Top Level Directory
make

Libraries to link to (Static and Dynamic) will be in top level directory as
well (but you can change that as detailed below with LIBDIR)

To Install:
make install

Some Options you can set:
"BUILD=(release|debug)" - Build a Release or Debug Version of the Library
(Release is default)

"PREFIX=(path)" - Prefix to install the shared library into - Defaults to
/usr/local

"LIBDIR=/tmp" - Path to place the libraries into after complication. A poor
mans "make install" for simple Applications.

To use the options, specify them on the commandline when executing make eg:
"BUILD=debug PREFIX=/opt/local make"

What Gets installed:
When make install is called the following happens:

* Documentation:
if you have DoxyGen, API documentation is installed into
(PREFIX)/share/doc/openzwave-(version)/

* Shared Libary (libopenzwave.so.*):
The Shared Library is installed into either (prefix)/lib64 (on 64
bit platforms) or (prefix)/lib/ on 32 bit platforms)

* Header Files:
Installed into (prefix)/include/openzwave/

* pkg-config file:
Installed into (prefix)/lib(64)/pkgconfig/libopenzwave.pc

* Config files and Device Databases (manufacturer_specific.xml et al)
Installed into (prefix)/etc/openzwave/

* MinOZW example program:
Installed into (prefix)/bin/ directory

The Static Version of the library is never installed, but will be created in
cpp/lib directory after a successfull make.

Windows Versions
================

Visual Studio Solution Files and Mingw32 Makefiles are present in
cpp/build/windows/. Select the correct Visual Studio or Mingw32 directory
depending on the versions you have.

(Note, if building DLL's on Windows (currently a option in the vs2010
solution) - You have to ensure you application is compiled with exactly the
same compiler options and versions as OpenZWave - Otherwise strange things
might happen)

For the .NET dll, the solution files exist in the dotnet/build/ directory

Sample Programs
===============

For all platforms, there is a simple example program that will print out
events as they happen on your ZWave network. This sample is called MinOZW
and you can find the source in the cpp/examples directory. By default, these
examples are built during the Make Install Stage. If you want compile them
separately, you can use the "make examples" target.

For the .NET wrapper, there is a OZWForm application in
dotnet/examples/OZWForm/. Please read the README file in that directory for
further instructions




35 changes: 35 additions & 0 deletions deps/open-zwave/config/BeNext/1poleswitch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--http://benext.eu/static/manual/1poleswitch.pdf-->
<Product xmlns='http://code.google.com/p/open-zwave/'>
<!-- Configuration -->
<CommandClass id="112">

<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
<Help>Set all configuration values to default values (factory settings).</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="10" label="Mode" value="255">
<Help>The mode in which a different Z-Wave message is sent.</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="11" label="Double press time" value="20">
<Help>The time that a user has to activate the double button pressed scene, if time is passed then the single pressed button scene is notified. (value * 10 ms)</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="12" label="Temperature offset" value="0" size="2">
<Help>A signed integer to determine the offset of the temperature.</Help>
</Value>

</CommandClass>

<!-- Association Groups -->
<CommandClass id="133">
<Associations num_groups="4">
<Group index="1" max_associations="8" label="Group 1" auto="false"/>
<Group index="2" max_associations="8" label="Group 2" auto="false"/>
<Group index="3" max_associations="8" label="Group 3" auto="false"/>
<Group index="4" max_associations="8" label="Group 4" auto="false"/>
</Associations>
</CommandClass>

</Product>
35 changes: 35 additions & 0 deletions deps/open-zwave/config/BeNext/2poleswitch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--http://benext.eu/static/manual/2poleswitch.pdf-->
<Product xmlns='http://code.google.com/p/open-zwave/'>
<!-- Configuration -->
<CommandClass id="112">

<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
<Help>Set all configuration values to default values (factory settings).</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="10" label="Mode" value="255">
<Help>The mode in which a different Z-Wave message is sent.</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="11" label="Double press time" value="20">
<Help>The time that a user has to activate the double button pressed scene, if time is passed then the single pressed button scene is notified. (value * 10 ms)</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="12" label="Temperature offset" value="0" size="2">
<Help>A signed integer to determine the offset of the temperature.</Help>
</Value>

</CommandClass>

<!-- Association Groups -->
<CommandClass id="133">
<Associations num_groups="4">
<Group index="1" max_associations="8" label="Group 1" auto="false"/>
<Group index="2" max_associations="8" label="Group 2" auto="false"/>
<Group index="3" max_associations="8" label="Group 3" auto="false"/>
<Group index="4" max_associations="8" label="Group 4" auto="false"/>
</Associations>
</CommandClass>

</Product>
62 changes: 62 additions & 0 deletions deps/open-zwave/config/BeNext/AlarmSound.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Product xmlns='http://code.google.com/p/open-zwave/'>
<!-- COMMAND_CLASS_ALARM AlarmCmd_Get not supported -->
<CommandClass id="113" getsupported="false" />

<!-- Configuration -->
<CommandClass id="112">
<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
<Help>Set all configuration values to default values (factory settings)</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="2" label="Destination routine enabled" value="255">
<Help>Enables an internal routine that periodically checks the Z-Wave device in assocication group 2</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="3" label="Destination routine success time" value="60">
<Help>Configure the time that the AlarmSound sends a new frame when previous frame was send successful</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="4" label="Destination routine failed time" value="240">
<Help>Configure the time that the AlarmSound sends a few frame when previous frame was send not successful</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="5" label="Temperature calibration offset (byte 1)" value="0">
<Help>A (signed) offset to calibrate the onboard temperature sensor</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="6" label="Temperature calibration offset (byte 2)" value="0">
<Help>A (signed) offset to calibrate the onboard temperature sensor</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="7" label="Select index sound/light mode" value="1">
<Help>The index of the sound mode when a switch binary/basic set frame is received</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="8" label="Power offline sound/light mode" value="6">
<Help>The index of the sound mode when the AlarmSound will start when it is unplugged</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="9" label="Error sound/light mode" value="5">
<Help>The index of the sound mode when the AlarmSound will play when it is unable to reach the device in association group 2</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="10" label="Sound/Light index 1" value="-1">
<Help>Params 10 until 27 are the values to configure the sound and light thtat are played when index 1 is selected</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="28" label="Sound/Light index 2" value="-1">
<Help>Params 28 until 45 are the values to configure the sound and light thtat are played when index 2 is selected</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="46" label="Sound/Light index 3" value="-1">
<Help>Params 46 until 63 are the values to configure the sound and light thtat are played when index 3 is selected</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="64" label="Sound/Light index 4" value="-1">
<Help>Params 64 until 81 are the values to configure the sound and light thtat are played when index 4 is selected</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="82" label="Sound/Light index 5" value="-1">
<Help>Params 82 until 99 are the values to configure the sound and light thtat are played when index 5 is selected</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="100" label="Sound/Light index 6" value="-1">
<Help>Params 100 until 117 are the values to configure the sound and light thtat are played when index 6 is selected</Help>
</Value>
</CommandClass>

<!-- Association Groups -->
<CommandClass id="133">
<Associations num_groups="2">
<Group index="1" max_associations="1" label="Group 1" auto="false"/>
<Group index="2" max_associations="1" label="Group 2" auto="false"/>
</Associations>
</CommandClass>
</Product>
77 changes: 77 additions & 0 deletions deps/open-zwave/config/BeNext/BuiltinDimmer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--http://benext.eu/static/manual/builtindimmer.pdf-->
<Product xmlns='http://code.google.com/p/open-zwave/'>
<!-- Configuration -->
<CommandClass id="112">

<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
<Help>Set all configuration values to default values (factory settings).</Help>
</Value>

<Value type="list" genre="config" instance="1" index="2" label="Button Type" value="0" size="1">
<Help>The way how the button reacts when press/released</Help>
<Item label="Toggle light when button is pressed, no action when button is released." value="0"/>
<Item label="Toggle light when button is released, Start dimming when button pressed." value="1"/>
<Item label="Toggle light when button is pressed and when button is Released, start dimming when quickly press and release button." value="2"/>
</Value>

<Value type="list" genre="config" instance="1" index="3" label="Control Type" value="0" size="1">
<Help>The way the Built-in Dimmer reacts when light is turned on/off with button</Help>
<Item label="Switch own light on and send a Z-Wave message to all associated nodes (direct and extern)" value="0"/>
<Item label="Don.t switch own light on but only send a Z-Wave message to associated node. (extern only)" value="1"/>
</Value>

<Value type="byte" genre="config" instance="1" index="4" label="Dimming enabled" value="1">
<Help>This parameter is used to enable the dimming option of the product. When disabled the dimming and fading routine are disabled.</Help>
<Item label="Dimming disabled." value="0"/>
<Item label="Dimming enabled." value="2"/>
</Value>

<Value type="byte" genre="config" instance="1" index="6" label="Maximum Powerload" value="200" size="2">
<Help>The maximum powerload in watts when light is turned on, when measured higher then this value the Inline Dimmer is automatically turned off.</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="7" label="Dimming Speed" value="3">
<Help>The speed of dimming when activated (manual and RF). Dim speed is 1% per value (* 10 ms)</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="8" label="Fading up Speed" value="3">
<Help>The speed of fading up when activated (manual and RF). Fade speed is 1% per value (* 10 ms)</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="9" label="Toggle time" value="50">
<Help>The time window to repress button to start dimming. Toggle time is value (* 10ms)</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="11" label="Auto meter report: percentage" value="20">
<Help>A percentage that an energy value must be different compared to a previous sent value before an unsolicited meter report is sent. Minimum value = 10% Maximum value = 100%</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="12" label="Auto meter report: watt" value="10">
<Help>A watt value that an energy value must be different compared to a previous sent value before an unsolicited meter report is sent. Minimum value = 5 watt Maximum value = 255 watt</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="13" label="Auto meter report: time" value="20">
<Help>A time value that has to be passed compared to a previous sent value before a unsolicited meter report is sent. Minimum value = 10 seconds Maximum value = 255 seconds</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="14" label="Last known status" value="0">
<Help>What to do with lamp status when power applied. If 0x00: Always switch light off when power applied. If > 0x00: Switch lamp on/off depending on last known lampstatus before power was disconnected.</Help>
</Value>

<Value type="byte" genre="config" instance="1" index="15" label="Fading down speed" value="1">
<Help>The speed of fading up when activated (manual and RF). Fade speed is 1% per value (* 10 ms)</Help>
</Value>

</CommandClass>

<!-- Association Groups -->
<CommandClass id="133">
<Associations num_groups="3">
<Group index="1" max_associations="8" label="Group 1: All nodes in this group will receive a BASIC_SET frame when light is set to a certain state with the button of the Built-in Dimmer (manual switching)." auto="false"/>
<Group index="2" max_associations="1" label="Group 2: The node associated in this group will receive a SWITCH_MULTILEVEL_REPORT frame every time the level of light is changed, where the value represents the (changed) dim level. The status is reported after every change that means manual but also if changed by Z-Wave. The node in this group will also received the (auto) METER_REPORT." auto="false"/>
<Group index="3" max_associations="1" label="Group 3: If configured that the control mode is extern only (configuration param3, value 1) then a BASIC_SET frame is sent to the node in this group when the button is changed." auto="false"/>
</Associations>
</CommandClass>

</Product>
4 changes: 4 additions & 0 deletions deps/open-zwave/config/BeNext/DoorSensor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<Item label="Mode 1: Normal operating mode." value="1"/>
<Item label="Mode 3: Z-Wave chip is always on to request e.g. version or manufacturer id." value="3"/>
</Value>

<Value type="int" genre="config" instance="1" index="6" label="Temperature offset" value="0">
<Help>A signed integer to determine the offset of the temperature. </Help>
</Value>
</CommandClass>

<!-- Association Groups -->
Expand Down
33 changes: 33 additions & 0 deletions deps/open-zwave/config/BeNext/Molite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--http://www.pepper1.net/zwavedb/device/265-->
<Product xmlns='http://code.google.com/p/open-zwave/'>
<!-- Configuration -->
<CommandClass id="112">
<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
<Help>Set all configuration values to default values (factory settings).</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="2" label="Mode timeout" size="2" value="1" units="seconds">
<Help> The time used in mode 2 to turn the sensor off. This Time will start running as soon as detection is seen.</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="3" label="Switch off time" size="2" value="15" units="seconds">
<Help> The switch off time will start running as soon as mode timeout is done. Motion sensor is turned on and when movement is detected again the mode timeout (cfg param 1) will start running all over again. When switch off time is done a basic off message is sent to the associated node.</Help>
</Value>
<Value type="byte" genre="config" instance="1" index="4" label="Sensitivity" size="1" value="100">
<Help>Sensitivity value between 0 and 127 (values above 127 will be reported as the set value but will be handled in SW as 127).</Help>
</Value>
<Value type="list" genre="config" instance="1" index="5" label="The mode" size="1" value="2">
<Help>The mode that is entered after detection. If mode is 0 or higher then 3, that value will be reported after a get but will be handled in SW as mode 2.</Help>
<Item label="no detection possible. Battery save mode" value="1"/>
<Item label="normal operation mode: send on after detection and off after given time no detection" value="2"/>
<Item label="Z-Wave chip is always on to request e.g. version or manufacturer id" value="3"/>

</Value>
</CommandClass>

<!-- Association Groups -->
<CommandClass id="133">
<Associations num_groups="1">
<Group index="1" max_associations="5" label="Group 1" auto="false"/>
</Associations>
</CommandClass>
</Product>
Loading