Simple Device with Time/Date attribute

Where can I find the necessary code to create a simple virtual device that I can have the current date and time attributes. I want to use it with Time Master so I can create a clock like dashboard with other tiles. I know about the clock tile but I cannot get the fonts big enough to work on the tablets I am using for displays.

Thanks

I'm not understanding what the issue is with the Time tile. If you aren't able to get the font big enough on it, then how would you get the font big enough on another tile?

With tile master I can have multiple lines with different fonts and sizes all on the same tile. Right now I am using a webserver with html generating a time and a frame that shows a dashboard on a tablet. Think of a kitchen clock that shows HE tiles. I would like to get rid of the webpage ( running on a raspberry pi) and do it all on the HE

I'm still confused. You said the native time tile won't work for you. Why won't it?

On a 10" tablet I need about a third of it in landscape mode for the time tile with a font large enough to see it from 20 feet away. Unless I am missing a new feature in HE tiles I can't get that

I'm sorry.....but I'm not understanding how a "simple device tile" is going to fix that. How are you going to make the text of that tile larger than? If it were me, I'd buy a wall clock if that's what you want.

Also, you do realize that you should not leave your tablet's screen on 24/7, correct? You are going to get screen burn-in. If you are talking about an Android Tablet, there's a screensaver called "Night Clock" that you can use that will display a clock, digital or analog, at full screen. That would be a lot more practical than trying to do this on a dashboard, which you should have up all the time anyway.

I didn't ask for a device tile I asked for a Device with a time / date attribute. That way I can use Tile Master to create the tile I want, showing the attributes. Tile Master allows the user to make a font big enough so I can use it. As far as buying a wall clock, well that is what I replaced with the tablet. It also shows status of my weather and garage doors. I have used Night Clock and it doesn't fit my use. I have had two tblets running like this for 6 months and if there is any screen burn I don't see it. They display just fine.

What you want isn't theoretically impossible, but it's likely to be impractical. You'd need a device with an attribute that updates every second or at least every minute. The latter is doable, but the former is a downright bad idea (each attribute change will commit an event to Hubitat's database, and one day of running a once-per-second update will generate over four times as many events as Hubitat's nightly cleanup process will let it keep, one measurement you might use to guess what's practical, and it's also likely a lot of work on the hub).

If none of the above suggestions sound practical to you, my suggestion would be to see if anyone has used custom CSS or other tricks to make Hubitat's existing time/date tile text larger. You can probably find some examples of how people have done this in general with other tiles in the Dashboard category on the forum. I'm assuming you've also experimented with the regular font options for the Dashboard itself.

1 Like

Thanks for the explanation. I would be fine using the existing Clock tile if I could get the font to a size I could see it from a distance. I'll keep looking around for some kind of CSS or tricks as you suggest. I have had th eraspberry PI freeze up on me and I wanted to get away from it eventually.

Thanks

I'm not sure if this will be helpful but I think I remember them talking about tile font sizes in this thread.

Here is a CSS snippet to change the font size:

My Clock Tile is tile ID 1, you can find that when you "inspect" the elements in a browser:

/* Change font size for date field */
#tile-1 > div.tile-contents > div.tile-primary
{
     font-size: 10px !important;
}

/* Change font size for time field */
#tile-1 > div.tile-contents > div.tile-primary > div
{
     font-size: 10px !important;
}
3 Likes

Thank you @dan.t, I've been searching for this forever, changing the Date element is direct with .tile-primary, but NOT the time!!

Thanks so much for that, @dan.t ! I've been looking for a way to isolate the date in the "Date and Clock" tile, and this:

#tile-[number] > div.tile-contents > div.tile-primary > div {display: none}

does the trick. :grinning:

I found the font size resolution by adding some CSS. Now for my next request. I only want the Time in a AM/PM format (not 24 hr) and I want to remove the seconds ticking off and the AM/PM indicators. Is this doable??

Thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.