ZWN-RSM2 Create a new device type

@tail24 Sorry for the delay.

I used the virtual device type code and created a device type using it for each tile I wanted for each control device.
For me
1 virtual device for dining room light
1 virtual device for dining room fan
1 virtual device for living room light (actually is 2 lights)
1 virtual device for living room fan (actually is 2 fan)

Then I used the aeon power strip binder app modified it from 4 relays and to select multiple devices to two, I also had to change compatibility to “switch” from “Switch” then installed it for each for each virtual switch tile above selecting which relays it would control.

I found all the code in the forums and in the examples in “My Device Types” and “My Smart Apps”

Let me know if you need more info.

I’m using Matt’s code along with a new custom smart app for associating the two load switches with standalone devices which can be integrated with other SmartThings components for automation, etc. I made only minor updates to Matt’s code, trying in vain to work around the same Android bugs he saw… still no real luck. However, it all works, and by integrating with On/Off Button tiles, for instance, you can avoid using the device UI directly, and instead control the loads as separate lights, etc.

To use:

  1. Associate the RSM2 as normal - it will initially show up as a Zwave Switch

  2. Via the SmartThings IDE:
    a. Create a new device type, pasting in the device code from the above repository
    b. Change the device type for your RSM2 to use the new device type just added
    c. Create a new Smart App, pasting in the Smart App code from the above repository
    d. Create two new devices, each of the type “On/Off Button Tile” (you could use other switch-like devices, but these work well for me). These will be your virtual devices to represent and control the two loads on the RSM2 independently

  3. From the SmartThings mobile app:
    a. Add an instance of the new app from “My Apps” in the GUI.
    b. Configure the app with the three devices referenced in step 2b and 2d above

Now you can control both loads as if they were single switches.

  1. (optional) Edit the “Lights and Switches” settings to add new dashboard elements associated with your two On/Off Button tiles

Notes:

  • When controlling via Zwave, the status of the loads should update relatively quickly throughout the system.
  • If you hook up external switches to the “aux” inputs 1 and 2 of the RSM2, the status of load #1 will update more “real-time” than load #2. Consider this when choosing which output to use for a given load. The Enerwave device only sends an unsolicited report for load #1, which prompts a poll to get the status fairly quickly (<~10 seconds). However, Load 2 physical state changes do not send a report. To get around this, my smartapp schedules a refresh every 1 minute, which eventually filters through the system. This seems to be the most granular timing SmartThings will really support at this time.
4 Likes

Hi Joel,

Thanks a lot for sharing this with us. I am somewhat new to the all z-wave thing. I used to have my home on X10 and recently upgraded to z-wave switches and obviously using the ST hub. I followed your steps carefully but I am stuck at step 1.d (creating 2 switches). The 2 new switches require a device ID. What do I use for these fields? I tried (out of desperation) to use the same ID as the RSM2 but, as expected, the value was rejected… Any help would be great!

Thanks,

h

You can put whatever you want. For me i did LR001 and LR002, DR001 DR002 etc etc

Hi Matt,

It worked! Thanks a lot! Why didn’t anyone publish this as a “public” app and device type? Or a better question would be: why isn’t ST updating their device list for this device?

Anyhow, thanks a lot all of you for making this work!

h

1 Like

ST just doesn’t support dual relay, not sure why. :frowning: As for publishing, it wasn’t mine to start with plus I’m not sure it’d get approved because although it works properly if you use it as it is above, the device type by itself is buggy.

I started a github about a month ago. This device type and smartapp can now be found at https://github.com/mattjfrank/ZWN-RSM2-Enerwave-Dual-Load

1 Like

Hi guys,

I am using this code with MonoPrice dual relays but whenever I use the wall switch Smartthings loses the correct status meaning they are very unreliable. Can anyone suggest a workaround for that?

Did you figure this out?

Just saw this reply , no any time I use a physical switch I do not get the proper status updated in the app.

You have these connected to the wall switch right? So your flip a normal switch which is connected to this and trips the relay in this? That’s how it loses status?

Yeah connected to a dual gang switch one light one ceiling fan. When they lose status I have to send them the opposite command to get them to work.

Example:

I switch the light on with smart things (Amazon Echo) and then switch it off on my way out of the kitchen via the switch. The next time I want to use the hub I ask for it to turn on but since it thinks it is on it doesn’t work. If I toggle it off and then back on it works. Are you saying yours update properly when used with a physical switch?

Mine only gets tripped up every now and then. Mostly when I try to turn on with smart things app and off with an echo using a routine off. It rarely happens as I’ve begun using echo mostly. The switch for me is hard wired and I turned the gang around to make it look off all the time but is left on to keep constant power to the fan canopy where the device is.

I don’t use any of mine with physical switches. Mine are all in fan canopies. I do use them with smart switches but the smart switches aren’t connected to anything except power, they just tell the device in the canopy to change to on or off same as would happen when hitting the buttons in the app.

I’m not surprised that it doesn’t report update, I’m just not sure how to fix it. I see ST has a dual load stuff in the works. I’m hoping for official dual load support soon.

1 Like

Thanks for the responses, I’m finally getting annoyed enough to try to figure it out. If I manage to solve it I will post back.I started monkeying with it last night and I noticed in the logs you were not handling a specific event which I Think has something to do with it. I added this event in and the error stops appearing when I press the physical button. I also figured out that the event that triggers sends the endpoint. What is unfortunate though is that it does not supply me with the previous state or an argument that i can see tells us what state the switch is in. (which makes sense since the switch is just toggling) Does anyone know how I can query the switch to see what the current state is or if there is a way to send a toggle command rather than a On or off?

def zwaveEvent(physicalgraph.zwave.commands.multichannelv3.MultiChannelCapabilityReport cmd) 

{

log.debug "multichannelv3.MultiChannelCapabilityReport $cmd"

if (cmd.endPoint == 2)
{
log.debug "it was 2"
on2
}
if (cmd.endPoint == 1 )
{
log.debug "it was 1"
on1
}

}

It looks like when the switch is toggled the parse method is called

Here is the Log

Parsing desc => 'zw device: 07, command: 2503, payload: 00 ’

Then

This method is called

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) 

{
log.debug “SwitchBinary”
[name: “switch”, value: cmd.value ? “on” : “off”, type: “digital”]
}

then parse is called again :

Parsing desc => 'zw device: 07, command: 600A, payload: 02 10 01 20 25 ’

Then the new event I created is called with the following arguments,

Here are the arguments being passed to my event :

multichannelv3.MultiChannelCapabilityReport MultiChannelCapabilityReport(commandClass: [32, 37], dynamic: false, endPoint: 2, genericDeviceClass: 16, specificDeviceClass: 1)

I solved this tonight and would like to re-release this as a monoprice dual relay (working with physical switches) is that ok? Im happy to do it whatever is the “Right” way. I just want to make sure that the next guy who wires up half of his house with these cheap little relays doesn’t have to jump through all the hoops :slight_smile:

Also I think I fixed the issue with one tile toggling the others. More testing tomorrow!

2 Likes

Cool. Please post. I think a bunch of us got these dual relay switches from the Monoprice sale last week, so you’ll save us lots of time. I received mine last night, and testing it tonight, the behavior is affected if a physical sw is in the mix. Also, the status isn’t updated correctly from the physical sw either. Looking forward to any posting or info you have. Thanks.

1 Like

Ive added a thread with my code as I think that is ok from what I have seen of code sharing around here. Thanks Mattjfrank for the initial work I seriously couldn’t have gotten the rest working without your code!

2 Likes

I will review and test your code with the Enerwave. If it works I’ll update mine as well. Thanks @nineismine

2 Likes