App Version 1.4.3 real time clock

General Discussion on DemoPad or related products
User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

App Version 1.4.3 real time clock

Post by DemoPad » Fri Mar 29, 2013 1:51 pm

App version 1.4.3 includes the ability to query the iOS device clock, and set one or more number variables. You can then use the number custom actions to set flags etc to build up timing logic for your actions - for example only take certain actions after 9pm, or only at weekends etc.

In the action type 'Set a Number', you can enter any of the following as the data (ensure that your number variable's min & max properties are appropriate for the data returned):

#CURRENTTIME - which returns hours & minutes, eg "1430" for half past 2 in the afternoon, or "900" for 9am
#CURRENTHOUR - returns the hour in the range 0-23 (24h format)
#CURRENTMINUTE - returns the minute in the range 0-59
#CURRENTSECOND - returns the second in the range 0-59
#CURRENTDAY - returns the day of the month, in the range 1-31
#CURRENTMONTH - returns the month in the range 1-12
#CURRENTYEAR - return the year, eg "2013"
#CURRENTDAYOFWEEK - returns the day of the week in the range 1-7 (1=Saturday, 2=Sunday etc)

cv27
Posts: 233
Joined: Sat Nov 24, 2012 10:15 pm
Location: Montréal, QC, Canada

Re: App Version 1.4.3 real time clock

Post by cv27 » Sat Mar 30, 2013 7:09 pm

A dream come true! Thanks guys, well done!

Not finding 1.4.3 on iTunes today, I assume its "coming soon"?

I'm also puzzled by the fact that the desktop portion doesn't need updating. How does 2.135 know that #current... is a variable to be resolved at execution? Unless you guys slipped logic in the last version in anticipation of real time clock support. Just curious.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: App Version 1.4.3 real time clock

Post by DemoPad » Sat Mar 30, 2013 7:51 pm

1.4.3 is currently with Apple for review, should be released soon. No update to the PC software is required, you can already put plain text in the 'set a number' data field, for things like setting numbers equal to other variables, or using the [+] [-] [*] [/] operators etc. It is the app that decides what to do with the data.

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: App Version 1.4.3 real time clock

Post by ChrisB75 » Mon Apr 08, 2013 6:26 pm

Great this was released today, should make a real difference, thanks :D Probably a stupid question but how can I display the time? Thanks, Chris

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: App Version 1.4.3 real time clock

Post by DemoPad » Mon Apr 08, 2013 7:17 pm

When you have grabbed your number variable, either in the custom actions for the number, or just after setting the number variable to say #CURRENTTIME, set a label equal to that number variable using square brackets, eg:

Set MyTimeNumber = #CURRENTTIME
Set MyTimeTextLabel = [MyTimeNumber]

which will convert it to a text label & display on a linked object.

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: App Version 1.4.3 real time clock

Post by wwat » Tue Apr 09, 2013 7:48 pm

Still stuck on trying to display the current time in a text object. The text object displays the max property.
Also I was also wondering why we couldn't just set the label variable using the #CURRENTTIME expression directly instead of having to set a number variable first.


Here is what I've tried so far, from the page load event:

Set a number variable to current time using the following expression in the data field:
#CURRENTTIME

Set a label variable to the number variable using the following expression in the data field:
[nCurrentTime] (where nCurrentTime is the name of the number variable

The set the dynamic label property to the name of the label variable:
CurrentTime
Last edited by wwat on Tue Apr 09, 2013 9:08 pm, edited 1 time in total.

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: App Version 1.4.3 real time clock

Post by ChrisB75 » Tue Apr 09, 2013 8:41 pm

Thanks for the reply, unfortunately I still can't display the time. The way I've tried it is creating images for hours (number variable = Hour, min 0 max 24 default 0) and minutes (number variable is Minutes, min 0 max 60 default 0) set to reveal based on flags for each Hour (00hr to 23hr) and each minute (00min to 59min). I then set custom actions separately for Hours and Minutes so for 'Hour' 0 to 0 sets Group Hours off and 00hr on; 1 to 1 sets Group Hours off and 01hr on; 2 to 2 sets Group Hours off and 02hr on and so on plus the same for minutes (took ages!?). I set Page Load Action as Set Number 'Hour' to #CURRENTHOUR and 'Minute' as #CURRENTMINUTE. However, it always just displays 00:00. I've tried these actions repeating every second but still no joy. Any thoughts please? Thanks, Chris

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: App Version 1.4.3 real time clock

Post by ChrisB75 » Tue Apr 09, 2013 9:08 pm

Oh dear, I'm such an idiot and how embarrassing :oops: !!!! I hadn't updated the app on my iPad that I've been trying to get this to work on - works fine now! d'Oh! :D

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: App Version 1.4.3 real time clock

Post by wwat » Tue Apr 09, 2013 9:14 pm

I'm glad you sorted it out :) we have all been there so don't feel bad.

I'm just stunned t hat we have to go to those lengths to display the time on a page. Why can't we simply set the a text object to the current time variable? This is not an ideal implementation by Demopad if you ask me.

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: App Version 1.4.3 real time clock

Post by wwat » Tue Apr 09, 2013 10:42 pm

Hi Chris,

I worked out what the problem this end, I had set the maximum for the number variable set to 100.

I have a question for you. Are you using images to display the time because you want to or because you couldn't get a text object to work? You seems to have gone to a lot of trouble to display the time using images when you could have done it using the text object very easily.

Thanks.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: App Version 1.4.3 real time clock

Post by DemoPad » Wed Apr 10, 2013 9:13 am

wwat wrote:I'm just stunned t hat we have to go to those lengths to display the time on a page. Why can't we simply set the a text object to the current time variable? This is not an ideal implementation by Demopad if you ask me.
We will put the ability to set a label equal to any of the time parameters in the next version of the app, but the purpose of implementing it with numbers was not to display it on screen (the time is already on the top status bar anyway). The purpose was to give you access to the time/date components so that you can fire custom number actions to set flags (eg a 'daytime' flag, or a 'winter' flag, or a 'weekend' flag), to allow you to, for example, only dim the lights after pressing a 'turn cinema on' button when it is nighttime, or only perform other actions in summer, etc etc. It just so happens that you can also display the values on screen if you want by using a label, but this is a side effect.

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: App Version 1.4.3 real time clock

Post by ChrisB75 » Wed Apr 10, 2013 10:47 am

Yep, I'd gone to all that trouble just cos I wanted a nice-looking clock (I should get out more :D ), at least, one that I think is more readable than the tiny one at the top of the page plus it fits-in with my volume display. As Demopad said, the main advantage with now having the clock is that actions can be based depending upon time - for example, I can now update my 'Watch TV' button so that it will include turning certain lights on if its dark. Great work Demopad, thanks :D

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: App Version 1.4.3 real time clock

Post by wwat » Wed Apr 10, 2013 3:42 pm

DemoPad wrote: We will put the ability to set a label equal to any of the time parameters in the next version of the app, but the purpose of implementing it with numbers was not to display it on screen (the time is already on the top status bar anyway). The purpose was to give you access to the time/date components so that you can fire custom number actions to set flags (eg a 'daytime' flag, or a 'winter' flag, or a 'weekend' flag), to allow you to, for example, only dim the lights after pressing a 'turn cinema on' button when it is nighttime, or only perform other actions in summer, etc etc. It just so happens that you can also display the values on screen if you want by using a label, but this is a side effect.
Thanks for the reply. Actually I submitted a feature request (probably along with many others) for access to the system clock, in my case specifically to *display* the time and date on the screen. That is one thing that is rather difficult and somewhat cumbesome to do without access to the system clock because it can become processor heavy if you have to do it over the network. Eventually I'm hoping that you will provide us with the option to remove the default status bar because it is useless for home automation front end. You can't read the time unless you are very close and the unit is plugged in so there is no problem with the battery running dry, all I want to see is my home automation application.

The other time/date triggering functionality is all available in the back end (ISY) and I would not have thought you would be encouraging so much processing on the front end however I can see that some folks may not have the ability to do back end processing of this nature and it would be helpful for them.

This is a nice addition, it will be helpful if you can allow the time/date variables to be placed directly into a label variable.

Many thanks, Wayne

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: App Version 1.4.3 real time clock

Post by wwat » Wed Apr 10, 2013 3:47 pm

ChrisB75 wrote:Yep, I'd gone to all that trouble just cos I wanted a nice-looking clock (I should get out more :D ), at least, one that I think is more readable than the tiny one at the top of the page plus it fits-in with my volume display. As Demopad said, the main advantage with now having the clock is that actions can be based depending upon time - for example, I can now update my 'Watch TV' button so that it will include turning certain lights on if its dark. Great work Demopad, thanks :D
Wow you sound like me :) perhaps I wouldn't go quite that far.

You know that there are some very nice digital fonts available, the ones that look like a digital clock radio.. I'm looking at using that style. I'd be interested in seeing what your graphics look like if you are open to posting a sample and you have the time.

Wayne

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: App Version 1.4.3 real time clock

Post by DemoPad » Wed Apr 10, 2013 4:05 pm

wwat wrote: The other time/date triggering functionality is all available in the back end (ISY) and I would not have thought you would be encouraging so much processing on the front end however I can see that some folks may not have the ability to do back end processing of this nature and it would be helpful for them.

This is a nice addition, it will be helpful if you can allow the time/date variables to be placed directly into a label variable.

Many thanks, Wayne
Yep, the idea was to give users who don't have a central 'brain' in their system the ability to perform time based actions. You can now place the date/time variables directly into a label variable in version 1.4.4 of the app, when it is released.

Post Reply