The Snapshot Tile

Any possibility of adding this new type of tile?

1 Like

Thanks for sharing! It looks like the App/Driver is just storing the summarized data on a specific attribute and then displaying that attribute in a dashboard. That being said, it’s a security concern to allow unrestricted HTML (XSS attack), so we restrict the Hero Attribute tile to displaying text only.

Let me think about what options we have here. Allowing arbitrary HTML isn’t an option due to the security concerns, but we could consider either whitelisting specific tags like those used in this driver (table, tr, td, etc)… or building something similar natively. I’d been thinking of building something similar based on inspiration from a similar card in Home Assistant’s Lovelace UI. :grin:


Based on what I’ve seen this driver actually do, it stores stuff into a device which is then output to a dashboard.
Can’t you then output the text from a device?

Yes, you could use the Hero Attribute tile to display the text from this driver. As you noted, the App just aggregates status and then stores that on an attribute of a device it creates.

The issue is that the attribute is not just storing a normal string… it’s actually storing HTML. So if the author wanted to update the driver with a ‘text only’ option, then it could be used with SharpTools Hero Attribute tiles more elegantly. I can understand why he chose HTML as consistent formatting with whitespace is challenging and using tables is much more straightforward.

As noted above, the concern is that allowing arbitrary HTML is a security issue. There are some workarounds to consider as noted above. :smiley: