WCmore's SimulatedSwitches

From webCoRE Wiki - Web-enabled Community's own Rule Engine
Jump to: navigation, search
Share on FacebookShare on TwitterShare on Google+Share on LinkedInShare on DiggShare on deliciousShare on redditShare on StumbleUpon

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:

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