- Posted on
Fri Jun 05, 2015 3:51 am
-
kw123
offline
-
- Posts: 8392
- Joined: May 12, 2013
- Location: Dallas, TX
-
we could create a plugin where you could register devices / variables to be tracked for changes.
you then could use that info for trigger.
it would look like:
menue:
add == device : e.g. Nest
add == state: e.g. FAN
<confirm>
After that the state "Nest:FAN" in the plugin DEVICE "SECONDSsinceCHANGE" would show the seconds since last change.
Any interest?
in the background it would read once (at startup) SQLlogger for last change and then subscribe to any device/ variable change message in indigo and update its states accordingly.
Just an idea, don't know where the problems are..
Karl
we would need:
1. config menue setup to enable/disable subscription to tracking changes
2. track devices
indigo.devices.subscribeToChanges() # setup the subscription
def deviceUpdated(self, origDev, newDev): # called whenever a device gets updated
if origDEV ....:
3. track variables..
indigo.variables.subscribeToChanges() ## same for variables
def variableUpdated(self, origVar, newVar):
if origVar .... :
and then some logic to just filter out the ones we are interested in.