[BETA]Tile Template Device Manager

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%'>&nbsp;</p></div>
<div class='mo-<%motion%>'><p style='display:block;width:100%;' class='he-motion-sensor material-icons'>&nbsp;<%motion%></p></div>
<div class='mo-<%motion%>'><p style='display:block;width:100%;'>&nbsp;</p></div>
<div class='sm'><p><%temperature%>&nbsp;&nbsp;Humidity&nbsp;<%humidity%>&nbsp;</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:

PNG image

@sburke781 can give you styling tips to make this even better

12 Likes

Reserved

1 Like

Is the HTML device supposed to auto update?

I created a tile for my dishwasher progress and it didn't update so I created a RM rule to update the tile once a minute as long as the dishwasher was on.

I like the way this works. Thanks for creating it.

1 Like

Should be subscribing to all change events for the device, i.e. if any attribute changes it should be refreshing the tile.

1 Like

I'll try it with another device and template. Maybe it's just something odd about the attributes of the home connect dishwasher because they won't update. I have to issue a refresh of slot 1.

I'll post back when I get a chance to check this.

Thanks

Hey! I think this will be useful to me, if I could just figure out how to use it.
Installed via HPM, both Template Device Manager, and Template Generator

I created a template (example: based on Washing Machine status)

Now, how do I use that in a dashboard?

1 Like

Check the bottom of the app status page (cog wheel) to see if there is a subscription listed for your device.

The app will create a child device (HTML Tile Device#####) that will have an attribute html99 where 99 corresponds to the slot number assigned to your template and device. Use an attribute tile to display that attribute.

1 Like

There are no subscriptions.

I added another device and template (iris V2 motion) and still don't have any subscriptions to anything. The app was last updated by you on 9-5-22. Below are the templates I'm using. Any ideas?


If you unclick the device in the Devices of Interest area, click update, and then go back and reselect the device and update, it should recreate the subscription without removing the associated slot information.

No subscriptions. I'll delete device manager and start over. Let's see what that does.

I deleted device manager and then set things up with the dishwasher and template. I still have no subscriptions.

What does your Templates Assignment page look like?

I think this is what you want

Not sure what happened but some sequence here has generated a subscription to the dishwasher. I going to delete everything again and see what I have to do to get the subscription because it wasn't there until I took a screenshot.

Once you hit done on the assignment page it should create the subscription.

It does, the 2nd time. The first time no subscription is created. I have to go back into the assignment page and only hit done a 2nd time and the subscription is created. I was able to reproduce this several times.

1 Like

I'll have to track that down. Thanks!

There are no subscriptions listed