First of all, I don't really understand device drivers so what I do is sort of trial and error.
I created a simple tile device driver that allows me to display text, background color, and text color. It works great.
But when i go to that device in the devices tab, whatever last background color I used on the tile is what shows up there as the background. And the items, or fields, seem to be all over the place instead of organized like most standard devices are.
I would think there is something I need to put in the driver to stop this from happening but don't know what it is. Something in the metadata, or titleing or something.
I assume you're accomplishing this via html formatting tags... and as you suspect, something is likely spilling over and applying to the whole page. Hard to make any concrete determinations or suggestions unless you share the actual driver code, though
Added the but didn’t make any difference. Tile still works fine but when looking at it in the devices it still shows up with the last background color. Makes it very hard to see.
Can you clarify where the actual problem is? Or maybe provide a screenshot? Do you mean the "Devices" tab in the mobile app (this is pretty new and I wasn't aware of any way that attributes could affect the display of these), the "Devices" page in the admin/web UI (I've never seen HTML actually get rendered here--always just the raw text), or somewhere else (logs, Dashboard tile, etc.)?
The problem seems to stem from Hubitat's Device page using <ul> (unordered list) and <li> (list item) for displaying device attributes, and the position CSS in your <div> is causing it to spread beyond the borders of the <li>
That code snipet you suggested works and solves my initial issue. When I go to the device in the web UI it is displayed correctly now.
However, on the tile on the dashboard the background color I specify doesn't go all the way to the edges. I tried increasing the width and height, but it never gets there. Any suggestions on that?