Page 19 of 37

Re: ClimateDataCalculation

Posted: Thu Apr 30, 2015 9:22 am
by Mastiff
Btw here are all the wind directions (not in a correct order, but it should be easy to see what they are):

Code: Select all

S
SSE
SE
SSW
E
ENE
ESE
N
NNW
NNE
W
WNW
WSW

Re: ClimateDataCalculation

Posted: Thu Apr 30, 2015 9:39 am
by krambriw
I do not know why your data is all 0.0 for Loftet because that is the case, the database is not empty but all readings are 0.0

I have therefore simulated your viking sensor for Loftet and the capturing and reporting is working fine.

If you want, you can try to simulate events like this using a python script (remember the plugin will only capture one reading each minute):

Code: Select all

eg.TriggerEvent(
    'Type: Viking 02811 id: 41216',
    payload = ' temperature: +10.1 deg C signal: 7 battery: 9',
    prefix = 'RFXtrx'
)

Re: ClimateDataCalculation

Posted: Thu Apr 30, 2015 9:50 am
by Mastiff
Wow, this is funky! I used three different temperature settings, and all of them came in like this:

Code: Select all

11:48:55      (u'2015-04-30 11:47:07', 1430387227, u'Loftet', 0.0, u'', 10.0, 10.0, 0.0)
11:48:55      (u'2015-04-30 11:48:02', 1430387283, u'Loftet', 0.0, u'', 10.0, 10.0, 0.0)
11:48:55      (u'2015-04-30 11:48:46', 1430387326, u'Loftet', 0.0, u'', 10.0, 10.0, 0.0)
What the heck can this be? I have another script that publishes the current temp on my webpage, like this:

Code: Select all

import time
eg.event.payload_copy = eg.event.payload
my_data = eg.event.payload_copy.split(' ')

td = my_data[2] #temperature

timeStamp = str(
time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
)
eg.globals.Loftet_time = timeStamp
eg.globals.Loftet_temp = td

eg.globals.Loftet_time_formatert = "%s:%s, %s.%s." % (eg.globals.Loftet_time[11:13], eg.globals.Loftet_time[14:16], eg.globals.Loftet_time[8:10], eg.globals.Loftet_time[5:7])
That shows the correct temperature all the time:

Code: Select all

Loftet: +9.9 grader, klokka 11:48, 30.04.

Re: ClimateDataCalculation

Posted: Thu Apr 30, 2015 9:58 am
by Mastiff
Fixed. I deleted the capture action and created a new one. I think that capture action was created a few weeks ago, so maybe there was a bug in some of the scripts when I created it?

Re: ClimateDataCalculation

Posted: Fri May 01, 2015 7:53 am
by Mastiff
Edited, after a bit of brainstorming with myself:

Everything's ticking along very nicely now, I think this is a good one! Is this the time where I have more suggestions, so something else can go wrong? :lol: I was thinking of two things:

1. The selected period is in English, both wording and number format. Is it a lot of work to change that, so I can have it either user configurable (best) or at least without "Selected period"?

