ZWN-RSM2 Create a new device type

@michaelahess I would be very curious if their device type will report that the switch has been changed when you toggle it at the wall. From just glancing at it, it does not. Another reason that I don’t think it does is that the handler never sets parameter 3 so anyone that uses that type won’t ever have that parameter changed.

@michaelahess @mmarlette I am working on a generic “Dual Relay” device handler that will have the ability to determine whether the Monoprice, Enerwave, or Philio devices are in use and will show the appropriate tiles and set the appropriate config parameters automatically. I don’t have an estimate of when I will be done though.

That would be awesome. Really appreciate your efforts.

Not sure how comfortable you are with soldering. I removed both relays in the emerwave dual relay module and use the module to control external 12vdc relays for dry contacts. It’s much cleaner and relay clicking.
One of this module is controlling my Energy recovery ventilation (ERV) high/low.

That will be sweet! I used your code to set param 3 then switched to that code, it seems to work as yours does but I haven’t compared how quickly it updates, just that it did. I will keep using yours for sure, just wanted to see what they’d put up. I also noticed the ZWN-SC7 has code from Matt Frank. Figured maybe they took a trimmed down version of yours.

Ray- IPC J-STD-001 certified, work in a clean room, doing test development for mil spec electronic assemblies for day job.

Good to know, haven’t hacked in to it that far yet. So I am assuming you are powering it 120 VAC and then interface with a 12vdc device as that is the current coil voltage?

I did take the unit apart and look at it. Pretty simple and a nice device. I am VERY strong hardware with software background. Groovy is not one I am verse in…as you can tell… :smile:

@erocm1231- Their device type DOES NOT report the AUX1/2 switch changes. Been a travel day so I am going to try and find the parameter 3 configuration page. I swear I tried to find that setting.

The new generic dual relay device sounds GREAT! Let me know if you need testing done when the driver is ready. I bought a dozen of these devices, so have plenty to test on.

Now I am going back to getting the baseline configuration settings correct…

I give, been trying to get eric’s driver and smartapp working on my Enerwave ZWN-RSM2 device with no luck.

Again this is my only second device and the first one worked fine out of the box. So I am obviously doing something wrong on the setup and configuration. I have read and re-read this thread and taken the suggestion of others here.

Currently I can not get relays to respond at all and when I try and change the parameters like msg82/83 screenshot. I am unable to enter anything in the Which? It will not allow entry.

I apologize in advance for this long post but here is my process, I tried to document the steps.

Any advice would be much appreciated. I don’t understand all of the terminology of names, etc. To tie things all together, yet. Will be working towards a greater understanding.

How to integrate the Enerwave ZWN-RSM2 Device Dual Relay Device into SmartThings

Download from GitHub’s erocm1231 Eric Maycock’s distribution Link:

Most of this information is contained throughout the thread at:

