Virtual Z-wave Switch

  • 65 Views
  • Last Post 12 March 2013
Axial-User posted this 19 February 2013

When InControl is told to turn the device off, it'll call either [i]setPower [/i]or [i]setLevel[/i]. When this happens, be sure to find the device in your local list and update the level accordingly.

Thanks - I think it is this part that I'm not doing correctly. I'll have another go when I get a chance tomorrow.


How is your virtual device controller coming along?

Order By: Standard | Newest | Votes
Ryan-Scott posted this 20 February 2013

Is it at all possible to create a virtual z-wave switch that another controller on your Z-wave network can turn on or off? I am trying to get an alarm system to integrate with InControl. The alarm system can turn z-wave switches on and off based on sensor events (i.e. a door opening). InControl can monitor the switches and perform actions whether a switch is on or off.

It would be great if I could create a virtual switch for each sensor, but I'm not sure if this is even feasible.


Right now it's not built into the program yet, but it would actually be super-simple to create a plugin for this type of thing. I've added it to my Trello list, but if someone beats me to it in a plugin, let us know in the forums.

jonfrance posted this 20 February 2013

Right now it's not built into the program yet, but it would actually be [b]super-simple [/b]to create a plugin for this type of thing.


This is similar, if not the same to the "logical switch device" I mentioned in a previously thread. I started to create a plug-in using your IP Camera code as a basis, however not being a C# programmer the "super-simple" plug-in isn't so simple to me!
I got as far as being able to add the custom switch devices which turned on/off, however I'm missing something somewhere because when I check the value of the switch it remains at 0 when both on and off. I need to devote some more time to "play" around some more. Any quick guidance?

Ryan-Scott posted this 20 February 2013

Right now it's not built into the program yet, but it would actually be [b]super-simple [/b]to create a plugin for this type of thing.

This is similar, if not the same to the "logical switch device" I mentioned in a previously thread. I started to create a plug-in using your IP Camera code as a basis, however not being a C# programmer the "super-simple" plug-in isn't so simple to me!
I got as far as being able to add the custom switch devices which turned on/off, however I'm missing something somewhere because when I check the value of the switch it remains at 0 when both on and off. I need to devote some more time to "play" around some more. Any quick guidance?


Without seeing the code, it's hard to get too specific on the guidance, but here's what I can suggest:

The flow of when a device is tracked is important. When your controller starts up, you should not add any devices to your local device list. Instead, wait for InControl to call the [i]trackDevice[/i] method on your controller before you add it to your local list.

When InControl asks for a device using [i]getDevice[/i] (or any other similar call), be sure to return the device from your local list.

When InControl is told to turn the device off, it'll call either [i]setPower [/i]or [i]setLevel[/i]. When this happens, be sure to find the device in your local list and update the level accordingly.

jonfrance posted this 20 February 2013

When InControl is told to turn the device off, it'll call either [i]setPower [/i]or [i]setLevel[/i]. When this happens, be sure to find the device in your local list and update the level accordingly.


Thanks - I think it is this part that I'm not doing correctly. I'll have another go when I get a chance tomorrow.

Axial-User posted this 20 February 2013

Wow, this all sounds amazing. I have been brain storming a way to integrate my current alarm sensors into InControl (since buying all new motion and door/windows sensors for my whole house would be super expensive). These virtual switches would be the answer.

So, before I start spending a bunch of time trying to see if I can learn c# enough to pull this off (I'm much more experienced in Java and Python ), I just want to make sure this will work. So these virtual switches that I create with InControl will be able to be controlled by another controller on my Z-Wave network?

jonfrance posted this 20 February 2013

So these virtual switches that I create with InControl will be able to be controlled by another controller on my Z-Wave network?


I'm not sure that what I'm attempting to achieve is quite what you are looking for (after re-reading your posts).
The purpose of the virtual switch that I’m creating is so a custom application (which is integrated with other controls/devices NOT z-wave compatible running on my PC) can be integrated with InControl. As you are able to switch devices on/off from the command line and query a devices state (control from external) and execute custom code when switched internally from InControl (trigger back to external app), this will be my simple method of integration. I’m not really working with virtual z-wave devices such that a z-wave controller can interact with them. That sounds a little advanced for me, certainly in C# (which is not my language of choice either).

