Date & Time on Control Pages

Posted on
Sun Dec 11, 2016 10:06 am
jalves offline
Posts: 749
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 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Sun Dec 11, 2016 10:22 am
Different Computers offline
User avatar
Posts: 2576
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
clock.config(text=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)

tick()
root.mainloop( )

Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP

Posted on
Sun Dec 11, 2016 11:31 am
Colorado4Wheeler offline
User avatar
Posts: 2794
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: No registered users and 1 guest