in indigo store https://www.indigodomo.com/pluginstore/96/
older versions:
This plugin can be used to track or trigger on the number of seconds since a device/state or variable has changed.
It will show the seconds since last change in a variable .. :
devName_seconds_since_change;
devName_seconds_since_previous_change;
devNameprevious__value
You can set
1. In CONFIG: Name of folder where the variables should go.
2. IN CONFIG: use subscription to changes(indigo calls this plugin for any change in any device) or test values of the selected device/state in a loop every xx seconds.
both work. you can try both modes. the load on the system depends on the number of changes, number of devices and # of device/states you like to track.
3. IN CONFIG: frequency of checks . This is essentially the "self.sleep( time)" between actions : 0.5 seconds .. 10 seconds.
In LOOP mode nothing happens in-between. In Subscribe mode, the variable gets set to "0" if there was a change for the device/state.
4. In MENU: the update frequency -if no change - for EACH device/state or variable, i.e. how often the # of seconds should be updated: 1 second .. 3 minutes
Once running you can set a trigger on these variables
if variable "devName_seconds_since_change" > 60 ==> action.
I suggest to not use 0.5 seconds sleep time and 1 seconds update frequency initially as this will be creating some load on the MAC, start slower and then increase frequency.
Reasonable settings are 3 seconds sleep time and 5 seconds update frequency.
Change log:
v 0.3.1: added option to choose between testing for change in a loop and subscription to changes of devices/ states in indigo.
v 0.3.2: fixed spelling and tool tips in menus
v 7.1.8 major rewrite, now requires indigo 7
Karl
This is how the variables look like, the numbers are the seconds since last change:
print config to logfile (Menu):
- Code: Select all
13:40:20 DevID -Dev-Name---------- ---------------State Data----------
13:40:20 1746527826 -s-0-tmp006 Temperature {u'lastCheck': 1540924773.071432, u'lastChange': 1540924773.071432, u'checkFrequency': 60, u'lastValue': u'72.3', u'previousChange': 1540924722.987179}
13:40:20 -Configuration
13:40:20 VarID -Var-Name---------- Data-------------
13:40:20 1794464921 -youGotmail {u'previousChange': 1540923119.143105, 'lastValue': u'true', "'checkFrequency": 60, 'checkFrequency': 60, 'lastCheck': 1540924803.118547, 'lastChange': 1540923120.584453}