New Virtual Switch Request, Whole House fan speed control Hi/LOW


(Greg Caulder) #1

I have a rather interesting request to possible get some help in making a virtual switch to control a whole house fan using 2 zwave switches. Each switch would be wired to control the High and the Low wires on the whole house fan. What I need it to do, is it can only have one switch ON at any given time. Is this something that can be accomplished easily, can anyone provide any assistance as to how I can do this, or if anyone has a custom device type, or a custom SmartApp that can accomplish this, it would be very appreciated.


(Bruce) #2

You want a method that treats the fan as a device that can be turned to Low, High, and Off (while actually controlling the two z-wave switches). You can do this with Hello Home phrases in the mobile app.

One phrase would turn the fan to low, another to high and a third turns it off. Those phrases could be activated either right in the mobile app, or through a web dashboard like ActiON. Alternatively, you could use a Minimote remote (4 buttons each with two actions) to activate those phrases, like a button for low, another for high, and a third for off.

There are other ways this could be done as well, depending really on how you want to control it. But without doing anything special, the Hello Home phrases will do the trick. The phrase for low turns off the high switch, and vice versa. It might not be good to switch directly from low to high, or back, because you couldn’t be sure of the relative timing of turning one switch off before the other turns on. But, if you just want to go from off to either setting, that wouldn’t be an issue. It would take a custom smartapp to directly manage the timing if you really need to transition from one setting to the other, without turning it completely off first.


(Mike Maxwell) #3

Electrically how is the existing delio setup?, pictures?, schematic? If you’re looking to replace a physical switch that has a center off position, then using two separate zwave devices is asking for trouble, and is also more complicated than it needs to be. An exclusive on situation implies to me that some double pole switch is in charge of the current setup…


(Greg Caulder) #4

Here is an image of a possible diagram using a single pole double throw relay with a 120V AC coil. I do not wish to use this, as there is no need. Simply becasue the virtual switch i am looking for can take full operational control of the situation without the need of the relay.

So that at any given time only ONE single switch configured for the device can be on the ON position. And the OFF position would mean that both switches are in the OFF position.

Let me know if this makes since.

http://board.homeseer.com/attachment.php?attachmentid=27741&stc=1&d=1305645088


(Greg Caulder) #5

This is not what I mean. The fan motor has 4 wires to hook up. Ground Nutral, N/O (Fan High), N/C (Fan Low).

I need it to somewhat act sort of like a dimmer, for Low High and off control. But in actuality it is not a dimmer. Just the interface to the device will sort of appear to look that way.

The device would look very similar to this special device type someone made, but there would only be two three speeds. OFF, LOW, and HIGH.

The switch to turn it on and off can be ideally configured to default to HIGH or LOW in a preference preferably.

Let me know if this makes since.


(Mike Maxwell) #6

Yea, You can’t do this with just two zwave switches and no relay. You do not have absolute control over when each of them turn on and off. In other words despite whatever smart app/device you write for this, in the end you cannot dictate exactly when the devices will change state, there is risk of both being on at the same time. The reason the homeseer circuit works is because one switch is being used to control the speed, and the other is an enable function. With that circuit there’s no way for the fan to be energized high and low at the same time, and the timing as to when these switches change state is not important.

You cannot do this with just two zwave single pole switches and ST logic.


(Bruce) #7

You should look at this thread: ZWN-RSM2 Create a new device type

That’s a z-wave double relay that could be wired directly to your fan, and controlled through ST.


(Mike Maxwell) #8

That’s a two channel single pole zwave module, which would still require a relay in his application.
Not a single channel double pole.
What he needs is a double pole double channel dry contact zwave module.

Or a two channel single pole with a relay, or as per the other schematic, two separate zwave switches and a relay.
Or he could get an arduino, a thing shield and a two channel spdt relay board.


(Greg Caulder) #9

So your saying that the function that does the switch changing of states cannot be program to wait for a returned status of a successful switch off to then cycle the alternate switch to the on state?

This just doesn’t make since to me. Is there not a wait to get the status of if a switch was successfully switched on or off?

And setup a polling to check the two switches to make sure if both are on, that it turns one of them off.

Bruce just provided a link to a dual zwave relay switch. This is just the two switches that I could use separate into one actual unit. Would this work in returning status the same way as two separate switches?

Can someone provide a link to a great relay then, that would allow for easy hook-up to 14 or 12 gauge wire that can take 10 amps load? Well not a great relay, the proper relay with easy connections, i looked on the internet, and found a bunch, but not many ones that have easy connection hook-ups to easily connect romex wire too.

