indigo utilities discussion

Posted on
Thu May 12, 2016 7:20 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: indigo utilities discussion

Karl,

Sorry, but luck. Your suggestion worked for variables but not for devices. It doesn't matter what device is selected or how many times you select it, not states show.

Any other suggestions?

JP

Posted on
Thu May 12, 2016 8:26 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

don't know what to do.. mine works fine. could I look at your system to see whats wrong?

Posted on
Thu May 12, 2016 8:34 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

the message field (bottom) should state: "select states for device selected",

also could you switch on debug.

as soon as you select a device you should see something like this:
Code: Select all
 utilities                       UiValuesDict : (dict)
     devOrVar : dev (string)
     device : 1312758245 (integer)
     execute :  (string)
     header : no (string)
     id :  (string)
     infoLabel1 :  (string)
     msg : select states for device selected (string)
     numberOfRecords : 50 (string)
     printFile :  (string)
     separator :  (string)
     state0 :  (string)
     state0Condition : any (string)
     state0Value : up (string)
     state1 :  (string)
     state2 :  (string)
     state3 :  (string)
     state4 :  (string)
     state5 :  (string)
     state6 :  (string)
     state7 :  (string)
     state8 :  (string)
     variable : 1177413189 (integer)


.. just need more info

Karl

Posted on
Thu May 12, 2016 1:14 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: indigo utilities discussion

Karl,

I deleted and reloaded the plugin. Everything is fairly straight forward. However, no states show, for any device. The error in the log is:

utilities Error Error in plugin execution UiAction:

Traceback (most recent call last):
TypeError: pickDeviceCALLBACK() takes at most 3 arguments (4 given)

However, I selected --- do not use --- for all the options. Also, as you can see, the ✓ is where the list of states should show. Nothing appears.

JP
Attachments
Screen Shot 2016-05-12 at 3.08.42 PM.png
Screen Shot 2016-05-12 at 3.08.42 PM.png (101.23 KiB) Viewed 5886 times

Posted on
Thu May 12, 2016 1:29 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

ok there is a bug
Code: Select all
 pickDeviceCALLBACK() takes at most 3 arguments (4 given)
.. don't know why.. which version are you using?
latest is 1.7.3

this is the code where it complains. but it works for selecting variables (the 2. def)...
Code: Select all
####-----------------   pickDeviceCALLBACK          ---------
    def pickDeviceCALLBACK(self,valuesDict="",typeId=""):    <======= this throws an error.. have no clue why, this is directly out of the book.  ANY INPUT FROM OTHER DEVELOPERS??
...
####-----------------   pickVariableCALLBACK          ---------
    def pickVariableCALLBACK(self,valuesDict="",typeId=""):  <==== this one  works..
...


Karl

Posted on
Thu May 12, 2016 7:23 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: indigo utilities discussion

Karl,

Using plugin version 1.7.3 with Indigo 6.1.9

JP

Posted on
Thu May 12, 2016 8:03 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

could we do an online session? I would need to look at the things when they happen.

Posted on
Thu May 12, 2016 8:09 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: indigo utilities discussion

Sure, but will need to be tomorrow. Will send you a message to coordinate.


Sent from my iPhone using Tapatalk

Posted on
Thu May 12, 2016 8:10 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

ok

Posted on
Mon Jun 20, 2016 3:22 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

indigo utilities discussion

v 1.7.4 posted

fixed:
SQL report had a typo (one lower case letter instead of upper case theSplit instead of thesplit ).
Sometimes this bombed : --printSQL error in Line '936' ; error='global name 'thesplit' is not defined'--

Karl

Posted on
Thu Jun 23, 2016 9:22 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

v 1.8.1 posted

added: FOR SQL reporting:
increased the number of state from 4 --> 6 that can be reported (or all)
added selection =; != for state#1. Now you can have 2 if/where conditions e.g. "status" =up and temp="0"

Karl

Posted on
Tue Jun 28, 2016 11:25 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

indigo utilities discussion

posted v 1.9.4


ADDED:delete duplicate records in sql data base
This option will go through your indigo SQL database and remove records with the same time stamp- keep only last one. There are several modes:
== test- will create the SQL statements in a file in the indigo utilities directory,
== execute - will execute these sql statements and and print progress in logfile
== execute quiet - will execute the SQL statement , but will not show progress in the log file
+++ you can do this through the menu or through an action (execute and execute quite)
+++ this can take a long time depending on the size of your database.
+++ if you use SQLITE, please stop sqllogger before executing. when finished reenable sqllogger. POSTGRES seems to be better for multi user / access environments.
+++ program will check for errors and stop if any DB-LOCKed conditions occur.
+++ mac records to be deleted parameter can be set in config. depending on your DB, ram etc you can limit the number of records to be deleted in one pass.


Running this on my database removed 50% of the records. This comes from devices that have multiple states that are updated. Indigo creates an update for ALL states everytime it updates
-- each dev.updateStateOnServer() creates a complete update of ALL states in the database of that device.
Example:if you have 5 states that get updated (temp, pressure, update time ...) there will be 5 entries in the SQL database. Only the last one is needed. This is what this option does- deletes all but the last update.


For SQLite you need to run "vacuum" to reduce / reclaim the space.
POSTGRES does one step: it reclaims the empty spaces and reuses it, but does not reduce the database size.. Thats my understanding.


There is no advantage of running this against variables, as they have only one state.

Karl.

Posted on
Thu Jun 30, 2016 10:41 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

posted v 1.9.5

added: support for LARGE databases and many records to be removed (it works with a 50GByte SQLITE db).
When issuing an SQL statement the length of the statement is limited ~ 200kbyte on my mac setup for SQLITE.
It now executes deletes in chunks if the SQL statement gets too long - as many as needed - to remove all duplicate entries. The max SQL command length used can be set in config.

Karl

Posted on
Fri Jul 01, 2016 10:48 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

posted v 1.10.1

added:
- prune option: selectively prune the sql database i.e. keep only records of a specific devices/variables younger than xx days. Indigo only gives the option to set a date for ALL devices or ALL variables.
- create a backup-dump file for a postgres DB. You can put this into a schedule and run it eg at 2 am in the morning. Then your regular backup will pick it up and copy a CONSISTENT version to your backup. Backing up files of a running database will not necessarily result in a consistent version as the field are changed while the backup is running.

Both can be called from the menu, as an action, or in a python script. See examples in the plugin download post.



Karl

Posted on
Sun Jul 24, 2016 11:28 am
gsbrewer offline
Posts: 28
Joined: Jan 22, 2016
Location: Livermore, CA

Re: indigo utilities discussion

Small bug - In the inpPrintdevzWave() function, if any of your ZWave devices has a neighbor list that consists of a single device with a single digit address, there will be no entry displayed for that device.

I worked around that problem by changing line 389 in file plugin.py from:

if len(neighb)< 2: continue

to

if len(neighb)< 1: continue

Please let me know if there is a reason why this change may be bad.

Thank you for the excellent tools!

Who is online

Users browsing this forum: No registered users and 3 guests