Contact Tile questions

Whats the difference between “Icon States” and Style States" clicking on the brings the same options for a contact sensor. Both have same Icon and state selections
image

And for Contact sensor, for it to change the Style(color or what ever) between the 2 states is actually looking for an “Open” or “Closed” primary value? Because I have contact devices that run a custom DH which sends the states as “Full” or “Empty”, etc… These will show up as the primary attribute in the tile which is what I want but the state Styles wont change.
Thanks…

Icon is to select specific icon for each state (open/close in this case) and Style is to use the predefined style or custom style (color, border width, animation and etc) for each state. Both are related to the “state mapping” concept, but just to configure different things.

That’s correct. It will look for the expected state based on the available states documented for the specific capability, and you may want to update the device handler accordingly.

Is there a way to set the secondary attribute for a Contact tile? I can do it in Hero but then cant change tile style+icon with contact state change. Or will Hero change style with Open/Closed states? Contact layout is auto populating 2nd attribute with no way to change it. That way I can write the DH to pass my custom text to 2nd attribute, like; “Full”, “Empty”, “Off”, etc…

Edit: Doesn’t look like there’s a way to accomplish this, tried several things. Would need the following added.

  1. Add Icon to theme/style customizations
  2. Add “None” to primary attribute. So its Icon only if thats whats wanted.
  3. To get a bit more crazy, Add secondary attribute selections to the primary attribute selections as a sub menu. Buts states would still be detected by primary attribute.

The Hero Attribute Tile can be configured to change styles with the contact states and will change with open/closed values. More generally speaking, the Hero Attribute tile will switch between the ‘active’ and ‘default’ styles based on the Active Color Attribute that you configure within the tile settings.

It must follow the defined capability model though.

Since you’re using a custom device, you could set the primary and/or secondary attributes as any attribute that you wanted to display even custom attributes that aren’t part of the capability models. Then for the active color setting on the Hero attribute tile, you could configure it to point to an attribute which properly implements whatever capability you want (Switch, Motion, Presence, etc).

There’s a feature request open to customize the icon and/or color settings for the hero attribute tile that you can vote on in the following thread:

I don’t think that there is an existing feature request for this, but you could definitely create one!

https://community.sharptools.io/c/feature-requests/11

Added feature request, thanks.