Dynamically change tile color by attribute value

Hi,
Disclaimer: this is a bunch of questions for community and staff - yes - @josh and @James - I’m looking at you :stuck_out_tongue_winking_eye:

Based on responses to any of the below may cause this thread to transition into a feature request category.

I was tinkering over the weekend with @bptworld’s port of Life360 with states which I am finding useful given two teenagers at our household and the need to keep track of their whereabouts and safety…

So I constructed the prototype dashboard posted below (ignore the color scheme as it is just a prototype) and some of the functionality I would have liked to implement.

  1. In order to switch colors on and off for charging state and for wifi connection, I had to modify the driver to add capabilities and translation logic to the driver such as contact and acceleration sensor so that the ‘Active’ field in the Hero tile would react and flip the color accordingly.

  2. For speed though, I wanted a few color states - e.g. above 0MPH green, above 45MPH yellow, above 65MPH orange and above 75MPH red. The only way I can currently think of is adding a Temperature Measurement capability and build the logic to replicate the speed attribute as temperature, then use the rules builder in sharptools. Even then, the numeric content would display the ˚ degree symbol which is a throw-off as the temperature measurement tile does not seem to offer an option to hide units?

image

Now I could go on and on with how fancy my use cases can become and continue to modify (hack) various apps and device drivers but then I would be forking from development threads potentially and cause myself a maintenance nightmare unless respective authors merge my changes into his release schedule. Not to mention the increasing probability of my wife filing for divorce given how much time I am spending on home automation…

While all of this is certainly doable (hopefully not the divorce part), the following questions come to mind:

  1. Is temperature measurement the only capability to which the conditional style rule builder is available?

  2. Why would the conditional style rule builder not be available for any attribute, at a minimum for the ‘Active’ attribute that is available on a Hero setting tile?

  3. Would enhancing the current iimplementation of the conditional style rule builder to address any attribute value chosen and allow the appropriate conditionals (current numerics and operators such as ‘contains’, ‘does not contain’, ‘is empty’, ‘is not empty’ etc.) then set style accordingly not be a broader and more flexible implementation that would lend itself to a variety of use cases in the community?

  4. Unrelated (and yet bothering me specifically this weekend), why is the style color picker fixed and sharptools is not using the same color-picker ‘widget’ for picking any color which already exists for the RGB capability combined with a transparency slider?

  5. Am I just being stupid and am missing a very simple solution here out of not knowing a current feature in Sharptools and thus wasted all y’all’s time reading this long post?

Clearly I could go on and on with my stream of conciousness here but I’d like to give you the opportunity to respond as well

Thanks for your time, Avi

Long story short, I think the following feature request would cover the core need you’ve identified here. Be sure to go and cast a vote!

On the RGB, the following feature request sounds like it would cover what you’re looking for (be sure to cast a vote here too):

As to the why on the color picker, it helps provide a consistent color palette and leverages the thousands of hours of UI/UX research Google has done with their Material Design language. That being said, I can understand the desire for custom colors. One of our goals is “simple but powerful”, so a nice approach might be to display the palette by default and have an option at the bottom to enter a specific hex value or use the full color wheel with transparency.

1 Like

So for now, until color states are implemented for custom attributes as mentioned above,I utilized the temperature capability as an addition to the current Life360 with states app and driver. Sharing here in case anyone wishes to implement similar functionality on their dashboard(s). The explanation of how to use it and the HPM download by @bptworld are described in the following post: [RELEASE] Life360 with States - Track all attributes with app and driver. Also supports RM4 and Dashboards! - Code Share - Hubitat

2 Likes

A post was split to a new topic: Dynamic Tile Color

-UPDATE-
This feature has been released. For people who visited this thread and are interested about the custom tile colors/styles in Hero Tile, please see the feature release post below.