Difference between revisions of "WCmore's SimulatedSwitches"
m (→Simulated Switches) |
m (→Virtual versus Simulated - Some major differences) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
To create a SimSwitch, we can use a web browser to: | To create a SimSwitch, we can use a web browser to: | ||
− | * Log into [https://account.smartthings.com/ | + | * Log into SmartThing's IDE at [https://account.smartthings.com/ https://account.smartthings.com] |
* Choose “My Devices” at the top | * Choose “My Devices” at the top | ||
* Click on “+ New Device” in the top right | * Click on “+ New Device” in the top right | ||
Line 19: | Line 19: | ||
---- | ---- | ||
+ | '''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. | 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. | ||
+ | |||
+ | . | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | . | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Virtual versus Simulated - Some major differences === | ||
+ | |||
+ | A special thanks to [https://community.webcore.co/t/cleanest-way-to-program-a-virtual-switch/15576/22?u=wcmore @orangebucket] for the following observations. (I took the liberty of color coding green for positive, and red for negative) | ||
+ | |||
+ | {| class="mw-datatable" | ||
+ | |- | ||
+ | ! Virtual Switch | ||
+ | ! Simulated Switch | ||
+ | |- | ||
+ | | style="color:black; background-color:#D4FAE1;" | The device handler can run locally. | ||
+ | | style="color:black; background-color:#FEDDE4;" | The device handler can NOT run locally. | ||
+ | |- | ||
+ | | style="color:black; background-color:#FFFFFF;" | The ‘on’ and ‘off’ events are sent with ‘isStateChange: true’ so the events are always propagated even if the state hasn’t changed. | ||
+ | | style="color:black; background-color:#FFFFFF;" | Events do not explicitly set the ‘isStateChange’ flag. (I consider this positive, but some may disagree) | ||
+ | |- | ||
+ | | style="color:black; background-color:#FEDDE4;" | The device handler supports the Switch, Actuator and Sensor capabilities. | ||
+ | | style="color:black; background-color:#D4FAE1;" | The device handler supports the Switch, Actuator, Sensor, Relay Switch and Health Check capabilities. | ||
+ | |- | ||
+ | | style="color:black; background-color:#FEDDE4;" | The Classic UI has on and off buttons to force a particular state, as well as the main button for toggling. | ||
+ | | style="color:black; background-color:#D4FAE1;" | The Classic UI has buttons to send the four custom commands, as well as toggling. | ||
+ | |- | ||
+ | | style="color:black; background-color:#FEDDE4;" | Device Health is NOT supported. | ||
+ | | style="color:black; background-color:#D4FAE1;" | Device Health is supported. | ||
+ | |- | ||
+ | | style="color:black; background-color:#FEDDE4;" | Only the standard ‘on’ and ‘off’ commands are available. | ||
+ | | style="color:black; background-color:#D4FAE1;" | 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. | ||
+ | |- | ||
+ | |} | ||
{{WCmoreTOC}} | {{WCmoreTOC}} |
Latest revision as of 05:40, 27 March 2020
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.
.
.
Virtual versus Simulated - Some major differences
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 ▲ |
.