Pass variable from SmartApp to WebCoRE?

Is there a way to pass a variable from a weather smart app to WebCoRE? I want to flash my lights red during a tornado warning, and by default for as long as the tornado warning lasts. So I need to pass a variable for the duration of the warning to WebCoRE. Or use a different SmartApp besides WebCoRE to flash the lights…

The smartapp has to be specially written to take advantage of WebCoRE. There is no ‘standard’ between SmartApps to communication, and in fact each SmartThings designed the smartapp structure to sit in its own ‘sandbox’ to prevent ‘cross contamination’. However, developers have figured out how to use the SendLocationEvent to pass information (like Ask Alexa to WebCoRE)

If it is simple on/off information, you could use a virtual switch to accomplish this. Outside of that, you may have to create your own SmartApp to send info to WebCoRE.

You could also create a simulated device of some sort that takes a value. Then use the smartapp to write a value to that device and read it in WebCore.

1 Like

Expanding on this…

If there is a known list of potential variables, you could create a separate virtual (simulated) switch to represent each one.

The SmartApp could then communicate the ‘variables’ to webCoRE via these switches (turning them ON and OFF).

I would probably create two separate pistons for this; one to translate the ‘variables’ from the SmartApp over to the set of switches, and the other to ‘read’ and translate those switches to do something in webCoRE.

The ‘variable reading’ piston in webCoRE would just need to be programmed to know what each of these switches means.

FYI: In case you’re not familiar with how to do this, it’s fairly easy once you get into it.
If you need any assistance with how to go about this, I’m sure you can find that assistance either here or over on the webCoRE forum.

Of course…

If such a device exists, that could be a shortcut to the whole thing.
The only problem is whether the SmartApp in question has the capability to ‘write’ a variable to said device. If not, I bet the virtual switches ON/OFF thing would be easier to implement (i.e. no coding needed); especially if a modified version of the SmartApp is not an option, due to wanting to keep up with the latest version of it from the app’s programmer, etc.

Create a simulated temperature sensor. You can then write a value to that in a smartapp. And thus WebCore can read it.

1 Like

Nice, thanks! Yeah, more using it just as an extra layer of precaution.

1 Like

I’m still learning pistons. Will that while loop only execute until the next instance of the piston runs (every other minute)? If not, I would have multiple instances of the piston running in parallel during an alert, which could cause conflicting flash commands.


So, as it is, by default as you have created it, does this go by whatever area the ST hub is set to?

Sorry to revive this topic but this is the closest I could find to what I am trying to achieve. I am trying to create a smart sprinkler and have found a smartapp that does the scheduling (which I thinned down) and created a piston to control my separate zones but want to pass a integer for the time to run each zone. I have tried looking through this thread and others but am not quite versed enough to complete what I want to do…Can anyone tell me what I need to put into my smartapp and/or piston to transfer a value from the smartapp to the piston?

I want to pass five separate integers from my smartapp to the piston. Such as:
zone1 = 10
zone2 = 18
zone3 = 25