FAQ: Creating a virtual Device

virtualdevice

#1

Need a FAQ for the simplest version of this: a virtual on/off switch. Maybe even two FAQs, one for why you would want one with use case examples and one step by step how to for creating one in ST.

Thanks!


Harmony Home Control
Install device handler into mobile app
Using Virtual Switch to trigger Routine?
How to create a master virtual switch?
Alexa open my garage
How to create Virtual switch for my Lightify Flex
What can ST do with the Harmony Remote?
How do you change the color temperature of Osram Lightify lamps using Echo?
Reliable Presence Sensor using phone and/or fob
How to program a delay when turning off a light?
Virtual Motion Detector - Where do I start?
IFTT trigger with conditions
Seasonally disable smart lighting automation?
Virtual Device Ideas Thread
Sonos and light dim in a single smartapp
Using Virtual Switch to trigger Routine?
Virtual Device Ideas Thread
Have Alexa Notify You When there is a Knock
Problems controlling garage door
SmartThings + Kwikset Locks + Alexa = No control
Pair bulbs together
Removal of Smartapps always has to be by emailing support?
Echo (Alexa) beeps now instead of "Okay"
Rule Machine - Get peer assistance here with setting up rules
Any way to get a routine to dim to 15 percent?
New smart app to link the virtual/simulated garage door device with two actual devices
Rule Machine - Get peer assistance here with setting up rules
Fibaro Relay Switch FGS 222 - Installation
Is there anyway to assign groups of lights within the app?
A Real timer?
SmartRules app: rules suggestions
Set thermostat to away when flood sensor triggers
Alexa + SmartThings + IFTTT + Harmony to turn TV on and off by voice (2015 version)
Using MoodCube to set Mode?
SmartThings Hub & Motion Sensor, IFTTT & Lutron Caseta
Outlet connected home automated watering system?
FAQ Dimming and turning on/off multiple lights as a group (SmartThings Classic)
Sonos Welcome Home Message
What do you use IFTTT for with SmartThings? (Examples and Ideas) 😎
Temporarily disabling pistons
Turn off an outlet after a variable amount of time?
Turn the switch back ON after x minutes OFF
Delay the State of a Switch?
Arlo Q integration with Smartthings
Can I have a routine trigger another routine?
Alarm activation by email
Camera that can work with ST and IFTTT
Mode button triggers routines?
Blink IFTTT
Blinking light when door is unlocked, while in Away mode
Help getting started with ST (custom Arduino+Ethernet device: how to connect it to ST?)
Feature Request: BRING BACK THE ABILITY TO GROUP A LOCK AND SENSOR INTO A "DOOR"
(Tutorial) PC on/off and Activity Monitor with SmartThings
How to use Tasker/Automagic/SharpTools to integrate with other apps
Phillip hue lights grouping?
FAQ: use a button controller to turn on a virtual switch to run a routine to change SHM alarm state (SmartThings Classic)
Virtual Switch not saving in IFTTT?
SmartThings Hub & Motion Sensor, IFTTT & Lutron Caseta
Smoke Alarm or Loud Noise Sensor
Help with new DH for Aust 3 Gang light switch - catchall included
Smart Lighting Pause Button
IFTTT SmartThings routine as a trigger?
Turn a switch on when Alexa alarm sounds?
Create Virtual Switch how to video
[HOW TO] Add your TP-Link HS-100 Wifi outlets to SmartThings
Virtual toggling Switch for Ifttt
Change ST mode
Entry delay for Intrusion alert
Notify me when mode changes?
Please help me not return ST, how can I integrate with my DSC alarm?
Modes - What is their trigger?
Create an alarm virtual switch?
FAQ 2017: Have Alexa/Google Home/IFTTT run a routine, change a mode, or arm/disarm Smart Home Monitor (SmartThings Classic)
Alexa's new Restrictions kill my Security System.. workaround?
Favorite to change light temperature, brightness and hue?
CoRE - Get peer assistance here with setting up Pistons
Alexa home control with SmartThings? (Specifically locks)
Virtual Switches that turn themselves off?
Connect skydrop to smartthings
[DEPRECATED] 2015 Voice Assistant Run Routine FAQ--see 2017 FAQ instead
[DEPRECATED] 2015 Voice Assistant Run Routine FAQ--see 2017 FAQ instead
KMC Smart Plug
Amazon Echo, SmartThings Hub, Arlo Pro cameras
How to add routine 'button' to mobile screen
Google Home respond to a trigger?
[DEPRECATED] Smartthings + Alexa + Harmony Hub -- 2017 Guide
Connect a simulated device to another hub?
Virtual Switch Integration
Totally new to SmartThings
FAQ 2017: Have Alexa/Google Home/IFTTT run a routine, change a mode, or arm/disarm Smart Home Monitor (SmartThings Classic)
Iris Smart Plug WiFi
Sonoff Smart WiFi switch integration
Google assistance to control Yale Smart Lock Via Smarthings Hub
Feature Request : Ability to turn automation rules on/off
Support for Kevo SmartLocks and gateway (for Kwikset, Baldwin, Weiser)
IFTTT integration for Routines or Security state?
ISY 944i Smarthome Monitor and Integration
Push buttons to select light scene for Lifx bulbs?
Arm Stay Switch for Smart Home Monitor
Virtual Switch ties to Nest?
SmartTiles Dashboard v5.5: Added UK :uk:, 5 × Dashboards, and more! Nov 6, 2015
Virtual Switch that follows the state of Physical Switch
Struggling newbie with iTach
SmartTiles and Rule Machine
Set multiple dimmers to different values with one click
Harmony Home Control - SmartThings Control and vice versa
Thermostat SmartApps that uses Virtual Switches to control Mode/Fan/SetPoints
Is there a high temperature weather forecast tile?
Virtual/Seperate Switch for Monoprice Dual Relay
New User with v2, lots of Q's
FAQ: Amazon Echo: The Official SmartThings Integration is here! (Initial SetUp FAQ)
Harmony Home Control
FAQ: Help with Logitech Harmony (Connect) and Triggers (SmartThings Classic)
Is it possible to change smartthings mode via starting a harmony activity?
Another Wemo Connection issue
Setting up multiple iPhones (separate linked accounts) as presence sensors for dummies
IFTTT Triggers
Philips Hue Strobe Light/Flicker Alarm
Smartthings integration with Amazon Echo
Good night routine only running once?
Suggest a Device
Use a virtual switch to determine presence?
How far can we go with automation? (Integrating NFC tags with SmartThings)
Smartthings Rules, Triggers, Conditions
Aliases or groups?
SmartApp to automatically change bulb between colors
GE Z-Wave Dimmer - Smart Lighting not setting level
Battery Operated 3 Toggle Switch for wallmount or table top use (SmartenIT ZBWS3B), Long Install FAQ
Sonos woes
In-Wall Scene Controller for Nursery Room?
Amazon Echo Question
IFTTT How to Set Up
Multiple SMS text messages
Turn off "Fan" without turning off "Roku" in Harmony
Group ge link bulbs
FAQ: Alexa Voice Commands to turn a ST routine/scene off? (SmartThings Classic)
[RELEASE CANDIDATE] CoRE (Community's own Rule Engine)
Lightify Firmware Updates?
Official Lutron Caseta Support in SmartThings (Beginning March 2017)
Zwave Power Strip from AEON
(Matt) #2

Virtual / Simulated Device Types are functional “Things” but are not physical devices you have. Installing them allows you to control them via SmartApp’s just as you would a physical smart device.

Creating Virtual Devices - On/Off Switches

There are many reasons you’d have the need for a virtual switch.

  • You want one switch to control multiple other switches and/or commands.
  • You have a multi relay device and want to control the relays individually. (currently ST doesn’t support this)
  • You could use virtual switches the same way you’d use Hello Home Actions, to take care of multiple actions or state changes with the change of your virtual switch state.

To create a Virtual Switch

  • Login to the IDE @ https://graph.api.smartthings.com/
  • Click “My Devices”
  • Click the “New Device” Button
  • Enter a “Name” for the device, this can be whatever you want.
  • Enter a “Label” for the device, this is optional and can be whatever you want.
  • Enter a “Device Network Id” This can be anything you want. I recommend short and sweet but it cannot duplicate other device ID’s. Lets say it was a virtual switch for your living room lights, maybe call it LRVD01
  • “Zigbee” Id should be left blank
  • Select a “Type” from the dropdown, this should be Simulated Switch
  • “Version” should be published
  • “Location” should be your hub location, probably “Home”
  • “Hub” should be your hub name.
  • “Group” you won’t be able to select when creating, but these are Groups you’ve created in the Things page in the SmartThings app.
  • Click Create

Now you have a Virtual On/Off Switch in Things on your SmartThings App. You can use this Virtual Device

The process is very similar for other Virtual Devices, instead of Simulated Switch you can choose from many other Simulated Device Types.


Goodbye and Hello Routines
Make routines available in IFTTT?
Movie Time - ST and Harmony Hub
Simulated buttons to trigger API endpoint or IFTTT
Link Cree LED bulbs
Disable/Pause a SmartApp temporally?
IFTTT how to set the dimmer level?
SwitchMania [UPDATED] - create 4 different kinds of virtual switches
Armed Away
Wink to ST V2 Migration
Mirroring Switches?
Sensi Thermostat
A Virtual switch the turns off when presence sensor leave? Hello, Home
RM scenario I can’t seem to make it work
[Deprecated as of Apr 8, 2018] Smart Home Monitor Exit and Entry Delays (Version1)
[Release] SHM Delay Version 2.0
Custom Events
CoRE - Get peer assistance here with setting up Pistons
Query ST mode from IFTTT?
Blink support discontinued!
The smart dashboard project
New ADT partnership, new touchscreen hub and devices 10/29/2017
Unable to use door lock as a trigger for Routines
Smartthings+Echo+Harmony Hub = Voice Controlled TV! (2016 version)
Home Automation Dashboard (HAD)
Android IP Camera Device
Smoke Alarm turn off plug routine?
#3

Perfect, thank you! :blush:

Note that " simulated switch" is a binary on/off, like a regular light switch.

Use “momentary button tile” or one of the other momentary device types if you want something more like a classic doorbell button where it only goes on at the moment that you activate it, and then returns to the off state on its own.

Both are useful, but they serve different purposes.

Device ID

Also, when choosing a device ID for the virtual switch, you need to be careful not to choose one that a future Z wave switch will want to also use or that future device may not pair correctly to your network. The easiest thing is just to choose a virtual device ID that starts with a letter higher than “H.” I start all of my virtual devices with the V.

Virtual Dimmer

Also, for those who want a virtual dimmer, see the following:


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #4

I haven’t personally tested yet; but this contribution seems very promising.
The above steps will no longer be required once this one-timer is installed…


#5

I saw that, too, and agree it looks promising, but until it’s ST provided, you need @mattjfrank 's FAQ above (which I really like) to know why you’d want @baldeagle072 's code.


(Ash) #6

Thank you. Very clear instructions.


(Ra Nae Stanton) #7

I’m trying to use this Virtual Device to connect to IFTTT, but it seems to not be showing in my ‘switch’ list on the website. Hopefully this is a time thing, and it will show after some time. Anyone have any ideas why it might not be showing up? I’ve done the instructions to a T.

My idea is that when I leave work, it will set my air conditioner using a “Home Mode”.


(Kevin Tierney) #8

You have to go into the IFTTT site ST Channel and re-authorize on the website so you can tell IFTTT to see that as an available device. You can also do it via the ST App under ST Labs


Homeboy records video on Knocking (IFTTT)
#9

Just wanted to mention that sometime in all of the recent platform changes the terminology changed as well: what used to be listed as virtual switches are now called “simulated” in the ID. Everything else is the same, though.

One additional issues since this FAQ was originally written is that SmartThings now has multiple database servers. If your device list is blank when you follow the link in the step by step instructions above, see post 46 below in this thread.

Also, @BBoy486 has a topic where community members can answer the second question in the original post in this thread: why would you use a virtual device in the first place? :sunglasses:


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #10

Yup… This is a confusing choice of terminology, because when I think of “simulated” Devices, I think only of those that run in the IDE’s Simulator.

The IDE Simulator is a very important piece of the SmartThings Platform, of course…

But even the Simulator doesn’t call test Devices “Simulated Devices” … it categorizes simulated Devices as “Virtual Devices”!!!. Here is the relevant screen snip:


(Jason "The Enabler" as deemed so by @Smart) #11

Ok, newbie question. To clarify the use of a virtual switch please tell me if I have this right.

Let’s say I have a device connected to my ST hub that is not compatible, or recognized, by Amazon echo. I can use the virtual switch to control the unseen device via echo?

Also, how do I tire the virtual switch to the physical device?


#12

Basically any results that you can get by toggling a virtual switch on or off in the smartthing mobile app, you can then also get by having echo turn that virtual switch on or off.

See the following:


(Jason "The Enabler" as deemed so by @Smart) #13

I’ve figured out how to make the virtual switch. I’ve figured out how to make it seen by echo. But I can’t seem to figure out how to make the virtual switch control a device.

I see the routines, but how do I make the virtual switch control the routine?

Do I have to create a smart ask to control the virtual switch and that is what makes it tire to the physical device?


#14

Did you follow the link I just gave you? I know the forum is a little bit confusing, you have to click twice on the little tiny arrow that is pointing right on the far right side of the quote, and it will take you to that Thread.

Step two in that thread discusses exactly that issue. And gives you the link to a smart app, Alexa Helper, to do just that. :sunglasses:

Normally, you would connect the two by having a routine that triggers what you want to have happen after your virtual switch comes on.

So let’s say you want your virtual switch to lock your door.

You set up a routine that does nothing except lock that door.

Then you use Alexa helper or a similar smartapp to connect your virtual switch to that routine.

So here are the exact steps:

One) create a virtual switch

