Date & Time on Control Pages

Posted on
Sun Dec 11, 2016 10:06 am
jalves offline
Posts: 445
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.1 on a 27" iMac (mid-2017), 8G memory, 1T Fusion Drive, OS X 10.13.3

Posted on
Sun Dec 11, 2016 10:22 am
Different Computers offline
User avatar
Posts: 1671
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( )

SmartThings refugee & happy to be on Indigo now.
Mac OS 10.12.6 on a i5 MBP running Harmony Hub, Hue, DomoPad, Dynamic URL, EPS Device Extensions, HomeBridge Buddy, Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFAP, Wunderground, Airfoil Pro.

Posted on
Sun Dec 11, 2016 11:31 am
Colorado4Wheeler offline
User avatar
Posts: 2350
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:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest