Feature Request: Piston $return variable


#1

@Robin @ipaterson @ady624 @???
Are any changes being made to WebCoRE these days?

I would like to be able to return a small JSON formatted text string. This could be used with shields.io I think to show data from WebCoRE on ActionTiles. See https://shields.io/endpoint
{
“label”: “Kevin”,
“message”: “At Work”,
“color”:“yellow”,
}

Maybe in the future this would open up easier integration with ActionTiles/SharpTools/etc dashboards. We could create a piston to generate data for a given tile by calling WebCoRE External URL :

https://graph.api.smartthings.com/api/token/x/execute/MyPresenceTile?person=Kevin

which would return required data. Maybe we could have a writable WebCore variable similar to $args, Rough example…

Set variable $return = "{
“title”: “$args.person”,
“data”: “[$args.person: arrivingAtPlace]”,
“icon”: “http://example.com/office.png”,
“footer”: “Arrived at 0800”
“bg-color”:“yellow”,
“text-color”:“black
}”

Thanks!


#2

I believe you can do that already… search for ipaterson’s post with json keywords

This one comes to mind…


#3

I think this is the opposite, sending JSON to another URL?


#4

Ah, ok, so wc will be the endpoint?


#5

Ya, going to a piston external URL:
https://graph.api.smartthings.com/api/token/x/execute/MyPresenceTile?person=Kevin

…would return something like this to browser/website:
{
“label”: “Kevin”,
“message”: “At Work”,
“color”:“yellow”,
}


#6

It’s a very popular request and would really expand what can be done with webCoRE. You could probably achieve an integration with shields.io by stitching in another service to allow webCoRE to make a request out when your data changes to a system that will record it and then provide access to it via a URL compatible with shields.io.

I won’t be able to work on support for proper return values.


#7

The third one you posted I think is the opposite (webcore gets JSON from some site). The first two might be same as what I’m asking, not sure?

Is this a not possible at all kind of thing?

I haven’t noticed if there are any WebCoRE updates being made, is there a changelog or new github maybe?


#8

Oh oops I pasted the wrong link, there were several relevant requests at least and it has been high on my personal wishlist, too.

webCoRE is open source so people are welcome to work on and contribute features like that. Any contributions would go through a beta test process before being made generally available for everyone.

I started contributing in 2017 and it took a lot of time and effort to understand the app enough to produce meaningful work. Adding return values would probably be quite complicated. While a few new features came out, most of my work was bug fixes. Toward the end of last year most of my time was spent investigating rising instability in the SmartThings platform. I haven’t been able to contribute much since then.