ZWN-RSM2 Create a new device type

If it is the Enerwave make sure configuration parameter 3 is set to 1. You can do this by going to “Edit Device” from within the SmartThings App on your phone. See this post. Don’t use the screenshot as a reference as I have parameter 3 set to 3 because I have the Philio. The enerwave needs parameter set to 1.

So should it look like this?

Yep that fixed it! Thanks so much for all you do! And thanks for always being patient! :slight_smile:

I have been using the default Z-Wave Device Multichannel device type with the default app using two end points. I created the new Device Type based on the code here and that went just fine. However, when I try to change the device type of a currently installed relay I get the error:

Error
500: Internal Server Error
URI
/device/update
Reference Id
4872066b-216f-4057-be8f-12006013ce04
Date
Sun Jan 17 14:30:22 UTC 2016

Anyone have any ideas?

@erocm1231, I’m using your Philio device handler and simulated switches as the device type, but when I try to set it up with the smartapp I’m getting a “Failed to save page: defaultPage” error. Is there anyone else who’s experienced this or is it just me?

It’s SubscribeToCommand() that’s causing the error for me, any ideas why?

I just tested adding it as a new SmartApp in the IDE and did not get an error. Set it up in the SmartThings app and did not get an error. Are you adding it as a SmartApp and not a Device Handler?

It goes in the IDE just fine, I’m getting the error on my mobile app when I’m actually setting up the relay. I can’t save the setup, I get the error when I click ‘Done’. I get the same error using Justin’s smart app.

I tried using your previous version of the app (Oct-15), and that worked fine. So I tried ‘upgrading’ the code by manually adding in your Jan-16 revisions part by part in order to find what’s causing the error, and that’s how I found that the SubscribeToCommand entries were causing the error.

ios or Android? I’m using Android and the process works for me. Also, is your android or ios app the latest version?

iOS app version v2.0.7 Jan-7-16. None any later than this.

I modified the initialize method in your code to the following, and it works fine for me -

def initialize() {
unschedule()
unsubscribe()
log.debug "Initializing Dual Relay Adapter v1.0.1"
subscribe(rsm, “switch1”, rsmHandler)
subscribe(rsm, “switch2”, rsmHandler)
subscribe(switch1, “switch.on”, switchHandler)
subscribe(switch1, “switch.off”, switchHandler)
subscribe(switch2, “switch.on”, switchHandler)
subscribe(switch2, “switch.off”, switchHandler)
}

my question is will this also prevent the issues you noted for using SubscribeToCommand?

Looks like it should work fine. Make sure you use the “Simulated Switch” for your virtual switches and let us know how it goes.

Before this I used Matt Frank’s smart app for my enerwave relays, but I kept getting random instances of the relay toggling on and off endlessly. I don’t know what manually triggers this behavior up to now, but I suspect the loop is caused by the code subscribing to event changes (toggling the switch causes an event change, which then by itself triggers another, and so on), not specific on/off states.

I’m using the latest version of your app now, the only modification being the one I noted previously. It’s working fine but it’s only been 2 days, so not sure if I’m in the clear. Do you think this new code prevent the issue I described above?

Yes, see post 78.

Yes I’m using your Philio device type and simulated switches as well. So the modification I made in your code doesn’t affect Justin’s fix?

I doubt it, it looks like just a different way to accomplish the same thing (as far as the subscription goes). The key to Justin’s fix has to do with using the onPhysical() and offPhysical() commands of the “Simulated Switch” These commands change the status of the virtual switches without actually causing the SmartApp to turn lights on and off.

unfortunately the issue popped up again, the switch kept toggling on and off after I pressed the wall switch. Any thoughts on why the app randomly behaves this way?

@jondave Can you post the log output when you do the following:

Flip switch1 on, wait one minute
Flip switch1 off, wait one minute
Flip switch2 on, wait one minute
Flip switch2 off

I have read this thread over and over again and I can not seem to get this Enerwave ZWN-RSM2 Device Dual Relay to work.

This is the second device I ever purchased and figured ST integration would be simple. ::smile:

If someone could point me to or some pointers on the dummies guide to getting this device working, I would greatly appreciate it.

I have created from Eric’s Github code, the My Device Handlers for the Philio PAN04 Dual Relay from the philio-pan04.groovy file.

I then created the My Smart App from Eric’s Github code, dual-relay-adapter.groovy.

Made the changes in the code:
preferences {
section(“Configuration:”) {
input “rsm”, “capability.switch”, title: “Which Dual Relay Module?”, multiple: false, required: true
input “switch1”, “capability.switch”, title: “Virtual Switch to link to Switch 1?”, multiple: false, required: true
input “switch2”, “capability.switch”, title: “Virtual Switch to link to Switch 2?”, multiple: false, required: false
}
}

Changed “Virtual Switch to link to Switch 1?” to “Simulated Switch” for both switches 1 and 2.

Then pressed Create, Publish, For Me.

No errors reported. From here I try to Connect a New Device, name the device, then when it goes to the SmartApps portion of the new install, I don’t see the erocm123 : Dual Relay Adapter SmartApp like I do in the IDE. All I see is the Top SmartApps.

Not sure I am even correct to this point…

TIA

You don’t edit anything in the code. You have to create 2 simulated virtual switches in IDE and during setup of your dual relay adapter smartapps. It will ask you to select those switches.