Custom Tiles: Access to Things and Variables

Today’s release includes support for access to Things and Variables in Custom Tiles!

Closes out the following feature requests:
:white_check_mark: Custom Tiles - Access Platform Resources
:white_check_mark: Custom Tiles - Access Variables

With today’s release, developers will now see options for defining Things and Variables as settings with Custom Tiles. And the stio library has new features for interacting with and listening to updates from these platform resources.

 
Quick Links

 

Example Custom Tiles

 

stio Library Updates

In order to use the the new Things and Variables setting types, you’ll need to use the latest stio library. You can reference the latest library in a <script> tag in your HTML custom tile like:

<script src="https://cdn.sharptools.io/js/custom-tiles/0.2.1/stio.js"></script>

Also note that starting with this release of the stio library, we’ve implemented semantic versioning. Historically, the stio library was available at a generic URL:

https://cdn.sharptools.io/js/custom-tiles.js

We will continue to update that generic library URL to point to the latest production version of the library. Since the files are served from a CDN with caching, browsers may hold onto the ‘old’ version of the library for a period of time.

As such, we suggest pointing to the specific versioned instance of the library that is needed for your Custom Tile.

 

Variables

You can define a SharpTools Variable as a setting within your Custom Tile.

You will need to select the specific type of variable that you are interested in:

When the user adds an instance of the Custom Tile to their dashboard, they can proceed to configure the tile instance where they’ll be presented with the option to select a variable of your specified type:

 

Things

You can define a SharpTools Thing as a setting within your Custom Tile.

If you define which capabilities the device must have, the list of things presented to the user when configuring the tile setting will be filtered to devices which match that capability set (more details). This is helpful for ensuring that the device selected by the user will have the attributes and commands you expect for use in your custom code.

When the user adds an instance of the Custom Tile to their dashboard, they can proceed to configure the tile instance where they’ll be presented with the option to select a Thing with your specified capability set:

2 Likes