Use the new “Rules” tab along with conditional formatting to add colors, icons, text and more to your Custom Screens.
Rules, Rules, Rules
Not everyone loves rules, but using our new rule editor, you can come up with some great ways to highlight content based on pre-set conditions. And, highlighting content is another great way to attract attention to your screen, especially when there’s something important to see! Here are some examples:
Add a rule to a Traffic block to highlight the text red if your morning commute will take longer than usual:
This rule will result in something like the following when the commute time is longer than 20 minutes:
External Data/Fetch (JSON) Block
You can also use rules tab in the External Data/Fetch (JSON) block to highlight data based on certain conditions:
This example combines multiple rules, such that if the value is negative, the text will be red. And if the value is positive, the value will be green. This example also prepends a “+” symbol if the value is greater than 0:
Our last example uses a SmartThings block to show the status of a contact sensor attached to a garage door.
This will set the background color to a reddish color, and change the icon to an open garage door icon:
There’s several conditions that can be matched using the “if” clause of the rule, including:
- Less than
- Greater than
- Starts with
- Ends with
There are several things that can happen when the “if” condition from above is matched successfully:
- Set the text color
- Set the background color
- Set an icon
- Set a value
- Set a prefix
- Set a suffix
For any of the color options, simple named colors can work, like “Red”, “LightBlue” etc. HTML hex values will also work.
When setting an icon, any of the icons from FontAwesome will work just fine. Just use the name of the icon, like “comment” or “arrow-left” etc.
For the value, prefix or suffix, this is just plain text that will be shown or added to the original value.
Where Can Rules be Used?
Right now, rules are available in a Custom Screen when editing a Traffic block, an External Data/Fetch (JSON) block or a SmartThings block. We plan on rolling out the Rules functionality to additional content block types in the near future, so stay tuned!
We hope you find the Rules functionality in DAKboard useful. As always, feel free to comment below, or email us at email@example.com with any questions or feedback.