2. I have found that I will use this in iframes on a page I HTML-code myself, but maybe it would be a good idea for somebody else who just want to keep it simple (something I'm very, very, very bad at!):

Would it be possible to put a number of links on each of those pages (in the same way a you personalized those headings)? I was thinking of the possibility of perhaps having 4-5 links at the bottom to go to temperature overview and other graphs, for instance. Or would that maybe be better done by putting the graphs as a frames in anoter website? I have something like that with the weather on my house website, where I have the long term weather in a frame hiding the headings and a few other things, all run by the EG Webserver plug-in:
Home page.jpg

Re: ClimateDataCalculation

Posted: Fri May 01, 2015 5:26 pm
by krambriw
Good to hear it's working. I see the same, my system is not slowed down anymore when data is saved or a report created.

The new version I have uploaded is now supporting capturing of wind data (I was lucky, I captured my neighbors wind meter WGR918, borrowing some test data...). The report is also working but only a simple variant currently only showing the average gust. But it is fully useful to start the data collection. Making the wind rose will require some additional unknown work...

Regarding the rest:
- I have removed the line with selected period. It is not needed I think, it's obvious since you get info about time etc as soon as you move the mouse pointer over a graph
- Since you plan to embed reports in frames, you will probably add headings, links and other stuff yourself to the main frame or other subframes

Re: ClimateDataCalculation

Posted: Fri May 01, 2015 6:03 pm
by Mastiff
Thanks! Sounds good, I will install the new version at the cabin and start capturing the wind! That almost sounds poetic... :mrgreen:

Re: ClimateDataCalculation

Posted: Fri May 01, 2015 8:47 pm
by Mastiff
There's something funky happening on some reports. I can't see a pattern. I had the problem first on a report, so I deleted it and started a new one. But then I have a bunch of reports collected in a Python script (with copy to Python), and I get it there. it is related to wind:

Code: Select all

22:45:08   Exception in thread Thread-1820:
22:45:08   Traceback (most recent call last):
22:45:08     File "threading.pyc", line 532, in __bootstrap_inner
22:45:08     File "threading.pyc", line 484, in run
22:45:08     File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 2392, in CreateReport
22:45:08       rprtHeading
22:45:08     File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\CreateComboHtml.py", line 406, in CreateComboHtml
22:45:08       logstr += MakeChart(rows_6, pos_6, 'Wind strenght', ' m/s')
22:45:08     File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\CreateComboHtml.py", line 25, in MakeChart
22:45:08       if len(drows[key]) != 0:
22:45:08   TypeError: object of type 'NoneType' has no len()
22:45:08   
This is the Python code for the action:

Code: Select all

eg.plugins.ClimateDataCalculation.CombinedReport(u'30-dagersrapport for stua', (u'Stua',), (), (), (), (), 30, 0, True, u'D:\\EventGhost\\Webserver for EventGhost', u'7', u'30-dagersrapport for stua')

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 4:30 am
by jonib
Sorry this is totally off topic. :oops:
Mastiff wrote:I just tried now to do somethig completely different (turn off the fan in the batroom)
Bruce Wayne is that you? (quoted post)

Lala, and off I go.

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 5:35 am
by krambriw
Exception in thread Thread-1820:
If you started to capture data for a new sensor (in this case wind) you have to restart EG once before the reporting will work. Reason is that the plugin dosen't know about that a new action was created. This is only checked and updated at start (remember that it took such a long time to edit earlier...)

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 6:51 am
by Mastiff
I'm only capturing wind at the cabin, this is at home. But I deleted the Python code and created a new one and it seems to work. No idea what failed the first time...

Edit: Joinb, damn, and I thought I was so cleverly disguised as Mastiff here! :oops: Might as well show you the Batbike since I'm made:
Matte blackbird (1).jpg
Matte blackbird (20).jpg
(Yes, it's my bike, no joke there).

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 6:58 am
by jonib
Mastiff wrote:Might as well show you the Batbike since I'm made:
Nice :shock:

Now you can go back to climating.

jonib

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 7:03 am
by Mastiff
Thanks! My own choice of color. It used to be burgundy/red, but after a small accident last summer (between a car's trailer and a guardrail, I know how the ball in a pinball game feels!) I had all the plastic repainted. So instead of a Honda Blackbird it's a Batbird! :mrgreen: Or maybe MatteBlackbird. Yes, back to the climate.

Re: ClimateDataCalculation

Posted: Sat May 02, 2015 4:45 pm
by Mastiff
Krambriw, is it possible to get the FTP upload code to upload all files in a directory? I'd like that to avoid having one line for each report that I create (it will be over 20 different reports during 24 hours, some of them several times).

Re: ClimateDataCalculation

Posted: Mon May 04, 2015 6:13 am
by krambriw
FTP upload code to upload all files in a directory?
The code you received earlier can be extended in such a way that you provide a list of names instead of a single file name and then with a for loop, you upload them one-by-one