Page 3 of 4

Re: SecondsSinceLastChange

PostPosted: Wed Apr 06, 2016 6:29 pm
by matt (support)
Asconasny wrote:
I will check the activity monitor if I'm nearby the server when/if it happens again.

If you notice an Indigo related process taking up a lot of CPU resources in the Activity Monitor, then get info on that process and copy/paste the contents of the Open Files and Ports tab. Each Indigo plugin runs in its own process, but by looking at the open file info you can figure out which plugin it is.

Another possible culprit would be any AppleScripts you might have Indigo executing. If those are run embedded in the Indigo Server then they can block other requests resulting in the timeous you've seen.

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:17 pm
by Hackencrash
I get a 404 on the download dropbox link on the first page :(

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:44 pm
by kw123
when I click on the link it works.
here the link again:
https://www.dropbox.com/s/nivfqjve2s5pkmk/secondsSinceLastChange-v-0-6-7.zip?dl=1

Karl

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:47 pm
by Hackencrash
OK, got it. I was using the link on the first page, similarly to how you do piBeacon updates and not using the link in the last post :oops:

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:48 pm
by kw123
sorry for that, I switch to that method just recently ..

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:57 pm
by Hackencrash
OK it was worth a try.

I have a door which has two states: open (on) and closed (off). I was hoping this would give me the ability to give number of seconds since last opened AND number of seconds since last closed, but it just gives number of seconds since state change.

Oh well, no worries :)

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 2:59 pm
by kw123
it should do it:: last and last-1 change

called:
seconds_xxx
secondsPrevious_xxx

Re: SecondsSinceLastChange

PostPosted: Tue Aug 02, 2016 3:03 pm
by Hackencrash
Yes I understand that, but then I'd have to check against the current state to see whether last -1 relates to last opened or last closed, so I may as well just do what I want in Python - was just being lazy and saw your plugin - that's all 8)

Re: SecondsSinceLastChange

PostPosted: Wed Jun 14, 2017 5:02 pm
by siclark
This looks like just the thing I wanted to be able to put time since each PIR last triggered on my Alarm control page, except some devices are not triggered for days, and even over a few minutes, it would be better to show this as minutes and hours since last trigger. ie if seconds < 60 then show seconds/60, if < 3600 show seconds / 3600 = minuets else seconds / 216000 = hours.
Is there an easy way to do this? Do I need to use code to create new variables again?
Cheers

Re: SecondsSinceLastChange

PostPosted: Wed Jun 14, 2017 5:21 pm
by kw123
we could do that but then you need another variable to tell if it is sec/min/hour or you would need to parse the string
e.g. scripts do not like "55 min" you would then need to do
Code: Select all
value = indigo.variable["1862592591"].value
theSplit = value.split(" ")
theValue = theSplit[0]
theUnit  = theSplit[1]

that is somewhat complicated and you could not just use indigos conditions since you must compare to a plain number..

if I understand your post correctly.

One way around it: your decision criteria for lets say >5 hours would be 5*3600 = 18000
if variable value > 18000 ... in the indigo condition page

Karl

Re: SecondsSinceLastChange

PostPosted: Wed Jun 14, 2017 11:54 pm
by howartp
I think the EPS Device Extensions plugin can convert seconds to hours/minutes. Create a conversion device and point it at your secondssincelastchange value and tell it to format it.


Sent from my iPhone using Tapatalk Pro

Re: SecondsSinceLastChange

PostPosted: Thu Jun 15, 2017 8:59 am
by siclark
Cheers... there is actually a time conversion from last changed property to now, which does exactly what I want. Need to spend more time going through all the plugins, seems like I want them all!

Re: SecondsSinceLastChange

PostPosted: Fri Jun 16, 2017 3:55 pm
by johnfdl
Link in first post to plug in download appears to be broken.

Re: SecondsSinceLastChange

PostPosted: Fri Jun 16, 2017 4:15 pm
by howartp
https://www.dropbox.com/s/nivfqjve2s5pk ... 7.zip?dl=1

Karl has different URLs for each version and posts them throughout the thread as he updates things...

Not a method that's to everyone's tastes though!


Sent from my iPhone using Tapatalk Pro

Re: SecondsSinceLastChange

PostPosted: Fri Jun 16, 2017 4:16 pm
by johnfdl
Ahh....thanks.