Ryan,
Not a stupid question… It took me quite some time to get my head in the SmartThings game…
Here are the basic steps to using ST_Anything_Doors:
- Load ST_Anything_Dooor.ino on your Arduino (requires all of the associated library files to have also been installed in your Arduino Libraries folder.) Sounds like you’ve done this already.
- Create a new “ST_Anything_Doors” DeviceType in the ST IDE (under Device Handlers) and paste in the ST_Anything_Doors.device.groovy code. Save and Publish. Sounds like you’ve done this already.
- In the ST IDE (under Devices), change the Device Type of your Arduino to your new “ST_Anything_Doors” DeviceType from step 2. Sounds like you’ve done this already.
- Create a new “Virtual Contact Sensor” DeviceType in the ST IDE (under Device Handlers) and paste in the VirtualContactSensor.device.groovy code. Save and Publish.
- In the ST IDE (under Devices), create a new device (call it whatever you want) and assign it to use the “Virtual Contact Sensor” DeviceType from step 4.
- Repeat step 5 until you have created a virtual “contact sensor” device for each of the Arduino’s real contact sensor inputs.
- In the ST IDE (under Smart Apps), create a new Smart App called “ST_Anything_Doors_Multiplexer” and paste in the groovy code from ST_Anything_Doors_Multiplexer.smartapp.groovy. Save and Publish.
- Using your phone/tablet, start the SmartThings app and “Add a new SmartApp” - select the “ST_Anything_Doors_Multiplexer” app that you created in step 7.
- Configure the new smart app to use the Virtual Contact Sensor devices you created in steps 5/6. Configure the smart app to use the Arduino device you revised in step 3. Save the settings.
I have skipped the virtual garage “Door Control” devices, but you can repeat steps 4/5/6 to create the two virtual garage door devices if desired using the corresponding groovy code. Then you can add them to the SmartApp as well. These virtual devices are a little more complicated as they are two-way devices.
Basically, what is happening here is the following:
-Arduino reads real world data and sends to ST
-Events are raised in the ST_Anything_Dooors device
-The ST_Anything_Dooors_Multiplexer smart app sees these events, and in turn, updates the virtual contact sensor devices with the current state of the Arduino’s inputs.
-Any other smart apps that are looking at the virtual contact sensor devices will then receive an update and act accordingly.
Hopefully this helps to clear things up!
Dan