Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

ClimateDataCalculation

Questions and comments specific to a particular plugin should go here.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post by Mastiff »

Nope, same again. It's under "Current version"?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post 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
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post 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.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post 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()


Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post 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!
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post 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.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post by krambriw »

Re-design on the way...
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post by Mastiff »

Brilliant! :D Thanks!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post by krambriw »

New version is uploaded

It now looks like this, let's see how it fits
Skärmklipp.PNG
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post by Mastiff »

Yep, that fits very well, thanks! :mrgreen:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post 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'
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post 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.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ClimateDataCalculation

Post 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
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post 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
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: ClimateDataCalculation

Post by Mastiff »

Seems like we posted almost at the same time there. Hope you saw my post. :)
Post Reply