[RELEASE] Virtual Device Sync - Create Virtual Devices and Keep Them In Sync With a Physical Device

I am having the same problem with Enerwave Dual Relay. I added the new Smart App and Device Handlers. I changed the device type to Simulated Switch. In the ST app it shows 0 endpoints.
Thanks for your help!

Thanks, I have been able to create the momentary switch, the problem has been keeping the virtual and physical in sync.

@BolognaBiscuit You need to assign the Enerwave handler to the Enerwave switch. You can use the one posted here:

Ok. If there is anything I can do to help you de-bug the sync let me know. I would like to help if I can!

Just reporting back. I decided to install a downrod on the fan as it was too high up, and in doing so rewired the whole thing including the zwn-rsm2. I found a hot wire up in the ceiling, so I have hot, neutral and the wire from the switch. I wired it up the right way and everything works perfectly! I have both aux connecting to the switch wire so turning the switch on and off turn on both loads and your app keeps it all perfectly in sync with smartthings. It updates status in a second or less of a physical flip of the switch and in realtime when done in app.

Thanks again for all your work!

Eric,

Thank you so much for helping. This switch is awesome now.

Thanks again,

Jason

2 Likes

Enerwave RSM2 Dual Relay Switch - Instructions for a quick install and setup

Written to be able to copy and save to a file you can use in the future if the need arises.
No way to link a pdf document so here’s an external link http://rollesolutions.com/EnerwaveInst.pdf
All code was graciously written for the Samsung community by Eric Maycock, https://community.smartthings.com/users/erocm1231/activity

Extra time saver - Open two side-by-side browser windows.
In one window, log in to your Samsung Smart Things account https://graph-na02-useast1.api.smartthings.com/
In the other, open the links below. Then you can copy and paste into samsung without having to jump back and forth in one window.

Go here to copy raw code for the Enerwave RSM2 Dual Relay Switch (Device Handler)
https://raw.githubusercontent.com/erocm123/SmartThingsPublic/master/devicetypes/erocm123/enerwave-rsm2-dual-relay-switch.src/enerwave-rsm2-dual-relay-switch.groovy
Ctrl+A then ctrl+C or select all and copy the code
Log in to your Samsung account
Click “My Device Handlers” from the top menu.
Click "+Create New Device Handler"
Click “From Code” on the next screen
Ctrl+V or Paste the code you copied into the code window
Click "Create"
Click “Publish”

Go here to copy raw code for the Simulated Dimmer (Device Handler)
https://raw.githubusercontent.com/erocm123/SmartThingsPublic/master/devicetypes/erocm123/simulated-dimmer.src/simulated-dimmer.groovy
Follow process from above to publish

Go here to copy raw code for the Simulated Switch (Device Handler)
https://raw.githubusercontent.com/erocm123/SmartThingsPublic/master/devicetypes/erocm123/simulated-switch.src/simulated-switch.groovy
Follow process from above to publish

Go here to copy raw code for the Simulated Energy Switch (Device Handler)
https://raw.githubusercontent.com/erocm123/SmartThingsPublic/master/devicetypes/erocm123/simulated-energy-switch.src/simulated-energy-switch.groovy
Follow process from above to publish

Go here to copy raw code for the Virtual Device Sync (SmartApp)
https://raw.githubusercontent.com/erocm123/SmartThingsPublic/master/smartapps/erocm123/virtual-device-sync.src/virtual-device-sync.groovy
Ctrl+A then ctrl+C or select all and copy the code.
Log in to your Samsung account if needed.
Click “My SmartApps” from the top menu.
Click “+New SmartApp”.
Click “From Code” on the next screen.
Ctrl+V or Paste the code you copied.
Click “Create”.
Click “Publish”.

Click "My Device Handlers"
Confirm that you see the following in the list, if not repeat the process for any missing items.
Enerwave RSM2 Dual Relay Switch
erocm123 : Simulated Dimmer
erocm123 : Simulated Energy Switch
erocm123 : Simulated Switch

Click "My SmartApps"
Confirm that you see the following in the list, if not repeat the process for the missing item.
erocm123 : Virtual Device Sync

Connect your Enerwave ZWN-RSM2 switch to temporary or actual house wiring.
Temporary makes it easy to ensure the device is working well before pulling all your switches out of the wall and wiring them up.
Ensure good connections and power it up.
Have a toothpick, or other small object, you can use to activate the small pushbutton switch on the Enerwave device (to enter learning mode).
Open your Smart Things app, select “+” (top right) then “Add a Thing”.
Select “Start looking for Things”.
With your toothpick, press the push-button switch once on the Enerwave device.
When the device is recognized, click next, give it a name, then keep clicking next without adding any smart apps until your device has been added.
Close the App so it is not running in the background.

Go back to your Smart Things account.
Log in if necessary.
Click “My Devices” from the top menu.
Scroll to your newly added Enerwave device.
Click on it’s link (under display name).
Click “Edit” at the bottom of the screen.
Click the “Type” dropdown and select Enerwave RSM2 Dual Relay Switch.
Click “Update”.
You can log out of your Samsung account now.

Open the app on your phone or tablet
Select "Marketplace"
Select "SmartApps"
Scroll down to and select "My Apps"
Select "Virtual Device Sync"
Tap to select your new switch under "Which Physical Switch"
Click "Create Virtual Devices"
Click “Done” to finish.

You will now be able to control your Enerwave ZWN-RSM2 accurately. You will have three switches in your list of “Things”.
The first should turn both relays on or off.
The next two will control each relay independently.

Below are links to the community discussion and the author of the app as well as the relevant pages on the Samsung community site.

I have two RSM2 devices, one can control both relays at the same time from the main device (the real one, not the virtual devices) in SmartThings, while the other cannot.

