You can find the source code for this sample by downloading a zip of all of our samples here and navigating to the
samples-develop\AllJoyn\Samples\ZWaveAdapter. The sample code is available in C++. Make a copy of the folder on your disk and open the project from Visual Studio.
This tutorial demonstrates the function of the AllJoyn Device System Bridge (DSB) in exposing and controlling Z-Wave devices, and describes the setup of the AllJoyn Z-Wave as part of the Raspberry Pi2 image. It will demonstrate the function of the Z-Wave AllJoyn Device System Bridge (DSB) in exposing and controlling a Z-Wave device.
Z-Wave is a wireless communications protocol designed to allow devices in the home (lighting, household appliances, for example) to communicate with another for the purposes of home automation.
The Z-Wave adapter DSB comes pre-installed for most Windows 10 IOT Core images. In that case, all you need is to launch the sample using SSH or Windows Device Portal.
samples-develop\AllJoyn\Samples\ZWaveAdapter\ZWaveAdapter.slnin Visual Studio.
Once the solution has been opened in Visual Studio, Navigate to the Solution explorer and right click the HeadlessAdapterApp project. Select “Set as Startup Project”.
NOTE: Do not plug in the Z-Wave USB dongle when pairing. Also, the Z-Wave Dongle and Z-Wave switch need to be in close proximity
The setup should look like in the picture below
Let’s turn the Z-Wave power switch on! We will use the IoT Explorer for AllJoyn application to navigate the devices, objects and interfaces.
Launch IoT Explorer for AllJoyn app. The app should find the following three devices:
• ZWaveAdapter – Microsoft DSB: This is the Z-Wave DSB • HomeID_xxx… – Aeon Labs Smart Energy Switch: This is the Z-Wave power switch that is paired with the Z-Wave dongle • HomeID_xxx… – Aeon Labs Z-Stick S2: This is the Z-Wave USB dongle Select the Aeon Labs Smart Energy Switch.
Select the Switch object.
The interface view of the Switch object lists several interfaces. Most of them are default AllJoyn interfaces such as the Introspectable interface. Select the com.microsft.ZWaveAdapterHome… interface.
Select the value property.
Depending on the current state of the switch (on or off) the Current value field will show true for ON and false for OFF. In the New Value drop down list select the new setting. After the new setting is selected press Set.
The view will report the change of the value in the Current value field as well as the return status code of the operation: