SecondsSinceLastChange

Posted on
Wed Apr 06, 2016 6:29 pm
matt (support) offline
Site Admin
User avatar
Posts: 20692
Joined: Jan 27, 2003
Location: Texas

Re: SecondsSinceLastChange

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.

Image

Posted on
Tue Aug 02, 2016 2:17 pm
Hackencrash offline
User avatar
Posts: 230
Joined: Dec 16, 2015
Location: UK

Re: SecondsSinceLastChange

I get a 404 on the download dropbox link on the first page :(

Posted on
Tue Aug 02, 2016 2:44 pm
kw123 offline
User avatar
Posts: 7771
Joined: May 12, 2013
Location: Dallas, TX

Re: SecondsSinceLastChange

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

Posted on
Tue Aug 02, 2016 2:47 pm
Hackencrash offline
User avatar
Posts: 230
Joined: Dec 16, 2015
Location: UK

Re: SecondsSinceLastChange

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:

Posted on
Tue Aug 02, 2016 2:48 pm
kw123 offline
User avatar
Posts: 7771
Joined: May 12, 2013
Location: Dallas, TX

Re: SecondsSinceLastChange

sorry for that, I switch to that method just recently ..

Posted on
Tue Aug 02, 2016 2:57 pm
Hackencrash offline
User avatar
Posts: 230
Joined: Dec 16, 2015
Location: UK

Re: SecondsSinceLastChange

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 :)

Posted on
Tue Aug 02, 2016 2:59 pm
kw123 offline
User avatar
Posts: 7771
Joined: May 12, 2013
Location: Dallas, TX

Re: SecondsSinceLastChange

it should do it:: last and last-1 change

called:
seconds_xxx
secondsPrevious_xxx

Posted on
Tue Aug 02, 2016 3:03 pm
Hackencrash offline
User avatar
Posts: 230
Joined: Dec 16, 2015
Location: UK

Re: SecondsSinceLastChange

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)

Posted on
Wed Jun 14, 2017 5:02 pm
siclark offline
Posts: 1620
Joined: Jun 13, 2017
Location: UK

Re: SecondsSinceLastChange

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

Posted on
Wed Jun 14, 2017 5:21 pm
kw123 offline
User avatar
Posts: 7771
Joined: May 12, 2013
Location: Dallas, TX

Re: SecondsSinceLastChange

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

Posted on
Wed Jun 14, 2017 11:54 pm
howartp offline
Posts: 4286
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: SecondsSinceLastChange

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

Posted on
Thu Jun 15, 2017 8:59 am
siclark offline
Posts: 1620
Joined: Jun 13, 2017
Location: UK

Re: SecondsSinceLastChange

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!

Posted on
Fri Jun 16, 2017 3:55 pm
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: SecondsSinceLastChange

Link in first post to plug in download appears to be broken.

Posted on
Fri Jun 16, 2017 4:15 pm
howartp offline
Posts: 4286
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: SecondsSinceLastChange

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

Posted on
Fri Jun 16, 2017 4:16 pm
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: SecondsSinceLastChange

Ahh....thanks.

Who is online

Users browsing this forum: No registered users and 1 guest