Delayed action time into a Variable

Posted on
Wed Oct 16, 2019 8:53 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Delayed action time into a Variable

Is there a way to put the time of a Delayed action into a Variable?
(So we could see at the control page when something is going to happen)

The script below won't work because the Schedule ID number of a Delayed action is every time another number.

Code: Select all
s = indigo.schedules[1202963906] # some schedule ID
indigo.variable.updateValue(1983277859, value="{:%H:%M}".format(s.nextExecution)) # some variable ID


Thanks for the help.

Posted on
Wed Oct 16, 2019 9:07 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Delayed action time into a Variable

McJohn wrote:
Is there a way to put the time of a Delayed action into a Variable?
(So we could see at the control page when something is going to happen)

The script below won't work because the Schedule ID number of a Delayed action is every time another number.

Code: Select all
s = indigo.schedules[1202963906] # some schedule ID
indigo.variable.updateValue(1983277859, value="{:%H:%M}".format(s.nextExecution)) # some variable ID


Thanks for the help.


Do you mean a Scheduled action group or a specific delayed action in some group of actions (action group, trigger, scheduled)?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Oct 16, 2019 9:10 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Delayed action time into a Variable

If it's the second option, then there's no way to do it using indigo.schedules because (as you said) the number is never going to be the same. It's created and deleted on the fly.

If you need to know how long it's going to be until the action runs, then you should put that action in it's own action group tied to a Timer device firing, and then you can look at the time remaining state for the Timer device.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Oct 16, 2019 11:03 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Delayed action time into a Variable

FlyingDiver wrote:

Do you mean a Scheduled action group or a specific delayed action in some group of actions (action group, trigger, scheduled)?]


Thanks for the quick reply!
I know it was a difficult question :P

It's about a 50 minutes delay Trigger action (mower has to go to his base station after 50 minutes mowing, so, we want to see when it's ready).

Timer is an idea but that's not the real time at your (Apple)Watch :wink:

Any idea how to solve this?

In the Indigo Schedule delayed action list stays a "Next Execution time" , that time can't be used?

Posted on
Wed Oct 16, 2019 11:11 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Delayed action time into a Variable

McJohn wrote:
Timer is an idea but that's not the real time at your (Apple)Watch :wink:


What does that mean?

McJohn wrote:
In the Indigo Schedule delayed action list stays a "Next Execution time" , that time can't be used?


But there's no guarantee that the number showing is this particular delay. It could be any delay or any other schedule.

Are you trying to get a notification of when the mower is done? Or do you want to know the time it's going to be done? If you want the time, just use a script to calculate the local time 50 minutes later and stick that string in a variable. If you want a running countdown, use a Timer.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Oct 16, 2019 11:22 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Delayed action time into a Variable

Thanks for the explanation.
The real time is the most beautiful solution.

FlyingDiver wrote:
If you want the time, just use a script to calculate the local time 50 minutes later and stick that string in a variable.


That's a good idea!

Do you know such a kind of script?

Thanks!

Posted on
Wed Oct 16, 2019 11:34 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Delayed action time into a Variable


joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Oct 16, 2019 11:47 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Delayed action time into a Variable

Thanks!
Sorry but how can we put this result into an Indigo Variable?

Posted on
Wed Oct 16, 2019 11:53 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Delayed action time into a Variable

McJohn wrote:
Thanks!
Sorry but how can we put this result into an Indigo Variable?


It's in your original post in this thread.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests