WCmore's SimulatedSwitches
Simulated Switches
Simulated Switches are an imaginary device, that can be real useful to achieve things not normally possible with SmartHomes. They are free to create, and have many uses in advanced programming.
To create a SimSwitch, we can use a web browser to:
- Log into SmartThing's IDE at https://account.smartthings.com
- Choose “My Devices” at the top
- Click on “+ New Device” in the top right
Then use the image on the right as a guide -->
Side Note: Sometimes I have to use an "Incognito" or "Private Browsing Window" to be able to save the new device.
Once the device is added, ST will see it within a few seconds, but you will also have to add the device to webCoRE. If you are using Alexa to toggle the switch, make sure to say, "Alexa, discover my devices" afterwards.
Personal Thoughts: I often hear people talk about "Virtual Switches" and "Simulated Switches" interchangeably, but it's important to note that they use different Device Handlers, so they are definitely not the same. Personally, I will only recommend using "Simulated Switches", since I have seen a lot of issues involving virtual switches.
.
.
Bonus Information
A special thanks to @orangebucket for the following observations. (I took the liberty of color coding green for positive, and red for negative)
Virtual Switch | Simulated Switch |
---|---|
The device handler can run locally. | The device handler can NOT run locally. |
The ‘on’ and ‘off’ events are sent with ‘isStateChange: true’ so the events are always propagated even if the state hasn’t changed. | Events do not explicitly set the ‘isStateChange’ flag. (I consider this positive, but some may disagree) |
The device handler supports the Switch, Actuator and Sensor capabilities. | The device handler supports the Switch, Actuator, Sensor, Relay Switch and Health Check capabilities. |
The Classic UI has on and off buttons to force a particular state, as well as the main button for toggling. | The Classic UI has buttons to send the four custom commands, as well as toggling. |
Device Health is NOT supported. | Device Health is supported. |
Only the standard ‘on’ and ‘off’ commands are available. | As well as the standard ‘on’ & ‘off’ commands, there are custom ‘onPhysical’ & ‘offPhysical’ commands which mark events as physical interactions, and ‘markDeviceOnline’ and ‘markDeviceOffline’ commands to change the health status. |
▲ WCmore's Tips - Table of Contents ▲ |
.