Two) create a routine to do whatever you want to have happen when you flip that virtual switch

Three) use “Alexa helper” or a similar smartapp to tie the virtual switch to the routine

Again, see the link in my previous post.


(Jason "The Enabler" as deemed so by @Smart) #15

I had no idea that was a link, thanks for pointing that out to me.

I did figure it out, your comments and links helped greatly.

I created a virtual switch, which I added to echo. I then installed a smart app and used the virtual switch as a trigger to control the device. I added the switch to a room for organization and now echo controls the switch.

I also see how the routines work with the switch as well.
Thank you.


#16

Yeah the links used to be a lot easier to use before the last forum change. I’m not sure why they’re so difficult now. It drives my screenreader crazy. :stuck_out_tongue_winking_eye:


(Edward Pope) #17

Just wondering if we can make a virtual toggle, that toggles on to off or off to on depending on needs?


#18

Do you Mean one where if it’s on turn it off, and if it’s off, turn it on? Several people have done that code, I think if you search the forum for toggle you would probably find it. I don’t believe there’s a standard device type that does that, but I could be wrong.

See the following topic, you should be able to amend it to do what you want. If you don’t know how, ask in that topic and I’m sure those guys will be glad to help you.


(Edward Pope) #19

I did search but did not come up with anything at the time. I will search again. I can manually toggle an On/Off switch and it will work. But was looking for something that does it automatically, As always thanks again @JDRoberts


(Andrew church) #20

Ok. Now I have a virtual switch, but it doesn’t do anything. How do I add devices to it for it to control?