We’re excited to announce the next SharpTools.io release which brings with it Style / Icon State Mapping for Custom Attributes.
This release closes the following popular feature request:
This release builds upon the existing state mapping feature, but opens up the ability to define custom states for the following tiles:
- Hero Attribute Tile
- Number Variable Tile
- Text Variable Tile
Hero Attribute Tile
For the Hero Attribute tile, this feature replaces the ‘Active Color Attribute’ setting. Any existing active/default styles on your Hero Attribute tiles will automatically transition to state mappings when you edit the tile. Additionally, you can now pick which icon to show for each state rather than being confined to a single static icon.
Make sure to exactly match the values that the device reports. You may find it helpful to reference the SmartThings Capability Documentation or Hubitat Capability Documentation.
For custom device drivers / handlers, it may be helpful to either review the device source code or to watch the attribute values as they change in the device details screen for your hub.
Note that attribute values are typically all lowercase
Variable Tiles
For the Number and Text Variable tiles, this opens up the ability to set custom styles and icons based on the value of the variable. Like the Hero Attribute tile, if you had a Default Style set on the Numeric or Text Variable tiles, it will automatically transition to state mappings when you edit the tile. Additionally, you now have the ability to display an icon based on the value of your variable.
We’ve had a few requests for the ability to display variables with various visual states and this enables that functionality!
One of the examples we’ve heard several times is the ability to aggregate data from devices into a variable, then use that to create a tile that displays the aggregated status (and optionally acts like a dashboard navigation tile). While this was possible for True/False variables before, this enables the same concept for multiple states in Number or Text variables!
There were some minor changes to the structure of the tiles in order to support icons, so if you have Custom CSS targeting these tiles, you may need to update it accordingly.
By request, we’re also now including the name of the variable in the Tile Editor to make it easier to know which variable you’re working on: