We’re excited to announce the next SharpTools.io release which brings basic support for Variables to SharpTools! Variables are a neat way to store custom values that you can use in Dashboards and the Rule Engine.
Variables are a Premium only feature.
If you are using the free tier, please let us know if you’d like us to reset your trial.
Supported variable types include:
Variables in Rule Engine
The Rule Engine includes support for Variables in the following features:
Event Triggers: when a variable changes or stays a value, trigger a rule running
- You can also use a Variable in a Device event trigger comparison!
- IF Condition: compare a variable value to a static value; or compare a device value or location value to a variable
- Action: Set Variable: change a variable value to a static value, device value, or location value as part of a rule flow
- Action: Send Command: use a variable as a parameter in a Thing Command
These features make for some really neat use cases! For example, you can use a single variable to trigger multiple rules simultaneously. Or use variables to set conditions as to what set of actions occur (or if the action will occur at all).
And because variables can be viewed / set from dashboards, this makes for some really powerful tools for integrating dashboards and rules!
Variables in Dashboards
We’ve included support for Variables in dashboards which provides a neat way to use variables on their own or along with the SharpTools.io Rule Engine.
The video below shows the result of the rule shown in the screenshot above. When the
myFavoriteColor text variable is changed, the rule automatically adjusts the
isFavoriteColor true/false variable accordingly.
Also pictured in the Number variable tile with the optional ‘Quick Adjust’ setting enabled.
Note that the standard security features apply here as well, so you could easily restrict variables to being Read Only or PIN protected. Similarly, the tiles support features like Colors/Labels and the True/False tile acts much like a Switch tile in that you can map different icons and colors for the different states.
$.runRule("RuleID")syntax in Hyperlink enabled tiles
- Added transparency option to Day of Month tile (reference)
- Added day of week format to the Date tile (reference)
- Added Content Size options to the Date Tile
We understand that variables can be difficult to get your head wrapped around, so please feel free to ask questions here or send them to email@example.com
If you have any specific use-cases that you think variables could help with, but you don’t know how to accomplish it, feel free to post it and we’ll do our best to help you out!
Also be sure to reference the help article: