Matplotlib Plugin for Indigo 7 - New!

User avatar
Busta999
Posts: 714
Joined: Wed Mar 30, 2016 4:48 am
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Post by Busta999 »

Ok absolutely no reason to spend anytime on this - but I found it puzzling....

I have a graph that tracks daily power consumption of the Fridge and the Freezer, retentive I know, but having found a rogue fridge freezer using nearly 3Kw a day - Three times more than it should , I keep an eye on them now :-)

Suddenly the graph was going weird.

I cannot get it to report Fridge Daily Power Usage and the Freezer Daily Power usage is plain wrong.

So I recreated the graph again and that, test one, works fine.

I cannot for the life of me work out what I have done to make this no longer work, oh and I am sure it is operator error, just can't find it.

See attached pics...
Config for replacement graph
Config for replacement graph
Fridge Freezer Daily Power Usage Graph - Test.jpeg (146.8 KiB) Viewed 4352 times
Config for original graph
Config for original graph
Fridge Freezer Daily Power Usage Graph.jpeg (155.83 KiB) Viewed 4352 times
Replacement Graph - showing correctly
Replacement Graph - showing correctly
Chart - Test Fridge Daily Power Usage.png (21.26 KiB) Viewed 4352 times
Original Graph - now wrong
Original Graph - now wrong
Chart - Fridge Freezer Daily Power Usage.png (21.37 KiB) Viewed 4352 times
Can you see where I am going wrong?
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

Not sure if this is the sum total of the issue, but in the first example line 1 is 'Fridge Daily Power Usage' and line 2 is 'Freezer Daily Power Usage'. In the second example, line 1 and line 2 are both plotting 'Fridge Daily Power Usage'.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
Busta999
Posts: 714
Joined: Wed Mar 30, 2016 4:48 am
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Post by Busta999 »

And there you have it - a fresh pair of eyes sees all - I have been going over and over that again and again and did not see the elephant! Darn it. I tweaked that 2nd line at some point yesterday because the graph was scaling from 1 to -10 - which is odd for energy usage - there was no negative data and the lines were occurring in the top sliver of the graph. So I changed the line data to force it to recalibrate - and somehow put back the wrong data - at least I was right it was operator error. - Thans for spotting that.


Sent from my iPad using Tapatalk
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

I completely understand. For example, see my discussion of two bugs in the WUnderground plugin from Friday. :)
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Hi,

First off, I have to say this is a great plugin. Having graphs on my control pages makes the page look so much more interesting.

I do have a problem, I have 5 CSV engines collecting data from various devices and everything appears to be working perfectly then without warning it just stops collecting data for all 5. When I restart the plugin it resumes collecting the data and everything is working again. Is this normal? Should I restart the plugin each day?


Thanks
Deuan
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

Glad you like the plugin! This behavior is definitely not normal.
  1. You say that you have 5 CSV engines. Do you mean that you have five separate CSV engine devices running? This *should* work without any errors, but that doesn't mean that it will. I'd recommend trying just one CSV engine device and have that one device manage the five data sources.
  2. Do you see any helpful information in the log file when the plugin stops working? Depending on your Indigo version there may be a log file located in this folder (Indigo 7 as example) which might provide some more insight because things are saved there that aren't written to the Indigo event log.

Code: Select all

/Library/Application Support/Perceptive Automation/Indigo 7/Logs/com.fogbert.indigoplugin.matplotlib/plugin.log
Any insight you can give me at the point the plugin fails will help me isolate the issue you're seeing. As always, please check any log data for personal information before posting it.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Thanks Dave,

I will give this a try with just one engine and see what happens.
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Hi Dave,

I am now just running one CSV collector with one device value and it's been running for a few hours now which is longer than before.


However I do see these errors
2018-01-09 14:17:15.557 Error client connection ID (CFBundleIdentifier) not unique: com.fogbert.indigoplugin.matplotlib
2018-01-09 14:17:18.323 Error plugin "Matplotlib 0.5.01" (pid 36540) failed to start -- restarting in 5 seconds

and after a while of the plugin running I can no longer edit the chart as It appears the plugin is not responding.

I did see an error, but I cannot find it in the logs now as the logs are very big. I will try to get the error to you later.
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Hi Dave,

This is the error I get after the plugin has been running for a few hours and I try to edit the CSV engine.


