Device plugin simulator

The simulator shows how the IoT device plugin would look within the SmartThings app, so that you can test the interaction between the device plugin in SmartThings and the device itself.

The simulator displays in a browser popup window, so you need to set up the browser to allow popups.

Launch simulator

  1. In your Chrome browser, allow popups from localhost:5680:
    1. Select Settings > Advanced > Privacy and security > Content Settings > Popups > Allow > Add.
    2. Enter localhost:5680.
  2. In the Atom IDE, either:
    • Select Packages > SmartThings > Run As > Simulator.
    • Click the Simulator icon from the toolbar along the top.
  3. Select the project directory of the IoT device to simulate.

Next, launch the virtual device to test the interaction between the device plugin simulator and the device.

Test the Main State

You cannot simply change the value of the main state of a card with the device plugin simulator. You must also change the attribute value of the virtual device to change the value of the main state.

device plugin simulator and virtual device

In this example, we will change the current temperature from the virtual device. Change the temperature value of:

  • /temperature/current/0 from 20 to 16

In the device plugin simulator, confirm that the values of the main states of the device plugin are changed.

device plugin simulator and virtual device

Test the Main Action

You can change the value of the main action of a card using both the device plugin simulator and the virtual device.

device plugin simulator and virtual device

In the device plugin simulator, click the Main Action. This changes the power state from On to Off. You can confirm that the states of both the card and virtual device are changed.

device plugin simulator and virtual device

In the virtual device, change the power value of /power/vs/0 from Off to On and confirm that the states of both the card and virtual device have changed.

device plugin simulator and virtual device

Test from the virtual device

You can change a plugin value through both the simulator as well as the virtual device. The example in this section shows how to change a value from the virtual device.

device plugin simulator and virtual device

In this example, change the value of fan speed from the virtual device.

Change the fan speed value of /fanSpeed/ from sleep to fast and confirm that the value of fan speed in the device plugin simulator has changed.

device plugin simulator and virtual device