Difference between revisions of "WCmore's Tips"

From webCoRE Wiki - Web-enabled Community's own Rule Engine
Jump to: navigation, search
m (Advanced Pistons)
m (Coming Soon)
Line 120: Line 120:
 
== Coming Soon ==
 
== Coming Soon ==
 
* Good Practices
 
* Good Practices
 +
* Task Cancellation Policy
 
* Triggering a piston by voice (''Alexa & SimSwitch'')
 
* Triggering a piston by voice (''Alexa & SimSwitch'')
 
* Installation Tips (''GitHub'')
 
* Installation Tips (''GitHub'')

Revision as of 01:29, 28 May 2019

Hello and welcome!!

This is a collection of things that I have learned over the years. Stay tuned for more Tips & Tricks...

Move or Copy Code using drag and drop

To drag & drop code in your piston, you can go into Edit mode, and then click up top to turn on that feature.

AllowMoving.jpg

Once enabled, you can select a block by clicking in the yellow region… (clicking in different spots will change what code is selected)

SelectBlock.jpg

The blue numbers on the left show what is selected. You can drag by grabbing the maroon arrows… (and dropping it in the text region once in the right spot)

Hold down Ctrl while dragging to make a copy.

NOTE: If you want to copy the block into a DIFFERENT piston, you can select the block as mentioned above, and then right click to copy that selected text to your webCoRE clipboard. This will be available when you add new statements in other pistons.



Top





.

Simulated Switches

SimSwitchCreation.jpg

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.

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.

To create a SimSwitch, we can use a web browser to:

  • Log into SmartThing's IDE
  • 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.



Top





.

Adding devices to webCoRE

  • Connect the device to SmartThings first
  • Test the device using the SmartThings app on your phone to make sure the new device is working thru the hub
  • Add the device to webCoRE by going to: Automation > SmartApps > webCoRE > Settings > Available devices > Available devices
  • Select a category, and place a check-mark next to any device that you want webCoRE to see and/or control
  • Save multiple times until you are back in the SmartApps page
  • You can now use this device in webCoRE. If you still do not see it, try a hard refresh to your Dashboard. (Ctrl-F5)



Top





.

External URLs - Execute a piston from elsewhere

ExternalURL.jpg

Any piston can be run from any place that you are online. A few possibilities are:

  • Clicking a link in a SMS message
  • Clicking a link in an email or HTML document
  • Opening a URL directly inside any browser
  • HTTP GET request from any app with that capability
  • HTTP GET request from any OS (Windows, Android, RPi etc.)
  • HTTP GET request from another SmartThings hub (IE: House to House)
  • Command prompt / batch file / macro tool etc.

Each piston has a unique URL, which can be found at the very top of any piston -->
(Anyone that knows this URL can trigger that one piston whenever they want to, so this URL should be kept private, or only shared with those whom you trust)

So, for example, if you wanted a piston in your vacation house to trigger a piston in your main house, then the vacation house can make a web request like this:

UrlGetRequest.jpg

... and the piston in your main house would trigger a moment later.

Generally speaking, the piston that is getting triggered by the external call should have no triggers (lightning bolts).

Once the piston is saved, you should see this up top:

NoSubscriptions.jpg

One of the benefits of having no triggers is that this piston can be triggered from multiple locations and different events.



Top





.

Handy Links for Reference

Here are a few links that I have found to be helpful

webCoRE

Other Resources

Advanced Pistons



Top





.

Coming Soon

  • Good Practices
  • Task Cancellation Policy
  • Triggering a piston by voice (Alexa & SimSwitch)
  • Installation Tips (GitHub)
  • Two Hub Communication
  • Passing Arguments
  • "Daisy-Chaining" Pistons
  • Tasker (Controlling & being controlled by an Android device)
  • EventGhost (Controlling & being controlled by a Windows PC)
  • Android Presence Sensor using Tasker



Top





.