Page 11 of 37

Re: ClimateDataCalculation

Posted: Mon Apr 13, 2015 7:56 pm
by Mastiff
Nope, same again. It's under "Current version"?

Re: ClimateDataCalculation

Posted: Tue Apr 14, 2015 5:20 am
by krambriw
Yes, it is under 'Current version'

Just to align, below is how it looks like for me now

Also, attached are the files I'm using (should be the same)
CreateComboHtml.py
(17.64 KiB) Downloaded 58 times
__init__.py
(72.45 KiB) Downloaded 85 times
Best regards

Skärmklipp.PNG

Re: ClimateDataCalculation

Posted: Tue Apr 14, 2015 6:40 am
by Mastiff
Sorry, it seems it was EG, not your plug-in. As you suggested before the changes a couple of versions back I had taken a copy of the plug-in directory, wich got the name "ClimaDataCalculation - Kopi". For some rason EG suddenly started to use that directory instead of the regular one! When I moved that to another drive, it all works. Strange stuff... :shock:

I don't know if it's related, but now I suddenly get this on the FTP upload:

Code: Select all

08:39:09            Exception in thread Thread-40:
08:39:09            Traceback (most recent call last):
08:39:09              File "threading.pyc", line 532, in __bootstrap_inner
08:39:09              File "threading.pyc", line 484, in run
08:39:09              File "52", line 6, in fileTransfer
08:39:09              File "ftplib.pyc", line 116, in __init__
08:39:09              File "ftplib.pyc", line 134, in connect
08:39:09              File "ftplib.pyc", line 209, in getresp
08:39:09              File "ftplib.pyc", line 195, in getmultiline
08:39:09              File "ftplib.pyc", line 182, in getline
08:39:09              File "socket.pyc", line 406, in readline
08:39:09            error: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
08:39:09            
08:39:09            Exception in thread Thread-41:
08:39:09            Traceback (most recent call last):
08:39:09              File "threading.pyc", line 532, in __bootstrap_inner
08:39:09              File "threading.pyc", line 484, in run
08:39:09              File "52", line 6, in fileTransfer
08:39:09              File "ftplib.pyc", line 116, in __init__
08:39:09              File "ftplib.pyc", line 134, in connect
08:39:09              File "ftplib.pyc", line 209, in getresp
08:39:09              File "ftplib.pyc", line 195, in getmultiline
08:39:09              File "ftplib.pyc", line 182, in getline
08:39:09              File "socket.pyc", line 406, in readline
08:39:09            error: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
08:39:09            
Restarting EG doesn't change it either. It takes around 20 seconds from the upload starts until the error comes.

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 9:31 am
by krambriw
Sorry, no idea what could be the cause, error says you failed to connect

If you do not want a huge list of error messages if it fails you can modify the script with a try/except clause

Like in this example:

Code: Select all


from threading import Thread, Event

def fileTransfer(transferCommandThreadEvent, fname):
    try:
        transferCommandThreadEvent.wait(5.0)
        from ftplib import FTP
        ftp = FTP('ftp.....t')
        ftp.login('user', 'pasword')
        f = open("path to file"+fname, 'r')
        ftp.cwd('/HighCharts')
        try:
            ftp.delete(fname)
        except:
            pass
        ftp.storlines('STOR '+fname, f)
        ftp.quit()
        f.close()
    except:
        print 'Transfer attempt failed'
    while not transferCommandThreadEvent.isSet():
        transferCommandThreadEvent.wait(0.5)

fname = 'ComboDewPoint.html'

transferCommandThreadEvent = Event()
transferCommandThread = Thread(
    target=fileTransfer,
    args=(transferCommandThreadEvent, fname)
)
transferCommandThread.start()
transferCommandThreadEvent.set()



Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 9:38 am
by Mastiff
It seems to work fine now, but I think I will use that anyway. Nice to have a single line in the log saying that the upload failed. :) Thanks!

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 10:41 am
by Mastiff
Wow! What the ...? :cry: I was going to implement the new reports (a whole bunch of 'em) on my home system, and I didn't see the lines for personalizing the headings! I had copied the plug-in directory from my cabin setup to the home setup, and I had checked that they are identical to the number of bits. Still I did not see those lines. Suddenly I understood it! I have twice as many sensors at home (well, the house is bigger than the cabin, of course...), and that meant that on a 1440x900 resolution the configuration window was to large to show! :roll: I can of course change the resolution to see it, but shouldn't there be scroll bars when the configuration window is too large? Or maybe EventGhost doesn't support that? When I get the rest of the rooms here covered I'll have to go up to an even higher resolution to see everything! :mrgreen:

Edit: Why 1440x900? Because I do all my work on these VNCs on a 1920x1080 monitor in VNC, and 900 means that there are no scroll bars in the VNC window.

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 2:13 pm
by krambriw
Re-design on the way...

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 2:16 pm
by Mastiff
Brilliant! :D Thanks!

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 2:50 pm
by krambriw
New version is uploaded

It now looks like this, let's see how it fits
Skärmklipp.PNG

Re: ClimateDataCalculation

Posted: Wed Apr 15, 2015 2:56 pm
by Mastiff
Yep, that fits very well, thanks! :mrgreen:

Re: ClimateDataCalculation

Posted: Thu Apr 23, 2015 10:14 am
by krambriw
I have modified the plugin so that creating Combo reports are now done via a thread to avoid that EG locks up if data bases are large or the report covers many data points. New version uploaded to 'Current version'

Re: ClimateDataCalculation

Posted: Thu Apr 23, 2015 10:33 am
by Mastiff
Great! :D Thanks! Would it be possible to do the same to saving of temps? They only lock up EG for a 3-5 seconds, but since they are coming in all the time, it can be a bit of a pain when I'm working in EG since nothing is possible to do for that time.

Re: ClimateDataCalculation

Posted: Thu Apr 23, 2015 10:37 am
by krambriw
Would it be possible to do the same to saving of temps?
I did not know this but it might be so that we should do that for everything that is saved to data bases...especially when they are large, it could be there is a performance problem. I will do some tests to see what can be done

Re: ClimateDataCalculation

Posted: Thu Apr 23, 2015 10:40 am
by Mastiff
It seems like nothing else can come in to the logger while the reports are made, because everything comnes in a second after it's finished. Is that right? When the FTP upload starts, they all come in:

Code: Select all

12:37:02      Lage HTML-rapporter
12:37:02         ClimateDataCalculation: CombinedReport: Temperaturer
12:37:14         ClimateDataCalculation: CombinedReport: Temperaturrapport
12:37:53         FTP-opplasting
12:37:53   RFXtrx.Type: WGR800 id: 28928 ' direction: WNW average speed: 3.1 m/s gust: 2.7 m/s signal: 6 battery: 10%'
12:37:53      Vind til webserver
12:37:53         Deling og variabelsetting
12:37:53         Endring til norske retningsnavn
12:37:53   RFXtrx.Type: Viking 02811 id: 3328 ' temperature: +22.9 deg C signal: 7 battery: 9'
12:37:53      Sjekk temperaturen i stua
12:37:53         Sjekk om stua er for kald
12:37:53         Sjekk om stua er for varm
12:37:53      Stua
12:37:53         Python Script
12:37:53         ClimateDataCalculation: TempDataCapture: Stua

Re: ClimateDataCalculation

Posted: Thu Apr 23, 2015 10:43 am
by Mastiff
Seems like we posted almost at the same time there. Hope you saw my post. :)