[RELEASE] Date Time Parser driver (aka schedule_ur_garbage_cans)

These formats are useful in comparing times, and the format was known as ComparisonTime in the old VMS operating system.

ComparisonDate is simply string concatenation of YearNum4Dig MonthNum DayofMonNum

ComparisonDateTime is simply string concatenation of YearNum4Dig MonthNum DayofMonNum TimeHour24Num TimeMinNum

Fair point, if it's a reasonable amount of work probably best to leave it until someone who needs it asks for it.

@hal9000 implemented!

1 Like

Released - Date Time Parser.

I was able to come up with simple methods to simulate some variables that I wanted in the Driver.
The driver now give a Boolean for Daylight savings Active, ObservesDST, and gives a detection on leapyear as well with a Boolean.
I straightened out some of the naming i was using, added Suffix for '1st' '2nd' both as an ordinal and as an individual attribute.
I added Comparison values as suggested by @hal9000.
I added the adjustable auto update interval on the refresh rate from 1- 59 minutes.

Because @sburke781 has already created a Date/Time Display driver that is great for making a nice simple tile (VERY useful for creating your OWN date format displays!) or of course the always under appreciated @bptworld Tile Master 2 - I removed all tile function I was considering. Why reinvent the horse?!

So - HPM is now distributing v 0.2.1 Hope it's useful to others in getting their garbage cans out on time! (or the kids schedule concerts, or your lights to change on DST, or if it's AM or PM, or ....)
Please click on image to zoom and see all the variables...

6 Likes

Awesome! Those formats also come in handy for sorting notifications, log entries, etc.

The minutes should be expressed as two digits, though (i.e. with leading zero).

1 Like

hi @hal9000 I create another variable to handle this - minutes with leading zero. should be good!

0.2.2 Released - includes fixes on scheduler, and switch case problem on suffix.

Almost .. all the values in the comparison strings would need leading zero for a string compare to work. That is, 9:06 PM last night would be 202201212106

Not sure what you see missing - my result after setting my system to the time of 9:06p last night is:
image
also - this isn't a string compare but a number... which I is working for me in Rules...

OK, I was looking at the results just a few comments above that showed

comparison

1 Like

all good! thanks for the insights.

1 Like

... and fun with Dashboards!!!!
image

HE Dashboard - with @sburke781 Date Time Display, @bptworld Tile Master 2 and generic tiles:

1 Like

Scooby says 'rutroh...'
So it turns out playing with your date/time settings for testing a date and time driver is a really bad thing!!! For-warned is for-armed. I blew up my WeatherUnderground, Alexa, and Google oauth and cookies! Once they 'expired' or went invalid they didn't just reset themselves - I needed to re-auth and re-obtain! a bit of a pain - watch your logfiles for clues.

Please be careful if you dink with date/time settings folks!

Okay. so most fun I've had in months! First, playing with dashboards all over the place then. actually writing a garbage can rule using this driver! Short. and. Sweet.

Another use case - water the lawn every other day
image

Another use case - Tell the kids to wash the car on the 15th each month
image

Thank you for this code! This is going to come in VERY handy in a few projects I'm currently working on.

I did notice that the TimeHour24NumNoLead is still showing a leading zero for me. This isn't something I need to use, but I just thought you might want to know.

2022-01-23 08_55_24

THANKS AGAIN!

I have debug and descriptive text turned off. Is there a way to turn this off to not show in my logs?

image

1 Like

Hi @fdwilson and @curtisZM
Nice catch on the 24hrnolead. I missed that! I set a debug on check for the update line. thanks for that one too!

do HPM Repair to get an immediate update to 0.2.7 on the driver.

Working. Thank you..

Thank you!