New Plugin: GhostXML

Posted on
Sun Jul 16, 2017 12:34 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: New Plugin: GhostXML

Try this:

dtich wrote:
the pertinent script section:

Code: Select all
 def printOverview(self):
        """print a short overview of the plant data"""
        for v in self.getPlantOverview():
            print("%15s (%15s): %s %s" %
                (v['name'], v['meta'], v['value'], v['unit']))

# INDIGO UPDATE VARIABLES SECTION

# indigo.variables[1822257245] # "PV_EToday"
# indigo.variables[1469286291] # "PV_ETotal"
# indigo.variables[789149473] # "PV_Mode"
# indigo.variables[1958563501] # "PV_Pac"
# indigo.variables[532315452] # "PV_Overview"

            if (v['meta'] == 'GriEgyTdy'):
                        indigo.variable.updateValue(1822257245, v['value'])
            if (v['name'] == 'GriEgyTot'):
                        indigo.variable.updateValue(1469286291, v['value'])
            if (v['name'] == 'GriPwr'):
                        indigo.variable.updateValue(1958563501, v['value']) 
            if (v['name'] == 'Mode'):
                        indigo.variable.updateValue(789149473, v['value'])

    # wrapper methods for the RPC functions

    def getPlantOverview(self):
        res = self._rpc(self.newRequest('GetPlantOverview'))
        return res['overview']

    def getDevices(self):



I always highlight and copy/paste the spaces or tabs which are working onto the ones which aren't. Personally I do it all with tabs, not spaces, but the original code has been written with spaces so I copied the spaces before the "print" line.

Posted on
Sun Jul 16, 2017 12:39 pm
autolog offline
Posts: 3989
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: New Plugin: GhostXML

dtich wrote:
... NOTE: interestingly, the code as i posted it here, does have different indents, but in BBEdit it does not. so, i deleted all spaces and reindented those lines, but.. still same result. odd. thoughts?

Probably mentioned elsewhere, but when you indent in Python, you can't mix tabs and spaces - it must be all tabs or all spaces. Personally I use spaces. :)

:idea: It would be kind of useful if Indigo converted all tabs to spaces because this type of error is difficult to pick up in the embedded script dialogue as there isn't a mechanism to show invisibles. :)

Posted on
Sun Jul 16, 2017 12:51 pm
dtich offline
Posts: 798
Joined: Sep 24, 2005

Re: New Plugin: GhostXML

hey guys, thanks!

i cut and pasted what you posted, peter, there was one errant indent at the end, removed, and now works!

thank you!

i try to be good about tabbing, but... obv not good enough. i've redone that section myriad times, so annoying.

so. now.

the (almost) only thing not working is the log at the end. can't sort which variable should be in there. but, this is not a deal breaker....

thank you all.

Posted on
Sun Jul 16, 2017 1:16 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New Plugin: GhostXML

dtich wrote:
NOTE: interestingly, the code as i posted it here, does have different indents, but in BBEdit it does not. so, i deleted all spaces and reindented those lines, but.. still same result. odd. thoughts?


Use BBEdit's Text->Detab... command to convert all the tabs in the file to spaces. And set the preferences to insert 4 spaces instead of tabs. Using actual tab characters in Python is asking for trouble.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Jul 16, 2017 1:22 pm
dtich offline
Posts: 798
Joined: Sep 24, 2005

Re: New Plugin: GhostXML

copy that! thank you.

Posted on
Sun Jul 16, 2017 1:58 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: New Plugin: GhostXML

If you mean the log about unicode(swb) then get rid of the line - that was troubleshooting towards Dave's better approach of JSONing the data but you're not using that for now.


Sent from my iPhone using Tapatalk Pro

Posted on
Sun Jul 16, 2017 2:47 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

Definitely agree that you can get rid of that line. It was as Peter suggests, a way to just get the data in a form that we would be able to access it directly.

I must admit I'm not sure where you are with this now, but it sounds like you're on the path to get what you need.

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

[My Plugins] - [My Forums]

Posted on
Sun Jul 16, 2017 7:37 pm
dtich offline
Posts: 798
Joined: Sep 24, 2005

Re: New Plugin: GhostXML

it's good, and working, i posted in the other forum, with pic of control page. i was trying to keep from cluttering your plugin forum with my personal problems. :D

yes, i commented out the log line, even though at some point i would like to log the result of the call in indigo. for now i'll just do it through indigo directly when the variables change.

all good. :D thanks very much for all the help!