Ryan-Scott posted this 20 February 2013

Wow, this all sounds amazing. I have been brain storming a way to integrate my current alarm sensors into InControl (since buying all new motion and door/windows sensors for my whole house would be super expensive). These virtual switches would be the answer.


Is there a way via an API or SDK to interact with your current alarm sensors?

Axial-User posted this 20 February 2013

Is there a way via an API or SDK to interact with your current alarm sensors?


I've looked all over and not from what I can tell. It's a GE Simon XT. It currently has a Cellular / Z-wave module installed, but can only interact with Z-wave through the alarm.com service. It is currently a secondary controller on my network. The only integration I have been able to accomplish is:

1. Physical switch (plugin lamp module) - When I arm the alarm, it turns on a physical switch. I have a rule in InControl that monitors that physical switch and performs actions based on its status.

2. Email alerts - The system can send out email notifications when a sensor is tripped. I have built an application that monitors the email account and performs actions based on it's contents (this can be slow based on how long it takes for the email to arrive).

3. Alarm.com "push" notifications - Tasker setup on an Android device to monitor these notifications. Perform an action based on notification contents. (for some reason this is about as slow as the email notification.

The only option that has been responsive enough has been option 1, but to buy a physical switch for each sensor kind of defeats the purpose. This is where a virtual switch would come in handy.

Axial-User posted this 21 February 2013

So Ryan, is the way I'm hoping to implement the virutal z-wave switch possible? Right now when I add a z-wave device with my Aeon stick, it also shows up in my alarm system (because it is also a controller). If I create a virtual switch in InControl, would it do the same?

Ryan-Scott posted this 22 February 2013

So Ryan, is the way I'm hoping to implement the virutal z-wave switch possible? Right now when I add a z-wave device with my Aeon stick, it also shows up in my alarm system (because it is also a controller). If I create a virtual switch in InControl, would it do the same?


The trick will be to get InControl to know that you've done something with the other controller then to catch that and use it as a trigger to turn on/off one of these virtual devices.

I'm not sure how you'll tell the controller to notify InControl; though I suppose if you had it associated with your USB stick, InControl would probably get the notification of either on/off and you could go from there.

Axial-User posted this 22 February 2013

The trick will be to get InControl to know that you've done something with the other controller then to catch that and use it as a trigger to turn on/off one of these virtual devices.

I'm not sure how you'll tell the controller to notify InControl; though I suppose if you had it associated with your USB stick, InControl would probably get the notification of either on/off and you could go from there.


Well, when I add a physical switch via InControl it shows up in my list of devices on my alarm system. So then when I activate the switch on my alarm system, and InControl polls the device, it sees that it is on (or off). I'm hoping that adding a virtual switch in InControl will have the same effect on the alarm system. If it is seen on the network as a real Z-wave switch then it should.

Ryan-Scott posted this 22 February 2013

Well, when I add a physical switch via InControl it shows up in my list of devices on my alarm system. So then when I activate the switch on my alarm system, and InControl polls the device, it sees that it is on (or off). I'm hoping that adding a virtual switch in InControl will have the same effect on the alarm system. If it is seen on the network as a real Z-wave switch then it should.


Unfortunately, your alarm system definitely won't know about the InControl virtual switch; it'll only be known by InControl.

Ryan-Scott posted this 11 March 2013

When InControl is told to turn the device off, it'll call either [i]setPower [/i]or [i]setLevel[/i]. When this happens, be sure to find the device in your local list and update the level accordingly.

Thanks - I think it is this part that I'm not doing correctly. I'll have another go when I get a chance tomorrow.


How is your virtual device controller coming along?

jonfrance posted this 12 March 2013

How is your virtual device controller coming along?

For the most part it was working, however I did keep getting an error in the log each time I switched it. Something to do with not found dictionary key. Not sure what I was doing. I downloaded the new version last night and your plugin in exactly what I was trying to achieve, so thanks!

Close