Dashboard: Tile Background Color based on Attribute Value

Any Idea if this is possible. I am happy for a solution limited to Attribute tiles, although a general solution for any tile would be preferred

I’ve seen this done, but have no idea how.

Again, I would start here:

I have a device driver I sort of cobbled together that allows me to set the text on the tile, background color and foreground color. The in RM use set custom attribute to set the values based on whatever criteria you want. It’s pretty crude, but it works for me.

What I was trying to do was build a dashboard that would show devices ordered by last-updated, and change the background color of devices where last_updated was more than 24 hours ago.

This would be trivial in JavaScript, but is murder in CSS (at least without something like the Bootstrap framework).

Developers, to get me started is possible to add a tile_id_value tag to the div that contains the value, at the moment any attempt to inspect the value is going to require class based navigation which is a PITA.

First off I am not very savvy about this kind of stuff, but a possible idea.

Someone on here has a tile driver that allows you to put whatever you want on it and color also. Can't remember who or where it is, but should be findable.

Using that, create a number of those tiles and put on a dashboard. Then using RM or whatever, use a series of comparisons to different devices to determine what is displayed on each tile.

I would try and do something with a virtual switch per device you want to monitor, or if it is only one tile you want to represent a group, then one virtual switch. Then in something like RM or Device Watchdog, check the activity to see if your criteria has been met and update the switch(es) accordingly

In the dashboard either adjust the background color for switch template generally or use CSS to target a tile that references the virtual switch. With tile positioning and some z-index setting in CSS layer another tile on top to provide the allusion of the switch tile being the background.

There would be other ways of doing this I am sure, or different ways of presenting the same information.

Could you share said device driver ?

My solution is here

Dashboard: Sort Tiles based on an Attribute Value? - :toolbox: Built-In Apps and Drivers / Dashboard - Hubitat