I installed one in the living room. Initially it would control both switches at the same time from the main button in SmartThings. At some point in the process, the main control quit working: It appears to function, but no response from the switches. There were other issues with the device so I replaced it, but the result is the same – it worked for a few minutes. This is true before configuration with erocm123 device type and app. After configuring, the main device still doesn’t work.

I have another that I installed in the master bedroom. Both switches could be controlled by the main device control in SmartThings, before and after setup with the erocm123 device type and app.

Both switches on both devices function fine independently using the erocm123 device type and app, just the living room switch main device control is non-responsive.

Here is the info from the log. I see there are differences in isStateChange and Displayed:
Living Room:
34e03816-f68e-454b-b7a5-b61028e377be 10:13:03 PM: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 0, parameter: [0], sourceEndPoint: 2) to [[‘name’:switch2, ‘value’:‘off’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘All Living Room Lights’, ‘descriptionText’:All Living Room Lights switch2 is off], [‘name’:‘switch’, ‘value’:‘off’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘All Living Room Lights’, ‘descriptionText’:All Living Room Lights switch is off]]
34e03816-f68e-454b-b7a5-b61028e377be 10:13:02 PM: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 0, parameter: [0], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘off’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘All Living Room Lights’, ‘descriptionText’:All Living Room Lights switch1 is off], [‘name’:‘switch’, ‘value’:‘off’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘All Living Room Lights’, ‘descriptionText’:All Living Room Lights switch is off]]
Master:
fe5ff0a8-8b7d-44f7-b083-1937db6eeb87 10:12:56 PM: debug physicalHandler called with event: name:switch2 source:DEVICE value:on isStateChange: true isPhysical: false isDigital: false data: {“microDeviceTile”:{“type”:“standard”,“icon”:“st.switches.switch.on”,“backgroundColor”:"#79b821"}} device: All Master Lights
0b38ae46-b8e8-4946-8a00-9f9214d887c9 10:12:56 PM: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 0, parameter: [255], sourceEndPoint: 2) to [[‘name’:switch2, ‘value’:‘on’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘All Master Lights’, ‘descriptionText’:All Master Lights switch2 is on], [‘name’:‘switch’, ‘value’:‘on’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘All Master Lights’, ‘descriptionText’:All Master Lights switch is on]]
fe5ff0a8-8b7d-44f7-b083-1937db6eeb87 10:12:56 PM: debug physicalHandler called with event: name:switch1 source:DEVICE value:on isStateChange: true isPhysical: false isDigital: false data: {“microDeviceTile”:{“type”:“standard”,“icon”:“st.switches.switch.on”,“backgroundColor”:"#79b821"}} device: All Master Lights
0b38ae46-b8e8-4946-8a00-9f9214d887c9 10:12:55 PM: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 0, parameter: [255], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘on’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘All Master Lights’, ‘descriptionText’:All Master Lights switch1 is on], [‘name’:‘switch’, ‘value’:‘on’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘All Master Lights’, ‘descriptionText’:All Master Lights switch is on]]

Unrelated: Will this app work with an RSM1 single-relay switch to sync the real switch status? So far no-go for me.

Any input is appreciated.

@erocm1231

Very nice work! I installed via the GitHub repository method with no issues. Do you know if the zooZ powerstrip does power metering?

Thanks!

Bob,

I’m not sure about the Zooz, however I learned the hard way that power metering alone may not suffice. Some devices report in total accumulated kWh, while others may tally this along with real-time Watts (Watts is what is needed). An Aeotec Z-Wave Smart Switch 6, Gen5 works, while an Aeotec Z-Wave Micro Smart Energy Switch, 2nd Edition does not. Even with the functioning switch, the polling rate is not sufficient to stop a battery charge where I want. :frowning:

Eric, getting following error. “Error when creating the virtual devices. Make sure that you have all of the Simulated device handlers installed”. What do I need to do?

Oceans, install the Device Type Handlers needed. The simulated DTHs are listed at the top of the thread. I have added links below for convenience.

simulated-dimmer.groovy
simulated-switch.groovy
simulated-energy-switch.groovy

:slight_smile:

Thanks Bob. I am a newbee, but having fun! Here is my silly question. I installed the Device Handler for the zooZ Power Strip and it works. Do I replace that Device Handler or is the DTH installed in addition to the Device Handler? If so where do I install the DHT?

1 Like

Ok, I read that DH and DHT are the same thing. Some how I got this to work it to work. I hate to admit it, but I am not certain how. I seem to have the 5 virtual and controllable plugs for the zooZ Power Strip and have it as originally configured (as one power strip without individual controls. Sometime you get lucky:grinning:

Hi @erocm1231. Could you please add capability “Actuator” to your virtual DHs ?
This is needed for some smartapps (like SmartTiles/ActionTiles) to be able to locate/authorize the Device.
Thanks.

Rudi, unless you are syncing the code directly from GitHub you can add it your self very easily. In the metadata section at the top of the DTH code just add:

    capability "Sensor"
    capability "Actuator"

its as easy as pie! :slight_smile:

good luck!

Hi Bob, I’ve already done that to my local copy (I’m syncing with Eric’s github but you can change your local copy).
I was just sending a suggestion, but thanks for your reply.

Sweet, I get it, I had the same request of a different Dev.

:slight_smile:

I have added the capabilities. Thanks.

Thank you! Man I love GitHub integration!!!

Sometimes, when I try to turn on one of the two lights attached to this relay, the relay chatters, the light flickers then stays off. When I try the next time it works. If I use the switch that controls both, they go on and off together flawlessly. If I have the one light on and try to turn it off occasionally it will also chatter the relay, flicker the light then stay on. This lasts about three seconds in either scenario. Would this be a relay problem or an issue in the app or device handler? I can live with it but it is a bit annoying.