[RELEASE] Formatted Date and Time on Dashboard Tiles

I wanted to get a formatted date and time onto my dashboard so setup a small device driver to do the formatting. The driver now includes in-built scheduling of updates, removing the need for an RM rule to trigger this.

Post Updates:
EDIT 2021-02-11 - Added this driver to my Hubitat Git repository:
https://raw.githubusercontent.com/sburke781/hubitat/master/UtilityDrivers/DateFormat.groovy
EDIT 2021-02-27 - Removed old code from this post now that I am confident in the use of the driver. Updated title of the thread to include the [RELEASE] tag.

Change Log

2021-02-11

  • Scheduling Device Updates - Added a scheduling option for refreshing the date and time attributes, rather than needing to setup an RM rule.

2021-02-27

  • Date and Time attribute - @luarmr added a "html friendly" attribute that includes both the time and date as one value.
  • Time Zone Support - @luarmr also added a time zone preference setting that is used when updating the date and time attributes. This means that different date/time virtual devices can be setup to show the current date/time in different locations. Make sure you click Save Preferences on any device using the driver when this update is applied.

6 Likes

That is great, I just tried it out, nice little driver.
I agree there should be a more pleasant way for the time and dates to be displayed. I hope a more elegant option can be offered by the Hubitat team

1 Like

I have updated the original post with some more details and removed the old code, preferring to point people to my Git repository now.

Also applied an update to the code from @luarmr to include a new attribute that combines the time and date into one, plus he also added a time zone setting, allowing for display of date/times in different locations by setting up multiple virtual devices using this driver, each with different time zones configured. Great addition!! Just be sure to click Save Preferences when applying this update to the driver.

Simon

1 Like

Here is my use of this driver.
I am just starting with HE so it is my first dashboard. At the moment a signal to see if my webcam is running and Simon's date component with the timezones that I like to check.

3 Likes

Wow, that dashboard looks great!

1 Like

Hello friends, I have installed the driver, but I don't know what to put in the template, can you help me?

Do you mean the template for a dashboard tile? For that you need to select attribute and then select the attribute from the drop-down that appears on the right.

But what should I put so that it can be seen on the dashboard? I have set clock, date and it does not come out

what should i put here

After you have installed the driver code you need to create a virtual device that uses the driver, then add a tile to your dashboard using that virtual device and the attribute template like I described. Does that make sense? I can put a few more notes together later tonight my time if you are still stuck, or if others can help that would be great..

I already did everything like this, add virtual device and put it in my dashboard, but I don't know what to put in the template tab ...

Do you get a drop-down appear when you select the attribute template like you showed in the screenshot? If not, make sure you have selected the device in the earlier list in the add tile screen. Is it which attribute to choose that you are not sure about?

Yes, I don't know which attribute to select

What do I select here? That is what I want to know

There is another drop down that should appear with the list of attributes. I'd show you a screenshot, but am not at my PC....

I don't understand what you mean by another dropdown

In the Options section on the right a drip down should appear once you have a device selected and the attribute template selected

Here the driver is selected, it's called time, and when I select nothing else, I get the usual thing on the right side

Now select the attribute template in the centre

Download the Hubitat app