Clock in a control page

Posted on
Sat Oct 07, 2017 12:35 am
Gangotti offline
User avatar
Posts: 81
Joined: Dec 23, 2014
Location: Las Vegas, NV

Clock in a control page

How do get the system time from indigo into a control page so can have a clock on my control page. I have spent several hours hunting through the control page ui and have not found a way to do it. is there a way?

Posted on
Sat Oct 07, 2017 2:09 am
Lucardos offline
Posts: 17
Joined: Aug 31, 2012
Location: Netherlands

Re: Clock in a control page

Perhaps not the most beautiful solution, but definitely the fastest:

I made a schedule to put a timestamp into a variable every minute.
Same you can do for the date, every midnight it puts the new date into a variable.

Posted on
Sat Oct 07, 2017 2:25 am
Duchateau offline
Posts: 9
Joined: Oct 20, 2015

Re: Clock in a control page

This is how i do it
Make a trigger to update a variable "time" every minute
In the action tab run this script :

import locale
locale.D_FMT
#taal nederlans maken#
locale.setlocale(locale.LC_ALL,'nl_NL.UTF-8')

theTime = indigo.server.getTime().strftime("%H:%M")
theTimeStr = str(theTime)
indigo.variable.updateValue(128602617, theTimeStr)

Day = indigo.server.getTime().strftime("%A")
theDayStr = str(Day)
indigo.variable.updateValue(944145736, theDayStr)

Hour = indigo.server.getTime().strftime("%H")
theHourStr = str(Hour)
indigo.variable.updateValue(1052951635, theHourStr)

To change the way the time is shown :
http://strftime.org

Posted on
Sat Oct 07, 2017 11:51 pm
Gangotti offline
User avatar
Posts: 81
Joined: Dec 23, 2014
Location: Las Vegas, NV

Re: Clock in a control page

Thanks for the suggestions and the script, it did exactly what I was looking for! :D :D :D :D :D

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 11 guests