Date & Time on Control Pages

Posted on
Sun Dec 11, 2016 10:06 am
jalves offline
Posts: 396
Joined: Jun 16, 2013

Date & Time on Control Pages

In order to have the current day, date & time available to display on various control pages I have a schedule set to run every minute that updates a variable for time and I have a schedule set to run at midnight for day & date variables. I then display these variables in some of by control pages. I had set these up under a prior iteration of Indigo and was wondering if there's a more efficient way of doing this now under Indigo 7?

Basically I guess I'm wondering if there is a way to simply access Indigo day/date/time directly for display on the pages without the intermediate step of saving to a variable.

Running Indigo 7.1 on a headless Mac Mini (late 2012), 16G memory, 1TB 7200 RPM spinning drive, OS X 10.13.1

Posted on
Sun Dec 11, 2016 10:22 am
Different Computers offline
User avatar
Posts: 1329
Joined: Jan 02, 2016
Location: East Coast

Re: Date & Time on Control Pages

I bet there's a way to make python output a refreshing image clock. Something likethis, but this example is probably too complex.

Found this, which creates a floating digital clock window.

Code: Select all
from Tkinter import *
import time

root = Tk()
time1 = ''
clock = Label(root, font=('times', 20, 'bold'), bg='green')
clock.pack(fill=BOTH, expand=1)

def tick():
global time1
# get the current local time from the PC
time2 = time.strftime('%H:%M:%S')
# if time string has changed, update it
if time2 != time1:
time1 = time2
# calls itself every 200 milliseconds
# to update the time display as needed
# could use >200 ms, but display gets jerky
clock.after(200, tick)

root.mainloop( )

Refugee from SmartThings and so happy to be on Indigo now.
Sierra on an i5 running Harmony Hub, Hue, Security Camera, DomoPad, EPS Device Extensions EPS Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFiAP, Wunderground.

Posted on
Sun Dec 11, 2016 11:31 am
Colorado4Wheeler offline
User avatar
Posts: 1130
Joined: Jul 20, 2009
Location: Colorado

Re: Date & Time on Control Pages

I wrote a plugin called LCD Creator that allows you to create an LCD device that is a date and/or time and displays it on your control pages as a graphic - I don't know if that's of interest but it is out there.

My Modest Contributions to Indigo:

Homebridge Buddy | Room-O-Matic | Smart Dimmer | Scene Toggle | Mac Commander | Security Manager | Device Extensions | LCD Creator | Control Page Keypad | Powermiser

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests