Monitor - Control - Automate

Home Knowledgebase How to create a custom .NET z-wave application
How to create a custom .NET z-wave application

Every Z-Command GX1 comes with a web service API that makes it possible for the end user to create their own custom z-wave application or user interface. In fact, the end-user can decide to ignore the silverlight frontend ships with the device and create their very own custom frontend application.

In this article, using Visual Studio, we will create a custom z-wave desktop application using Z-Command GX1 web service APIs.

Start Visual Studio and create a new windows application project. Note that nothing stops us from making this a web application. In that case, the user interface will be accessible to anyone with a web browser.

new_project

We will name this application Sample.

Next, create a web reference to the Z-Command GX1. This will allow your application to call remote methods on the GX1.

web_ref

Type in the address of your GX1 in the URL filed and click Go

web_ref2

Give the new web reference a name, in this project we are naming it ZCommandWebRef. Add the web reference to the project.

We can now create a new instance of the proxy class and when we invoke it's methods, we will be able to query and control the GX1.

private ZCommandWebRef.ZCommandWS zcommand = new Sample.ZCommandWebRef.ZCommandWS();

zcommand.GetDevices2Async(auth, "", "");

It is important to call the asynchronous version of the web methods e.g. GetDevices2Async instead of GetDevices2 because the non-async version will block the UI thread and make the application unresponsive until the method returns.

Below is what the compiled project looks like when run.

screenshot1

What are you waiting for? To see this project in action, download the source code now!