Building a Z-Wave dot net client in 3 minutes
I actually finished this last weekend. I'd suggest, you can grab the latest version of the WCF server.
I'm working on a server which is written in .net that can be communicated to over WCF. This should give an easy way to control Z-Wave through c# or vb.net.
I've got an early release of a Z-Wave server which can be accessed via WCF. I've written the basic server in dot net that can control simple nodes such as lamps, dimmer and binary switches. I've uploaded it, which I've called Niviane. You can download the installer or full source for it and start to see what it's all about.
Just to show how easy it is with this approach, watch this video. I install the server then create the most basic of clients which communicates with it. I've edited the screen capture to show the result of each of the statements to give a clear picture of what's going on. It should be clear - I hope!
I've also posted the code in the comments below. Just copy and paste it in to a new console application, once you've added a service reference.
I've a few plans and tweaks such as REST/JSON interfaces (edit: which I've now completed).
Let me know how you get on. I've not had a chance to really test it properly yet, so I'd appreciate some feedback.
6 Comments
Elmstrom said
Great work, i want to play around with that as soon as i get some spare time :).
It would be easiere if you just postet the code in text, since you dont really add any voice over on the video any way.
oliver said
Elmstrom, the video is intended to show how quick it is to write a client. When you add a reference to the service, and instantiate it you'll see how easy it is to write your own code.
I'll put up more details soon.
oliver said
using (ServiceReference1.NivianeClient client = new ServiceReference1.NivianeClient())
{
while (client.IsNetworkReady() == false)
{
Console.WriteLine(System.DateTime.Now.ToLongTimeString() + " waiting for network");
System.Threading.Thread.Sleep(1000);
}
client.SetNodeBasic(2, 255);
Console.WriteLine("Node 2 is on");
Console.ReadLine();
client.SetNodeBasic(2,100);
Console.WriteLine("Node 2 is dimmed");
Console.ReadLine();
client.SetNodeBasic(2, 0);
Console.WriteLine("Node 2 is off");
Console.ReadLine();
}
Justin Coon said
FYI your download is broken. Also what hardware does this support? I have a ControlThink ThinkStick..
thanks
Justin
oliver said
Justin I have an Aeon Labs Z-Stick. Newer download links can be found here;
http://www.oliverjenkins.com/blog/niviane-a-rest-json-interface-for-z-wave-home-automation
william said
Recently home automation and smart home products have become much more popular. Check out http://sabinessmarthome.com to stay up to date.