Posted on
Sun Jul 16, 2017 8:07 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

Glad to hear it. Cheers!

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

[My Plugins] - [My Forums]

Posted on
Mon Jul 17, 2017 12:16 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: New Plugin: GhostXML

Dave, should we get Jay to do a new subforum for GhostXML like your other plugins, and (if possible) give me mod rights on just this subforum?

I'd like to split this conversation into a new thread, still in your forum, as I'd like to look at getting the JSON approach sorted over time.


Sent from my iPhone using Tapatalk Pro

Posted on
Mon Jul 17, 2017 2:49 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

howartp wrote:
Dave, should we get Jay to do a new subforum for GhostXML like your other plugins, and (if possible) give me mod rights on just this subforum?

That's a good idea. I'll send you a PM to walk through the options.

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

[My Plugins] - [My Forums]

Posted on
Fri Sep 15, 2017 1:10 pm
yassi offline
Posts: 468
Joined: Sep 06, 2015
Location: Germany

Re: New Plugin: GhostXML

Dave, I'm not sure if indeed it' s GhostXML fault but after I've installed it yesterday (3.08) I've observerd today these errors.
A lot of other plugins crashed with errors (APC plugin, Alexa, Online sensor, Fingscan,etc.).
And I didn't have such an error with the older version.

I've disabled it for now (about 10 minutes ago) no error for the moment, I will keep an eye on the logs.

Can you please have a look at these logs here?

Code: Select all
  GhostXML Error                  plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   GhostXML Error                  Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 151, in runConcurrentThread
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 148, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 123, in cpu_count
OSError: [Errno 35] Resource temporarily unavailable

   GhostXML Error                  plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   Airfoil Pro                     Available Airfoil instances: {u'MacBook Pro': u'MacBook-Pro.local:39190', u'Indigo': u'Indigo.local:16355'}
   GhostXML Error                  Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 151, in runConcurrentThread
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 148, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 123, in cpu_count
OSError: [Errno 35] Resource temporarily unavailable

   GhostXML Error                  plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   Indigo Cocoa client authenticated (192.168.100.102)
   GhostXML Error                  versionCheck: Unable to reach the version server.
   GhostXML Error                  Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 151, in runConcurrentThread
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 148, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 123, in cpu_count
OSError: [Errno 35] Resource temporarily unavailable

   GhostXML Error                  plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   GhostXML Error                  Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 151, in runConcurrentThread
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 148, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 123, in cpu_count
OSError: [Errno 35] Resource temporarily unavailable

   GhostXML Error                  plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   apcupsd                         Event comms server started
   apcupsd                         Plugin started. Polling apcupsd server(s) every 5.0 minutes with a timeout of 8 seconds
   apcupsd Error                   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 191, in runConcurrentThread
  File "plugin.py", line 237, in readApcupsd
OSError: [Errno 35] Resource temporarily unavailable

   apcupsd Error                   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)



Thanks in advance!

Yassi

Posted on
Fri Sep 15, 2017 1:24 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

Hi Yassi - I think I know what's going on. Over time, the GhostXML plugin is consuming too many processes and they're therefore unavailable to your other plugins. I don't have time to address the root cause at the moment, but will make it my next priority. In the interim, I suggest downgrading to the last stable version.

I'll pull the most recent update for now. Sorry for the inconvenience!
Dave

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

[My Plugins] - [My Forums]

Posted on
Fri Sep 15, 2017 1:37 pm
yassi offline
Posts: 468
Joined: Sep 06, 2015
Location: Germany

Re: New Plugin: GhostXML

Dave, no problem, take your time!
Thanks for looking so quickly into this!

Ok, until the next version will be out I will go with the old one.

Yassi


Sent from my iPhone using Tapatalk

Posted on
Sun Dec 17, 2017 5:43 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

DaveL17 wrote:
Hi Yassi - I think I know what's going on. Over time, the GhostXML plugin is consuming too many processes and they're therefore unavailable to your other plugins. I don't have time to address the root cause at the moment, but will make it my next priority. In the interim, I suggest downgrading to the last stable version.

I'll pull the most recent update for now. Sorry for the inconvenience!
Dave

This condition should be much improved in the most current version of the plugin (which can be found in the Indigo Plugin Store).

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

[My Plugins] - [My Forums]

Page 12 of 20 1 ... 9, 10, 11, 12, 13, 14, 15 ... 20

Who is online

Users browsing this forum: No registered users and 1 guest