ZWN-RSM2 Create a new device type

@tail24 I used the code a couple above this post as a custom device type. I could not get chrisb’s code to work. Be sure the ST app is completely closed and reopened after making changes on the IDE with the device type info.

I was going to post last night to tell you that I used my wife’s phone to switch a light off last night and noticed that her iPhone works exactly as it should, meaning it all updates as it should and is not buggy at all. Even the icons changes work on her iPhone and now that I updated them on her iPhone show correct only my android. So I think the only bug is with the Android and not with the device type.

Lastly, I got info from enerwave on commands etc. So I will be verifying those with what I’m doing to verify no improvements can be made.

Here is the document I received from Enerwave.

Maybe someone can help clean up the code to improve the custom device type.

The device type is working it’s a little buggy on Android and almost perfect on iOS

@chrisb

Can you tell me more about your virtual tile and binder setup? I can’t get it to work as I’d expect. I’ve tried lots of different things.

What I’d like to accomplish is a virtual tile for each relay that in some way talk back to the actual device calling the correct relay

EDIT
nevermind I got it!

@mattjfrank how did you do if? Does this allow you to not have to go into the device?

@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)