Possibly this, but how would I connect 14 gauge wire to it: http://www.amazon.com/dp/B0071NAZT0/ref=biss_dp_t_asn

Or get this relay, along with this blade block style hold down clip:
http://www.thermaldevices.com/products/shopping/productdetails.asp?id=745&subcategoryId=49&categoryId=6
http://www.thermaldevices.com/products/shopping/productdetails.asp?id=765&categoryId=6&subcategoryId=138


(Mike Maxwell) #10

You can write code to do what you want, however there is no absolute guarantee that the device state as reflected in ST will be the actual device state. Now 99.(some) odd percent of the time this is true. However for me with 70 odd devices probably once per week a device will have the incorrect status in ST (on when it’s off, or off when it’s on). You may be able to write an app to completely defend against this, but do you want to take the risk of burning out that motor (or more likely setting your zwave switches ablaze) if it doesn’t work that way?

Something like this:


You are looking for a 120vac SPDT open frame relay, the above is DPDT but it will work.
This relay will have to be mounted within an enclosure for obvious reasons.
If you were inclined to invest in some simple tools, you have a greater selection of enclosed relays (no enclosure required) that have push on terminals that you would solder your solid wire to.

You don’t have a buddy that’s handy with this sort of thing?, no offence, but given the questions, might this be a little out of your comfort level?

Also the relays inside most zwave devices are very small, so the contact surfaces are very small and they aren’t usually designed to handle inductive (motor) loads, so even if you did manage to code around the problem, it’s likely after some period of time that one or both of your relays would weld it’s contacts together (and thus be on all the time) and no code is going to help here. This is also possible with the SPDT relay I’ve linked, but this would only result in one speed being available when activated…


(Greg Caulder) #11

I understand what your saying now.
Looks like i will need to still go with a relay.
But I would still like/need a virtual device to be able to control the unit how I described before. (I’m already going to be using heavy duty Z-wave relay switches, so burning the switches out wont be a problem.)


(Aaron) #12

You could use real switches. One would be on/off and the other would be a speed selector. They would be separate ‘things’ in the thing view but you could create a ‘Attic Fan’ group of the two switches which would create the experience of one ‘attic fan’ item, that, when touched, would present the 2 buttons . . . . . which may be what you are after.


(Greg Caulder) #13

This is not what I’m after really,
I want to be able to select ON for the device, and have a preference as to what the default on state is, HI/LOW, then have a button to change the devices speed, with HI and LOW, and the virtual device changes the switches on and off accordingly, from preferences as to what switch i specified for the Hi and LOW switches are.

I don’t want a work around, I would like some assistance is now to accomplish this. I am a PHP developer, and Groovy is foreign to me, and I am trying to learn it so I can write it on my own, but I need some assistance.


(Aaron) #14

OK. Here’s another idea. Use the electrical circuit you linked to early on (this is how you need to approach this electrically). Use 2 virtual switches and group them together in the things view in a group called ‘attic fan’. One switch stores the speed selection (preference) and the other is the on-off switch. Create a SmartApp that watches these switches:

on-off switch turned on: check the virtual speed selector switch state and energize the relay if necessary. Then, turn on the Z-wave switch controlling the power to the fan. Plan on imposing a little bit of time delay after switching the speed relay (if you do).

on-off swtich turned off: De-energize power switch. Wait a moment, then de-energize the speed selector (if it is energized)

Speed selector virtual switch changes state: If the power is off, ignore (do nothing). If the power is on, go ahead and change the state of the speed selector relay (you might just check to make sure the motor can change speeds under power . . .I’m pretty sure this is OK)

The only coding would be the SmartApp. I suppose you could make a custom virtual switch device type by tweaking one to say 'high, low" instead of on-off . . maybe an icon that makes more sense also.

I think you could also make this really difficult by doing this with a SmartApp that spawns child devices for the 2 virtual switches. I don’t know much about this approach or how it would impact the overall experience.

In any case, all the knowledge and examples are here in the community and the IDE. Just do a little digging. . . .


(Greg Caulder) #15

Just do a little digging, that is what I have been doing for quite a while.

Never the less, it just sounds like no one is going to provide me any basic points for anything, so I will just have to tackle this myself, and learn on my own.

Step 1: Create a new virtual device where i can specify what switch is LOW and HI
Step 2: find out how to create and display how i want my virtual devices tiles to look like and what they layout should be
Step 3: figure out how to link a on off button to do some kind of action or execute some kind of function

