Based on some changes I recently made to the Hub Information Driver, I decided to pull out the template processing portion into its own app. The Tile Template Device Manager app will allow you to generate HTML attributes for use on the dashboard for multiple devices based on templates stored on the hub.
Available via HPM or you can import the app from:
https://raw.githubusercontent.com/thebearmay/hubitat/main/tileTemplate/ttDevMgr.groovy
and the required device driver at:
https://raw.githubusercontent.com/thebearmay/hubitat/main/genHtmlDev.groovy
The app will create a child device on first usage. This device's only purpose is to serve as a place to output the merged html attribute for each "real" device being templated, so that it can be used on the dashboard.
Templates can contain text and HTML tags. Attributes are referenced in templates as <%attributeName%>. In addition, the app also recognizes <%@date%>
(current date/time), and <%@name%>
(device name). Sample templates:
Default Hub Information Template
<style>td{align:left}</style><table>
<tr><td>Name</td><td><%name%></td></tr>
<tr><td>Version</td><td><%hubModel%> / <%firmwareVersionString%></td></tr>
<tr><td>IP Addr</td><td><%localIP%></td></tr>
<tr><td>Free Mem</td><td><%freeMemory%></td></tr>
<tr><td>CPU Load/Load%</td><td><%cpu5Min%> / <%cpuPct%></td></tr>
<tr><td>DB Size</td><td><%dbSize%></td></tr>
<tr><td>Last Restart</td><td><%lastHubRestartFormatted%></td></tr>
<tr><td>Uptime</td><td><%formattedUptime%></td></tr>
<tr><td>Temperature</td><td><%temperature%></td></tr>
<tr><td>ZB Channel</td><td><%zigbeeChannel%></td></tr>
<tr><td>ZW Radio/SDK</td><td><%zwaveVersion%> / <%zwaveSDKVersion%></td></tr>
</table>
Template for an Inovelli 4-in-1
<style>.sm{font-size:x-small}.mo-active{background-color:red}.mo-inactive{background-color:green}</style>
<div style='width:100%;'>
<div class='sm'><p style='display:block;width:100%;text-align:left'><%illuminance%></p></div>
<div class='mo-<%motion%>'><p style='display:block;width:100%'> </p></div>
<div class='mo-<%motion%>'><p style='display:block;width:100%;' class='he-motion-sensor material-icons'> <%motion%></p></div>
<div class='mo-<%motion%>'><p style='display:block;width:100%;'> </p></div>
<div class='sm'><p><%temperature%> Humidity <%humidity%> </p></div>
</div>
To ease creating a basic template, I have also created a companion app the Tile Template Generator
And the best part, if you don't like it, it's a text file that you can edit and change to something that looks like:
@sburke781 can give you styling tips to make this even better