HERO Active Color Attribute

I cannot find out, when I select the Active Color Attribute in a HERO tile, what is it looking for to determine active/inactive? I have a TimedSession device which is a count-down timer. This is implemented as a sensor, since it is not an actuator device. Anyways, my primary, secondary, and icon attributes work great, but I cannot figure out what type of data and values are expected in this attribute.

Please help.

@Armand_Welsh thanks for posting!

At this point in time, the active coloring applies to a subset of core attributes defined by official SmartThings capabilities.

It looks like TimedSession has the states of canceled, paused, running, and stopped… and looking at the only device handler I could find in the SmartThings repository, it looks like we could add running as an active state for this device. I’ll add it to the hit list.

Edit: It looks like the specific device handler I linked to also maps the status to a switch attribute. Depending on what device handler you are using, you might just be able to use the switch attribute for the color.

In the meantime, here’s what states currently trigger active status.

Attribute Active Value
switch on
lock locked
door closed
status playing
playbackStatus play
thermostatOperatingState heating or cooling
valve closed
contact closed
water dry
motion active
presence present
mute muted
smoke detected
carbonMonoxide detected
1 Like

My device in Hubitat is a sensor, which is what I think it should be. When the timer expires, it triggers a pushbutton event, as a 1-button push button controller. The idea being that this is not an actuator of any device. If the active state can be linked to “running” for the for the sessionStatus attribute, that would be awesome. I did try to use the switch attribute of “on” and “off” but it appears that your system will only interpret the values on/off if the device implements the switch capability – simply exposing a “switch” attribute with the on/off values and assigning the active color attribute to “switch” does not seem to work.

Because turning the device on or off from rules would have zero impact without first having had set the timeout value, I don’t want to make this an actual switch. I don’t want to make this a hacked solution. As it is now, it adheres to the spec, and I am okay with extra attributes, I just don’t want capabilities added simply as a matter of a hack to make it work if I can avoid it.

I changed my device to support capability contact sensor as a test. I set the contact state to open/closed and when rendered as a Contact Señor, the color changes, but when rendered as a HERO tile, it is ignored. Possible bug?

Can you share the code? If it’s not public code, at least via PM so I can take a closer look?

Edit: Regarding including the switch as a capability… the only official device handler from SmartThings (in GitHub) which implements the TimedSession capability also implements the Switch capability.

Since the TimedSession capability implements start() and stop() methods, the switch has some pretty direct methods to map to. The Gentle Wakeup device from the SmartThings repo is a good reference on a reasonable mapping:

SmartThingsPublic/devicetypes/smartthings/gentle-wake-up-controller.src/gentle-wake-up-controller.groovy at master · SmartThingsCommunity/SmartThingsPublic · GitHub

Methods Mapping

Switch TimedSession
on() start()
off() stop()

Event Mapping

TimedSession
sessionStatus
Switch
switch
running on
not running off

@Armand_Welsh it looks like the ‘Color’ property of the Hero Attribute is not getting subscribed. I’ve added it to our hit list.

In the meantime, if you edit the Hero Attribute tile and use the switch as a secondary attribute and then save the dashboard, it will setup the subscription as expected. After the subscription is setup, you can remove the switch as a Secondary attribute in the Hero Tile configuration if desired.

Here’s an example stubbed driver that I put together which exposes a switch attribute without exposing the full Switch capability (source code):

I’ve pushed a hot fix to SharpTools Beta and will reach out via PM to get you access. :smiley:

Edit: the beta also has native active coloring support for sessionStatus

Thanks! I will need to go find that beta subscription link.

Sure. It is still early beta, as I need to make other changes to ensure we do not send excessive data to sharptools interface.

@josh
I’m having the same issue with my zooz power switch running ([RELEASE] Zooz Power Switch / Zooz Smart Plug - Community Created Device Types - SmartThings Community) DTH on smartthings. so I have the hero tile up and have the acceleration as the active color attribute. the words that come up are saying active and inactive but no color change.

Also is there a way to not have the words/title of the attribute come up on the center of the hero tiles and just have the icon instead of both the icon and title come up together.25%20PM

I don’t believe we currently have a mapping for acceleration for active colors, but I’ve noted the request and will see if we can get it added to an upcoming release.

Not at the moment, but that’s an interesting request. The thought with Hero Attribute tiles was that the attribute would be the ‘hero’ of the tile and thus displayed in the middle.

Can you help me better understand your particular use case? I’m trying to understand how ‘acceleration’ is being used as a key piece of data on the tile as it’s usually only something that’s active for a very brief period of time. Looking at the DTH, perhaps it’s just using ‘acceleration’ as a proxy for indicating that power is being consumed by an attached device (since the standard states are ‘active’ and ‘inactive’ and seem to read well for that purpose)?

1 Like

@josh I’m using the plug with my electric car charger. I thought the acceleration attribute was weird as well but have found out the in the ST app there was an action to show inactive when power is below X. So since the charger uses about 2 watts of power when plugged in and not charging I put in to show inactive when there is 3 watts or lower. I’m using this tile to show that the car is charging and that everything is working. I would like to know this by just looking over at tablet and seeing the tile color different.

1 Like

We’ve added support for acceleration (and a number of other attributes) for active color indication in the latest SharpTools beta.

1 Like

I am trying to apply active color attribute to Hubitat Virtual Thermostats. I set it to Thermostat Mode which is Heat, Cool, Off, etc.

I turned on active color attribute for the thermostat is in heat mode and it displayed blue. So not sure exactly what it is looking at and why it chose blue?

Reading this I am guessing that this will not do anything at this point as the attributes need to be turned on in the backend in Sharptools?

Just curious whether it wouldn’t make sense to allow configuration on the front end where we could specify the value and the color?

1 Like

The attribute thermostatMode is considered active when it contains one of the following strings:

'auto', 'cool', 'heat', 'emergencyHeat'

It’s based on whatever styles are applied. By default it will use the ‘active’ style from your Theme (the default active style for a new theme is blue).

Or if an active style is explicitly set within the Tile settings, it will use that.

image

(And if it’s a legacy dashboard with an active color set in the dashboard settings, it will use that.)

There’s a feature request open for it which you can vote on in the following thread. It’s one of the top requested features at this point, so it’s likely to be on our short-list soon:

:link: Style/Icon State Mapping for Custom Attributes

Thanks. very helpful. I think my intended use falls into the feature request section. My goal was to display red for heat, blue for cool, etc.