Yes, these may just sound like something super simple. But I just need a framework of how a skeleton structure for a virtual device is needed so I can fill in all of the gaps.

I got the relay today, and will be wiring it up tonight, and manually turning two switches on to test. Then i will get back to actually writing an app that makes it operate how it is supposed to with the hardware that has been assembled.


(Mike Maxwell) #16

Folks have given you all kinds of advise to date, not sure why you feel like that’s not the case.
I doubt that anyone’s going to write this for you, but who knows.
There are virtual switch device types examples in the IDE.
You may want to start by reading all the developer documentation.
There’s also some videos on how to use the IDE.
There exists a certain learning curve you have to get through before much of what folks are talking about will make sense.
Unfortunately, you just kind of have to drive through that at your own pace.


(Greg Caulder) #17

Again I have, but telling me to look, when I have clearly looked gets me where? Nowhere.

So I have dug further into this.
Is it my understanding that i am going to have to create my own Device type to get the device tiles to look the way i want. And also have to write a SmartApp to get it to function the way I want? Or is it possible that I can do it all in a Device Type instead?
Please provide spinets of code and not just say to look. How can i directly set a preference in a virtual device type to be able to specify a physical LOW switch and a physical HI switch?


(Mike Maxwell) #18

First off, other than the relay I have no idea what zwave devices you’re using.
Secondly, there’s documentation links all over the place when you login to the ide, and the link for that is on the main pages.
You can only have one physical device per device in the IDE.
Also, this is not a simple project from a development standpoint, you’re not going to get this working tonight…

You’ll need two virtual switches, one for high and another for low. Your smart app will subscribe to these, then send commands to your actual zwave switches connected to your relay. You won’t actually use the device tiles for the actual zwave switches.
The smart app functions as a proxy for the zwave switches, allowing you to intercept/translate/apply logic/whatever to the commands you receive from your high and low virtual switches.
If I had any code that already does what you want, I would have already given it to you.


(Aaron) #19

Look at ‘On/Off Button Tile’. It looks like it would be easy to make a version of this that would display high/low instead of off/on. Use a standard on/off button tile and one customized for high/low and group them in a group called ‘attic fan’ This will give you a button in the things view that would open a screen with just the speed selector and the on/off buttons.

Yes. I laid this out for you in an earlier post based on how I know it should probably work electrically and how I think you want the UI to work. I’d code this for you or, at least, start it for you if I had time . . . .which I don’t at the moment. Its a pretty straightforward app, I think, and would be a good learning project for someone not familiar.

No. You have multiple virtual and real devices here so you need to pull these together in the application layer (Mike explained this in one of his posts).

Do this if you want to fry the motor. If you don’t, use the circuit you linked to at the top of this thread. You will have a physical relay switching between the high and low motor leads in series with z-wave switch controlling the power directly. the second Z-wave switch will be controlling the relay.

If you approach this as I have suggested, you will use the preferences dialog in the SmartApp to point to the 2 physical z-wave switches you will use and the 2 virtual switches (On/Off Button tile and your custom version for high/low). These switches will need to already exist (have been added) as things on your system when you first run the SmartApp.

BTW, I think there is a way to get the SmartApp to ‘spawn’ the virtual switches you will need but I don’t think you want to go there . . .


(Greg Caulder) #20

Wow, Okay, gives me a good direction to head to, thanks.

Well I think that what AARON said originaly might just be easier to do, honestly. Creating all of these virtual switches and having to write an app to make it just look pretty and simple just seems like a Rocket is used when a candle should be used instead.

I got the relay yesterday, and spend about an hour wiring everything up with some simple test ZWave switches i had sitting around. And it worked perfectly. Spend an hour working on it, and my wife was wondering what I was doing. When I showed her, she was like, THAT IT, that is all that it does. I had 2 lights hooked up to it where the Fan connection HI/LOW wires would be. So it looked pretty dumb. But I told her that only one wire can be live to the fan, otherwise the fan motor would be destroyed. And the Relay guarantees it.

All in all, I was very proud that I did that.

I will need to wait to get the Whole House fan before I am able to hook anything up. Still trying to decide if it is really necessary to make a custom virtual switch and SmartApp.

But I could do something fancy, that will only allow me to turn on the whole house fan based on how many windows are open in the house with window sensors. Say LOW is only allowed for X open windows, and HIGH for Y number of open windows. So many things to think about.