The (MSG##) referred to below are taken from the above forum and message numbers that relate to this

(MSG71) starts the explanation of Eric’s install.

In summary per (MSG75) you need to set up the following:


2 Virtual On/Off Button Tiles1 Relay device of type Philio PAN04 Dual Relay


Dual Relay Adapter

This is the procedure to create the above devices and SmartApp.

Using windows explorer, open the directory Eric’s Github folder SmartThings-master, then Philio_pan04,
following with the web IDE smartthings web pages.

Before you can pair the Z-wave device with the hub, you need a driver.

  1. (MSG72) Adding in the new device type, Philio PAN04 Dual Relay
    a. Right click on file philio-pan04.groovy open with NotePad++
    b. In IDE select your My Device Handlers tab, click on ‘+ New Device Handlers’
    c. Select the ‘From Code’ tab
    d. Copy/Paste all the code from NotePad++ into the IDE box
    e. Then press ‘Create’

  2. Pair device to SmartThings Hub.

  3. In IDE, verify that the Enerwave ZWN-RSM2 device handler is correct.
    a. Goto the My Device Handlers and select the Enerwave ZWN-RSM2 device, Edit.
    b. verify ‘Type’ is Philio PAN04 Dual Relay, if nt select drop down combo and change it.
    c. Select ‘Update’
    d. This should change the device’s driver to Eric’s.

  4. Create 2 new virtual devices in the IDE, device type should be simulated switch.
    a. My Devices,
    Name VirtualSwitch1 VirtualSwitch2
    Label Enerwave Aux1 Input Enerwave Aux2 Input
    Type Simulated Switch
    Version Published
    Device Network Id xyz123 xyz124 (random, just make it unique)
    Status ACTIVE
    Hub Delano Hub Delano Hub
    b. Create, then repeat for VirtualSwitch2

  5. Change device parameters.
    a. My Home, Things, Select the ZWN-RSM2 Dual Relay
    b. Edit Device
    c. Which? Was unable to change to anything like in MSG82
    d. Parameter Number: 3
    e. Parameter Value : 1
    f. Press ‘Done’’

  6. Create the smart app from Eric’s code in IDE:
    a. Right click on file dual-relay-adapter.groovy open with NotePad++
    b. In IDE select your My SmartApps tab, click on ‘+ New SmartApp’
    c. Select the ‘From Code’ tab
    d. Copy/Paste all the code from NotePad++ into the IDE box
    e. Then press ‘Create’
    f. If no errors are returned, press ‘Save’, ‘Publish’ and select ‘For Me’

  7. Install the smart app to the device on MOBILE app:
    a. Set the location to installed location, if more than one location exists.
    b. Marketplace(lower right icon)
    c. You should see 2 Not Yet Configured.
    d. Select the SmartApps tab, you should see Eric’s Dual Relay Adapter SmartApp
    e. Select
    f. Which Dual Module? ZWN-RSM2 Dual Relay Module (from step 2 above)
    g. Virtual Switch to link to Switch 1? Enerwave Aux1 Input (from step 3 above)
    h. Virtual Switch to link to Switch 2? Enerwave Aux2 Input (from step 3 above)
    i. Assign a name : Enerwave SmartApp
    j. Done
    k. Should get a confirmation banner across top of the screen indicate it was successful.

At this point the device should function. My Home, Things, ZWN-RSM2 Dual Relay

Tiles are:

Outlet1 Outlet2 Refresh First Row
– – reset kWh Second Row
Configure Third Row

@mmarlette If you want to try the generic adapter, it may work better for you. I am not finished with it yet so you will still have the energy and power tiles. After changing to it in the IDE, go into the device preferences and choose “Enerwave”. This should send the proper config parameters. If it doesn’t work on the first try, hit the little configure icon in the app.

@erocm1231- I removed the smart app, installed new device_type driver from github for your generic dual relay, created, saved, published for me. Went then to my devices, edit, changed the driver from the philio to generic dual relay, update and get the following:

		Oh No! Something Went Wrong!	
		Error500: Internal Server ErrorURI/device/updateReference Id741c17eb-3012-4c25-83d2-1acf5621ee6aDateWed Feb 03 15:33:31 UTC 2016

I can change the device_type to Enerwave’s latest driver_type published on their web site with no problems and functions fine except with no status updates from the switch inputs.

@mmarlette I have tried to replicate your issue, but cannot no matter what I try. Just to be certain, you get the error when you go to the device in the IDE and try to change the device type it is using from the Philio to the Generic, right? Once you hit update the error is thrown?

The only thing I can think of is if it it wasn’t copied and pasted correctly. There really aren’t that many differences between the generic and the Philio at this point. Just an easier way to update the parameters. Try the raw link for easier copying and pasting:

@erocm1231- I tried it both ways, one from the raw and then one from a .zip download of your GIT Smartthings repo. Did a Kdiff3 on the two. It reported that the text was the same but the binaries where different. That appears to be the method of the linefeeds, repo is Linux format, raw is in DOS format. Both produce the 500 error, and you are correct on how I updated and when the error occurs.

Very strange, others can get the Philio working and following the thread it should work and it does not. I am really not this bad with new things. This on the other hand has been getting me on every turn! I am at a loss as well.

Can switch to other device type with out the error so it sure appears to be in the generic device_type dual relay driver…

Thanks for your help so far. Looks like I will be the crash dummy when you get code completed. Works for me it will work for anyone. :slightly_smiling:

@erocm1231- When I go to the Device Type Setting in the IDE after I create, save, publish the device_type. The button right next to IDE Settings at the top. The fingerprint is listed as None. Not sure if that is a problem or not but the Philio, Enerwave and most of the other devices have fingerprint info listed.

@mmarlette the fingerprint info is optional so it wouldn’t be causing a problem. All references to the error that you are seeing are related to issues on the SmartThings servers. They are reporting developer tool issues on I can’t think of anything else it would be. By the way, are you using a Linux computer?

LOL :smile:

I am not on the Linux platform. Windows7 x64.

If I have more than one monoprice dual relay, do I have to install more than one instance of this smartapp? I only had one instance of it, but when I tried to have 2 relays, neither worked

Yes one instance per relay. I have 4 relay’s, thus four copies of the smartapp.

Is there any way to have each relay in the dual relay to list as a separate thing rather than having to go into the thing to control each switch?

Many thanks in advance

Yes, by using virtual tiles. It’ll show up as 3 things but you can have a tile for each relay that way. For i have 3 ceiling fans each with these duel relays in it. Each has a virtual tile one for light one for fan. So I have 3 duel relays, then 3 lights and 3 fans. This allows me to creat modes for just fans or just lights. I even have another virtual tile for all fans and all lights.

Yep, exactly as @tail24 described. I do recommend using this other device type for this switch. In this thread is also a mention of the virtual switch thread and an app to keep the physical and virtual switches in sync.

I’m using this and it works pretty good for the most part. I can use the physical switches to turn things on and off and use the app to turn them on and off. When I use the app, it shows that the device is on. However if I use the physical switch to turn it on, the app never gets notified and continues to show the light as off. This is a huge problem. If the physical light switch is on and and the app shows its off, if I then use the app to ‘turn on’ the light. It actually turns it off. Now that the light is off, if I physically turn the switch from the On position to the Off Position, it turns the light On. This is pretty confusing and I have no real way of knowing what state my light is in unless I walk outside and look at it. :frowning:

Since the relay is actually turning the lights on and off using the physical switch, shouldn’t it know what state it is in and be able to update ST with that?