Matplotlib Plugin for Indigo 7 - New!

Posted on
Mon Nov 14, 2016 11:26 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

I have to run out but I'll try this when I get back, thanks for the help

Feature request - drop down select boxes for State Names and ID's :D

_______
Norm

Posted on
Mon Nov 14, 2016 12:12 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

norcoscia wrote:
Feature request - drop down select boxes for State Names and ID's :D

Yeah, I looked at that when I was initially developing and decided against it--I just can't for the life of me remember why.

I'll add that to the list and have another look for a future update.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 14, 2016 12:39 pm
Woetjes offline
Posts: 117
Joined: Apr 04, 2016
Location: Belgium

Re: Matplotlib Plugin for Indigo 7 - New!

I have the same problem, when I try to create a CSV for the NetAtmo device (temperature or CO2) , I get the same error messages.
I've created a CSV with a variable and value and that's working.

Posted on
Mon Nov 14, 2016 3:37 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Thanks for reporting this. If you don't mind, please report the states list using the above code (with your device ID of course) so that I can see if a pattern is developing. The plugin worked with every state I threw at it in testing, but that testing may not have been enough. I'll also look at the code that converts the state value for saving to CSV to see if there's something more robust I can do there.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 14, 2016 4:58 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

DaveL17 wrote:
Okay, that all looks good (unless you're flipping the state names with the device IDs which I doubt).

This is a long shot, but are you by any chance cutting and pasting the entries into the fields from somewhere else? Sometimes hidden characters or an extra space can come along with the paste. (A hidden character or extra space in the title probably won't hurt anything, but it won't work with an ID or state name).

Please check the path in the plugin configuration dialog to make sure that's entered correctly (both starts and ends with a forward slash).

Please also make sure that you click the "Add Item" button with each entry before you select Save. (If you don't add the item first, the changes won't commit.)

Lastly, please try this test: add a new CSV entry using a variable ID and in the Source State field enter the word 'value' (with no single quotes) and see if that works. You can always delete it later.


I tried all of the above but no joy - same error, no mater what I do :(

_______
Norm

Posted on
Mon Nov 14, 2016 5:03 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

I did some more testing against the method that I'm using to save the CSV data and threw a bunch of stuff at it including integers, floats, strings, booleans, datetime objects, and Unicode characters. I even tried Unicode values for the filename, path, and data. The only error I encountered was that I was able to coerce a UnicodeDecodeError when I threw a Unicode state value at it. For the initiated, I effectively did this to generate the error:

Code: Select all
x = "{0}".format(u"àbç")

However, that wouldn't seem to cover:
Temperature : 52.7 (real)
ambient_temperature_f_int : 73 (integer)

What error messages are you all seeing? There may be additional insight in the plugin log file located at:

Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 7/Logs/com.fogbert.indigoplugin.matplotlib/plugin.log

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 14, 2016 6:19 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

Not anything in the log except a ton of formatting that looks to be associated with the values involved with writing the files for different things. (and the same error of course)

Anyway, I trashed everything that I could find associated with the plugin - restarted the sever and reloaded it just for drill

The one thing I did noticed that looked odd to me (but it might not really be odd) is during reload of the plug in it said it could not find a module named pydevd

see below

Nov 14, 2016, 3:52:29 PM
Installing and enabling plugin Matplotlib v0.2.00
Loading plugin "Matplotlib 0.2.00"
Starting plugin "Matplotlib 0.2.00" (pid 7771)
Matplotlib No module named pydevd
Started plugin "Matplotlib 0.2.00"

The only other thing I can do is crank up the error reporting in the log - right now it is the default, which I think is just warnings..

Otherwise, if this is too hard we can just do what I have done with many things in my life - just give up - if you would like to give up let me know -- no worries :D

_______
Norm

Posted on
Mon Nov 14, 2016 8:26 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

The formatting stuff is just for rollout. It allows me to know what various things are set to in order to see if there's any conflicts. No worries there.

The pydevd thing is a non-issue -- it's needed for integrated debugging in development.

Please reload the plugin and then go into the CSV engine device and try to create a CSV element. Perhaps something will appear in the plugin log file that can help us.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Nov 15, 2016 6:25 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

So somehow I was able to get one item in the CSV engine to work - I'm not sure why it works. (it was an item I had tried before and it did not work) I then added a second item (another variable) and it failed just like all the others.

Something odd I noticed when I went to edit the items in the CSV engine - the working item does not show up in the list - the only way I can see the working item in the engine is to double click on the working item and then when I edit it is shows up - maybe that is normal behavior but figured I would let you know.

Anyway - thanks for trying - I don't think we have a good mechanism to troubleshoot this since nothing I see in the log looks like it will help.

I'm hate to give up but w/o a good next test step I don't want to burn any more calories on this - Maybe after you do a few updates I'll give it a try again - take care and I wish we could have got it to work...

_______
Norm

Posted on
Tue Nov 15, 2016 7:20 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

norcoscia wrote:
So somehow I was able to get one item in the CSV engine to work - I'm not sure why it works. (it was an item I had tried before and it did not work) I then added a second item (another variable) and it failed just like all the others.

Something odd I noticed when I went to edit the items in the CSV engine - the working item does not show up in the list - the only way I can see the working item in the engine is to double click on the working item and then when I edit it is shows up - maybe that is normal behavior but figured I would let you know.

Anyway - thanks for trying - I don't think we have a good mechanism to troubleshoot this since nothing I see in the log looks like it will help.

I'm hate to give up but w/o a good next test step I don't want to burn any more calories on this - Maybe after you do a few updates I'll give it a try again - take care and I wish we could have got it to work...

I can certainly understand why you don't want to spend any more time on this and appreciate you giving the plugin a try. If you wouldn't mind, I just want to understand what you're saying.

You go into the CSV engine device, and complete the Add Data Item block. You complete the Source Title, Source ID and Source State fields and then click the Add Item Button and then click Save. You then return to the CSV engine device and the item you just added does not appear in the dropdown list under Edit Data Item and the only way that you can get it to appear--and here's where I get lost--is to double-click on the working item. If it's not in the dropdown list, it's not clear to me what you're double-clicking on.

I want to be clear about two things:
(1) When you add an item with the CSV engine it should appear in the Edit Items dropdown list immediately--but your additions will not be committed until you click Save.
(2) The data file that results from creating a new data item using the CSV engine will not be created until the next time the CSV data are updated globally (the frequency is set in the plugin configuration screen).

Lastly, and this is just if you're curious. You can run the following code against your CSV engine device within Indigo (replace 'CSV_ENGINE_ID' with the ID of your CSV Engine device).
Code: Select all
indigo.server.log(u"{0}".format(indigo.devices[CSV_ENGINE_ID]))

and in the Indigo log you should see a property called 'columnDict' which contains information about the CSV Engine data elements you've added. It should look something like this:
Code: Select all
          columnDict : {u'k3': (u'barometric pressure', u'1149686816', u'pressure'), u'k2': (u'wunderground humidity', u'1149686816', u'relativeHumidity'), u'k1': (u'wunderground temp', u'1149686816', u'temp')} (string)


Cheers,
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Nov 15, 2016 8:14 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

When I add an item and save it shows up as a device - the one that worked had a green ball under state in the device list. All the others when added had the word false instead of the green ball.

What I was trying to say is if I add a new device (to add another element to the CSV engine) the one item that is working does not show up in the list if I click to edit.

If I double click on the working CSV element and go to edit it-- the working name is in the list . Guess I'm trying to say I would have expected to see every item in the CSV engine when I try to edit no matter if I'm adding a new device or trying to edit an existing one. Hard for me to explain because I'm not sure how it is supposed to work, I don't know if you can have more than one item in each device or not.

I have to run out today - if I have some time later today - I'll see if I can mess with it a bit more.... Thanks again

_______
Norm

Posted on
Tue Nov 15, 2016 8:31 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Okay, we may be onto something here. If I'm understanding your most recent post, it sounds like you are creating more than one CSV Engine Device. That's not necessary (and now I need to do some more testing to see what happens when that's done). You never need more than one CSV Engine device. All CSV data are managed with that one instance. I will go back and make sure that the instructions are clear on that point.

Screen Shot 2016-11-15 at 8.28.07 AM.png
Screen Shot 2016-11-15 at 8.28.07 AM.png (109.84 KiB) Viewed 3226 times


You need a chart device for each chart and only ever need one (or none) CSV Engine device.

Sorry for the confusion!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Nov 15, 2016 12:44 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Just a quick follow up on having multiple CSV Engine devices -- although I developed the plugin with the idea of only ever needing one CSV Engine device per install, I apparently had the sense (or dumb luck) to code the plugin to work with multiple devices.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Nov 15, 2016 2:08 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

Quick update - the one CSV engine device I got going somehow looks to be working properly. I added two more variables to it and their respective CSVs files were created and updated.

I can't add another CSV engine device so something is still not quite right on my end (at least with my setup).

I set the update rate to 1 min so I would not be sitting waiting too long and I was able to generate a plot with both variable values over time - which was great. But then I got the error below - just letting you know in case your are interested - not sure if the 1 min update rate was too much or if something else is wrong.

I turned it off for now - I looked in the plugin log but no entries for that time frame - It just quit writing - also did not see an entry for it restarting (like in the Ingido event log below)... Not sure what caused it to reload since it had already generated the plot attached?

Hope this is helpful to you in some way!

Nov 15, 2016, 11:48:34 AM
Error plugin "Matplotlib 0.2.00" (pid 12121) unexpectedly stopped -- restarting in 5 seconds
Reloading plugin "Matplotlib 0.2.00"
Starting plugin "Matplotlib 0.2.00" (pid 12226)
Matplotlib No module named pydevd
Started plugin "Matplotlib 0.2.00"
Matplotlib Warning Test Plot: X axis label is suppressed to make room for the chart legend.

Nov 15, 2016, 11:49:04 AM
Error plugin "Matplotlib 0.2.00" (pid 12226) unexpectedly stopped -- restarting in 20 seconds
Attachments
2016-11-15_12-04-25.jpeg
2016-11-15_12-04-25.jpeg (42.51 KiB) Viewed 3164 times

_______
Norm

Posted on
Tue Nov 15, 2016 3:05 pm
gonzalo.dios offline
Posts: 5
Joined: Mar 28, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

Hello Dave, thanks for this plugin!

I don´t know if that might be of any help.

I was having exactly the same problem than norcosia and after some trial and error, I realised that I had a item call "None" in my CSV Engine. I decided to delete that item and suddenly everything started to work.

I can't remember why this "None" item was in my CSV engine. Maybe a faulty item creation at the beginning?.

Regards
Gonzalo

Who is online

Users browsing this forum: No registered users and 5 guests

cron