Connect a simulated device to another hub?

Hi,

I’ve successfully created a simulated switch following these directions. I need to have the virtual switch send a learn command (via the SmartThings hub) so that I can include it to another hub. I think the next step is to create a Device Handler where I can add a command for the virtual switch to go into learning mode at the same time I’ve asked my other hub to go into Inclusion mode. If so, I’ve found ZWave commands in the SmartThings API to learn or add a device, but I’m not sure where to start. I’ve included some additional details at the bottom of this post in case it’s helpful.

Can anyone help? Has anyone done this before and can share some sample code?

Thanks!

Additional details:

I have a SmartThings hub (Hub V2) and a Go Control 2Gig control panel alarm system. The 2Gig alarm system supports Z-wave, but in order to control device you need to add them via the panel rather than just having them on the network itself. My goal is to pair a virtual switch with the 2Gig control panel that will turn on when the alarm has gone off. Then my SmartThings app can notify me of the alarm. I have already created the virtual switch that I can control via the SmartThings app and I can see it on the 2Gig ZWave network, but I can’t control it unless I click add device on the 2Gig panel while the virtual device is sending a learn command out (via the hub). That’s where I’m stuck and would love some help.

Pretty much the same thing here, except with a Honeywell Tuxedo Touch ZWave Controller. Have you found any solutions to putting the virtual switch into learn mode yet?

That’s not going to work. There’s a radio signal that needs to be exchanged when a new zwave device is added and a non-physical device just can’t do that. It’s like asking a virtual bulb to light a room. You may be able to turn it on and off through the app, but you’ll still be standing in the dark. :disappointed_relieved:

Thanks JDRoberts!

Would either of these two approaches work instead?

  1. Add a physical device (ex. a switch), then use SmartThings to give it a custom device handler that only supports virtual events. Then re-add the switch so that there’s one real switch and one virtual switch both connected to the zwave alarm.

OR

  1. Write a device handler in SmartThings for the alarm controller that would allow me to add virtual devices.

Thanks!

It just can’t be done. A Virtual device doesn’t exist in the physical world, so It can’t send a radio signal.

There are some “man in the middle” options that some people have used, but they all require an additional server device. And I don’t think they’re going to get around your panel problem unless they also have a zwave radio, in which case things are going to get very complicated.

You can see what other people have done to create integrations by looking on the quick browse lists in the community – created wiki, looking down at the bottom of the page for “project reports“ and then choosing the security list.

http://thingsthataresmart.wiki/index.php?title=How_to_Quick_Browse_the_Community-Created_SmartApps_Forum_Section

1 Like

Why not? It may be a virtual device, but the hub has a zwave radio. Theoretically at least, when the virtual switch is turned on/off it could send out the same signals as a real switch. Unless there’s some sort of serial number or device id that’s burnt into the radio chip’s memory that cannot be overridden.

I have the same issue as the OP. I have a QOLSys alarm panel, powered by Alarm.com. It’s configured as the primary zwave controller, and ST as a secondary. I can do 90% of what I want with the alarm.com rules, but they provide no capability to configure complex logic rules. All I want is to be notified when the state of the alarm system changes (i.e. disarmed/armed stay/armed away/alarm) but there’s no such capability and unlikely that Alarm . com will ever open up their system even a tiny bit.

I realize I could just hook up a real dimmer which has no other purpose than to be controlled by the alarm. system and watch for event changes in ST (different dimming levels could indicate the different alarm states). Seems clunky though.

That’s a different question. You’re asking if the hub ( which is a physical device) can be made to send z wave signals spoofing a different device (the virtual switch) , And the answer is no, that would be a violation of the third-party Z wave standard. As you suspected, under that standard each device has its own unique ID. The hub’s ID is different than a Z wave switch’s ID on the same network.

The virtual switches on a SmartThings platform do not violate the standard because they are recognized only within the context of the SmartThings platform itself. They are not being used to have the hub pretend to be the switch and send Z wave signals to anything else.

When an integration is done at the cloud level, then there’s no Z wave protocol violation. So you can often use IFTTT or even Amazon echo as a “man in the middle“, have smartthings tell the man in the middle that the switch came on via cloud to cloud integration, and then send that information on to the integration partner. In that case the integration partner doesn’t see any difference between a virtual switch and a physical switch. But it’s not being done via Z wave radio communication. :sunglasses:

The alternative is the idea that you mentioned: using another physical device on the same network as a proxy for the condition state. That is definitely clunky, but it can work in many situations, and is worth considering, particularly in the kind of setup you describe.

1 Like

I found a solution that works well enough for me. It let’s the Go Control 2Gig control panel alarm system update the current state in SmartThings, but I can’t change/control the alarm state without physically touching the device.

I wrote a SmartApp based off of “Make It So” and I use virtual contact sensors and integrate with SmartThings Smart Home Monitor alarm state as well. It uses a real physical dimmer switch that I use regularly, but I only use that lamp as off or on (100%). That lets me use the other dimmer values to indicate state of the alarm, and I restore the lamp back to it’s previous state once I read in the value for the alarm system.

Let me know if that’s interesting to you and I can share my code - It’s pretty messy and hard coded at the moment and requires a custom device handler for the contact switch in order to trigger the Smart Home Monitor alarm based on a fake contact sensor.

Hope that helps!

1 Like

If the goal is merely to share a sensor or switch between two smart home platforms/hubs then the usual way to do this is to run MQTT on both. In theory this could be between two Smartthings hubs as well.

See MQTT Bridge [device + app]
and https://github.com/stjohnjohnson/smartthings-mqtt-bridge

1 Like

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.