display "next execution" of schedule items?

Posted on
Wed May 31, 2017 5:11 am
johnfdl offline
Posts: 136
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: display "next execution" of schedule items?

THanks. I totally misunderstood what 'scheduled execution' meant. I was thinking it was a delayed action, not an item in the schedule area of Indigo. So that misunderstanding had me down a path for a use case of showing the time remaining for an action that was pending. For example, I have an autoclose on my garage door. I also have an over-ride for the autoclose which one can press a button on the control page to temporarily disable the garage door for two hours, after which it auto reengages. If the over-ride is pressed, I thought it might be nice to display how much time remains on the timer in the control page. I guess I could still do it, perhaps with variables.

Posted on
Wed May 31, 2017 5:27 am
johnpolasek offline
Posts: 869
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: display "next execution" of schedule items?

Look at the "timers and pesters" plugin; I haven't messed with it much, but I think you can create a device with a state that shows how much time is left once you start it.

Posted on
Wed May 31, 2017 5:32 am
johnfdl offline
Posts: 136
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: display "next execution" of schedule items?

Thanks for the pointer John. I'll give it a whirl.

Posted on
Wed May 31, 2017 8:50 am
jay (support) offline
Site Admin
User avatar
Posts: 15777
Joined: Mar 19, 2008
Location: Austin, Texas

Re: display "next execution" of schedule items?

Professor Falken wrote:
Dropping back by here in case anyone else finds this string later also looking to strip leading zeros off of single digit days and/or hours ("May 3" instead of "May 03", or "5:45 pm" instead of "05:45 pm") as I was. Dave's script above works, but it turns out there is a way to do it right from the date formatting.

I found this more robust list of date/time formats, and it includes options for both of those (%e and %l, respectively). These do seem to be working in Indigo. The one for lowercase am/pm (ironically the uppercase %P) doesn't work for me. I haven't tested any of the other ones on this list.

https://linux.die.net/man/3/strftime


Note that %e is a platform specific directive:

Platform specific directives: The full set of format codes supported varies across platforms, because Python calls the platform C library's strftime() function, and platform variations are common. To see the full set of format codes supported on your platform, consult the strftime(3) documentation.


And not an official part of the Python 2.x specification. While very unlikely, it's possible that it won't work in future OS/Python releases. Just a warning.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 0 guests