Error (client) timeout waiting for plugin response from com.fogbert.indigoplugin.matplotlib for request UiGetValues2
Error (client) timeout waiting for plugin response from com.fogbert.indigoplugin.matplotlib for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

At this point I cannot edit the plugin settings and have to restart it in order to change the configuration of the CSV engine

Hope this helps.

Deuan
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

Hmmm. I can't reproduce your error and based on the information above, it looks like your CSV engine has gotten into a bad state.

Please paste the following code into an Indigo scripting window, replace the device ID with the ID of your CSV engine device, and post the result back here. Please be sure to look over the information before posting to mask any sensitive information. If you'd prefer, you can send it to me via a private message.

Code: Select all

dev = indigo.devices[445253253]
indigo.server.log(unicode(dev))
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Thanks Dave,

here is the output from the command

Code: Select all

   Script                          address : 
batteryLevel : None
buttonGroupCount : 0
configured : True
description : 
deviceTypeId : csvEngine
displayStateId : onOffState
displayStateImageSel : SensorOn
displayStateValRaw : True
displayStateValUi : Updated
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 389265641
globalProps : MetaProps : (dict)
     com.fogbert.indigoplugin.matplotlib : (dict)
          addItemFieldsCompleted : false (bool)
          addKey :  (string)
          addSource :  (string)
          addState :  (string)
          addValue :  (string)
          columnDict : {u'k1': (u'kw', u'1544181775', u'value')} (string)
          columnList :  (string)
          editKey :  (string)
          editSource :  (string)
          editState :  (string)
          editValue :  (string)
          isColumnSelected : false (bool)
          numLinesToKeep : 200 (string)
          previousKey :  (string)
id : 672292413
lastChanged : 2018-01-10 08:26:13
lastSuccessfulComm : 2018-01-10 08:26:13
model : CSV Engine
name : Main CSV Engine
ownerProps : com.fogbert.indigoplugin.matplotlib : (dict)
     addItemFieldsCompleted : false (bool)
     addKey :  (string)
     addSource :  (string)
     addState :  (string)
     addValue :  (string)
     columnDict : {u'k1': (u'kw', u'1544181775', u'value')} (string)
     columnList :  (string)
     editKey :  (string)
     editSource :  (string)
     editState :  (string)
     editValue :  (string)
     isColumnSelected : false (bool)
     numLinesToKeep : 200 (string)
     previousKey :  (string)
pluginId : com.fogbert.indigoplugin.matplotlib
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     csvLastUpdated : 2018-01-10 08:26:13.022558 (string)
     onOffState : true (bool)
     onOffState.ui : Updated (string)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
Hope it helps
Deuan

Moderator's Note: edited to put device dict in code block.
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

Thanks. I was interested in seeing the entry for 'columnDict' which appears to be constructed properly. In fact, nothing I can see about the CSV engine object looks out of place (I must admit that I'm struggling with the flu so I am more delirious than normal so I might miss something....)

I'd like you to try resetting the plugin preferences by taking the following steps.
  1. Disable the plugin in Indigo.
  2. Stop the Indigo server by selecting Stop Server from the Indigo menu.
  3. Delete the following file:

    Code: Select all

    /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins/com.fogbert.indigoplugin.matplotlib.indiPref
  4. Restart Indigo
  5. Open the Matplotlib plugin preferences and re-enter the settings as needed.
Hopefully, this will set things right.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
deuan
Posts: 30
Joined: Wed Jan 03, 2018 8:08 pm

Re: Matplotlib Plugin for Indigo 7 - New!

Post by deuan »

Thanks Dave,

Sorry to hear you have the Flu, I hope you are feeling better soon. I will not bother you with my little issues until you are feeling better but I will give what you have suggested a go.

Thanks again for all your help.

Deuan
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Matplotlib Plugin for Indigo 7 - New!

Post by DaveL17 »

Don't worry about that, it's my choice to be here. :D

I'm starting to believe that a plugin may be causing a bottleneck. Another user is seeing similar behavior with the WUnderground plugin and we think it might be a misbehaving plugin. One way to test is to disable all your plugins and re-enable them one at a time to see if you're still having trouble. You might also be able to learn something with Activity Monitor if there's a process that's causing a bottleneck.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
Post Reply

Return to “Matplotlib Plugin”