I’ve left the original instructions in tact immediately below in case you still want to reference them, but the HTTP Triggers + SharpTools variables approach is much more efficient.
Original Outdated Approach (tap to expand)
It’s a bit of a Rube Goldberg way of getting the data out of WebCoRE, but it works! For other options, check out the original thread linked above - the most common approach is to feed the data into a supported platform like SmartThings or Hubitat.
The summary is:
Create a WebCoRE piston to generate whatever output you desire (or in your case push the data from the Arduino)
At the end of that piston, create an HTTP call to save the data into a third party JSON storage system
Use a third party image generator to generate the image
Note: Global variables use ‘@’ in their name and wont work with the image generator, so if you are using global variables, copy those to a local variable
Be sure the piston executes at least once so you can make sure the content in myjson.com is updated as you expect Note: You can access the URL provided in Step 2 of the ‘Create the JSON Placeholder’ to view the JSON content in your browser
Create the Media Tile
Use the following URL format for shields.io to create an image that displays your value:
Enter a name for your media item and paste in the shields.io formatted URL Note: Be sure to check the box for enable refresh and set a refresh interval if your content changes periodically. Otherwise it will only ‘refresh’ the value when the dashboard is first loaded.
Note: For the original image at the start of this post, I used the following options:
Custom Tile Color: default dark gray which matches the color we used in the shields URL (#616161)
Media Scaling: Contain
This keeps the image within the tile without distorting it and matches the tile background color to the image color so it looks as if its one consistent tile. As shown in the screenshot above, another option is to use ‘Cover’ scaling, but you’ll need to adjust the tile dimensions to approximately fit your content which can be a bit harder if your dynamic content changes length.
I have recently been facing a similar issue myself and tried to use the above workaround within my capabilities but got stuck on the following: In trying to create the JSON placeholder, I found out the site myjson.com dos not seem to be working. I thought I could find an alternative and found this might be https://jsonbin.io/. However, I have been unable to complete the step there. Can anyone help?
From what I gather, the main difference would be tweaking WebCoRE piston side of things where it stores the JSON value and updating the image URL to point to the ‘latest’ version of the jsonbin that you create. I poked around with jsonbin.io and it looks like you’ll need to create an account, create a bin, and then use that in your pistons…
Out of curiosity, what kind of things are you using WebCoRE variables for? I’m curious if there’s some way to accomplish something similar with the native SharpTools.io variables that have been introduced since this post was originally created.
I just stubbed in some dummy data, tapped the ‘Private Bin’ button to toggle it to Public, and clicked Create
From a search of the WebCoRE forums, there’s allegedly a way to pass in authorization headers to use with a private bin, but I didn’t see that in my version of WebCoRE (maybe it just needs an update though? )
Thanks for the suggestion! It doesn’t look like the image placeholder service is available anymore and I’m not sure how it would work in this context where you would need a static URL for a Media Resource wherein the returned content is dynamic.
Things worked fine based on your suggestions! The critical issue was to toggle the bin into Public to get things working.
Regarding the need to use WebCore variables instead of using SharpTools ones, the reason I found myself doing that is simply that I was trying to get information from my IotaWatt power monitoring system Query API, which as far as I understand is not possible to do directly in SharpTools. With the assistance of @eibyer, I was able to get information from the API into WebCore. I then needed to pass on information to SharptTools tiles, which has now been accomplished, albeit in a very round-about manner. If that might have been possible to do directly in SharptTools, I would be glad to know (My SharpTools get device info from my SmartThings hub which does not support IotaWatt).
That looks like what I need but I am inexperienced and cannot quit figure out how to accomplish this.
I want to pull a webcore variable to sharptools so that it will display the time on a tile. Any videos or instructions on this process you can point me to? I read the post linked above as well as how to trigger http rules but am still at a loss.
Note that it’s completely optional to define the parameter name in the Trigger section, but sometimes it’s helpful almost as a form of documentation to yourself for what you’re expecting to receive.
Then I updated the existing WebCoRE piston and changed the ‘Method’ to POST and the URL to the HTTP Trigger URL for my new SharpTools Rule (make sure to save the SharpTools rule first so the HTTP trigger becomes active!).
No the SharpTools variable’s name doesn’t need to be the same as webCoRE’s variable name, but the variable name after $context.event.param, which is the myValue in Josh’s example, must match the local variable name passed from webCoRE.
Can you clarify what you’re trying to do? Are you trying to have WebCoRE send data over to SharpTools?
If so, you shouldn’t need to add a Rule to a Dashboard at all… in fact, that would just trigger the rule directly and would not pass any parameters (effectively bypassing the triggers). In your WebCoRE example, that seems like a reasonable way to get WebCoRE to push data over to SharpTools, but of course that WebCoRE piston would need to get triggered somehow so it would run,
Thanks for the update! Was there anything you figured out that you feel might be helpful to someone else who runs into this problem in the future?
The main thing is to setup the rule as you mentioned:
HTTP Trigger (generated)
Set Variable $yourVariable to $context.event.params.yourProperty
Then over in WebCoRE you would need to have some action that causes the piston to run and sends an HTTP Request to the URL that’s generated for your HTTP Trigger in SharpTools.
Then in SharpTools, you can add the $yourVariable directly to a dashboard to display. Or Super Tiles are a really neat way to use variables if you want to have more control over how things are laid out.