Page 32 of 37

Re: ClimateDataCalculation

Posted: Mon Jan 25, 2016 10:41 pm
by bongolf
krambriw wrote:Hello, nice to hear!
1. I would like to generate a new report every time a new value is entered to the database. Is that possible? (or would it perhaps be possible to generate an event when a value is entered?)
Yes, I do that myself using an event and a macro that creates the report after a short 1 second pause (to allow the database to be closed, maybe not needed but anyway...). The configuration look like this:
Skärmklipp.JPG
Ok, but doesn't that mean that the report is generated for every value that is coming in?
For example if I get 1 value per minute but set the logging interval to 10 minutes. Doesn't that mean that the report gets updated 10 times during 10 minutes, but the database only once?
2. What happens if the number of collected values during one logging interval is lower than the setting for "number of readings for the average calculation"? (One of my sensors is a bit unreliable so i dont really know how often it will send values...)
krambriw wrote: It uses the readings you have collected, means if you have gaps, the average will still be calculated on those that exists. If you set the number of readings to use = 10, it will pick the last ten from the database. If only 8 readings exists, it will use those 8.
Perfect!
3. What is the "Use 10 minutes data point spread" supposed to do? If I uncheck it all of my reports becomes empty.
krambriw wrote: The purpose is to speed up the creation of reports. If you have a lot of data readings from each minute and generate a report for a longer period, it will take considerable long time to create the report compared with using only one reading per 10 minute.
In a normal situation, a 10 minute interval is most of the time acceptable unless you really want to measure fast changes (but then you should also select a shorter period for the report itself).
I do not yet understand why your reports are empty. When I try it works as expected. I have saved a few readings with 10 min interval and then generated reports with and without the check box ticked. I do get the reports with data, only difference is the horizontal scale for the time, in the 10 min variant the scale is with 10 min, the 1 min is with 1 min and in the 1 min chart there are no lines between the data points.
What I could imagine is that you are logging at 10 min interval. If you create a 10 min report, you will see lines between the data points (unless there are gaps). If you instead select a 1 min report to be created, the lines will disappear since the report generator is seeing gaps in your data collection (expecting data every minute but only seeing every 10 min)
Your imagination is good ;-) I have 10 minutes logging intervall so I have no need to have 1 min charts.
But perhaps I could find reasons to have longer intervall than 10 minutes for long term reports. Like day-averages or so (but so far I don't have so much data so it┬┤s not an issue yet anyway...)

Re: ClimateDataCalculation

Posted: Tue Jan 26, 2016 7:44 am
by Mastiff
Krambriw, is it possible to keep the logging of queue sizes to when it is close to the max size, perhaps 100 from, or something? I really would like to know if I start pushing the max, but I don't need to see the size message in the log when I'm far from it (I use 1000 to make sure I don't get any problems, so I have only been close once, when I was doing a two hour video conversion). :mrgreen:

Re: ClimateDataCalculation

Posted: Tue Jan 26, 2016 3:49 pm
by krambriw
@Mastiff
Sounds like reasonable. I have made a new beta version that only prints the Q-size when it is above 90% of the defined limit. Available for download in the normal place

@Bongolf
For example if I get 1 value per minute but set the logging interval to 10 minutes. Doesn't that mean that the report gets updated 10 times during 10 minutes, but the database only once?
Yes, my example was just an example ;) The plugin does not generate an event when it is saving to the database (I need to think about if this can be added in a sensible way). To make it yourself, you write a python script that is capturing the events from the sensor and calculates the elapsed time from the first captured, then triggers the event to create a report when time is reached, then resets the first event captured and starts all over again

Re: ClimateDataCalculation

Posted: Tue Jan 26, 2016 5:36 pm
by bongolf
For example if I get 1 value per minute but set the logging interval to 10 minutes. Doesn't that mean that the report gets updated 10 times during 10 minutes, but the database only once?
krambriw wrote: Yes, my example was just an example ;) The plugin does not generate an event when it is saving to the database (I need to think about if this can be added in a sensible way). To make it yourself, you write a python script that is capturing the events from the sensor and calculates the elapsed time from the first captured, then triggers the event to create a report when time is reached, then resets the first event captured and starts all over again
Ok,I will do that.
But I guess it will be hard to keep it in "sync" so I guess I just can do it every 10 minutes.

Re: ClimateDataCalculation

Posted: Tue Jan 26, 2016 5:45 pm
by krambriw
But I guess it will be hard to keep it in "sync" so I guess I just can do it every 10 minutes.
If you define and put the first event in a variable like eg.globals.firstEvent and record the time as eg.globals.firstTime you can rather easily calculate when 10 minutes have elapsed. For each consecutive event, check actual time and compare.

If you can live with a simple "10 minute whenever" solution you can use the SchedulGhost plugin

Re: ClimateDataCalculation

Posted: Wed Jan 27, 2016 12:03 am
by Mastiff
Thanks, Krambriw! That's perfect! :mrgreen:

Re: ClimateDataCalculation

Posted: Wed Feb 10, 2016 4:11 pm
by bongolf
Hi again!

I made an Arduino-based sensor that is tracking temperature, humidity.
But something goes wrong when I try to capture the humidity:
17:01:36 TellStickDuo.oregon.1A2D.1.Temperature: '17.6|2016-02-10 17:01:36'
17:01:36 ClimateDataCalculation: TempDataCapture: Temperature Odling inne
17:01:36 ClimateDataCalculation: TempDataCapture: Temperature Odling inne
17:01:36 TellStickDuo.oregon.1A2D.1.Humidity: '25|2016-02-10 17:01:36'
17:01:36 ClimateDataCalculation: HumDataCapture: Humidity Odling inne
17:01:36 ClimateDataCalculation: HumDataCapture: Humidity Odling inne
17:01:36 Current Q size: Exception in thread Thread-30297:
17:01:36 Traceback (most recent call last):
17:01:36 File "threading.pyc", line 532, in __bootstrap_inner
17:01:36 File "threading.pyc", line 484, in run
17:01:36 File "C:\Program Files\EventGhost\plugins\ClimateDataCalculation\__init__.py", line 1857, in CaptureHum
17:01:36 humidity = int(e_lst[1])
17:01:36 ValueError: invalid literal for int() with base 10: '2016-02-10 17:01:36'
17:01:36
Is my sensor sending the humidity in the wrong way/format, or do you think I am doing something wrong when I set it up in CDC?

Re: ClimateDataCalculation

Posted: Wed Feb 10, 2016 4:17 pm
by Mastiff
It seems to be reading the date as the value, if I'm not mistaken. Of course I don't know jack... :mrgreen: But I'm not sure if it's set up for humidity for Tellstick.Duo. The same sensor (probably the same, at least) works when logging from RFXtrx, if I remember correctly. I think I'm logging humidity at the cabin.

Re: ClimateDataCalculation

Posted: Wed Feb 10, 2016 5:48 pm
by krambriw
That I can explain

For TellStickDuo events, I am expecting the following format:

Code: Select all

18:46:22   TellStickDuo.oregon.1A2D.32.Temperature.Humidity '3.6|89'

Re: ClimateDataCalculation

Posted: Wed Feb 10, 2016 5:57 pm
by krambriw
...besides, I found a small bug in the humidity capturing part

New version uploaded

Re: ClimateDataCalculation

Posted: Thu Feb 11, 2016 12:40 pm
by bongolf
krambriw wrote:That I can explain

For TellStickDuo events, I am expecting the following format:

Code: Select all

18:46:22   TellStickDuo.oregon.1A2D.32.Temperature.Humidity '3.6|89'
Thanks for the answer!
I'm using a "library", that some one else has done, to send the data from the sensor and it will only let me send integers so I can't send it in that format.
But for now I just send it all as temperature with different id┬┤s instead.

But I do have one other question/request.
I would like to have a Temperature-report that shows todays temp (from 00:00-now) as one series and yesterdays temp (00:00-23:29) as another serie.
Would that be possible to do?
Something like this:
chart-2.png

Re: ClimateDataCalculation

Posted: Thu Feb 11, 2016 4:12 pm
by krambriw
"Everything" is possible...


1) I think it is not too complicated to add support for your event structures (if you agree, I can look into that and see how it can be done). The data will then be saved in correct databases (temp and hum respectively).

Code: Select all

17:01:36 TellStickDuo.oregon.1A2D.1.Temperature: '17.6|2016-02-10 17:01:36'
17:01:36 TellStickDuo.oregon.1A2D.1.Humidity: '25|2016-02-10 17:01:36'
2) "Temperature-report that shows todays temp (from 00:00-now) as one series and yesterdays temp (00:00-23:29) as another serie"

This is all about how to feed the chart with corresponding data series. Currently the actions can only be configured to show data from several sensors for the same time interval. To meet the requirement, a new action is needed that would allow you to somehow select which sensor data should be from today and others for yesterday (more work to fix)

BR

Re: ClimateDataCalculation

Posted: Thu Feb 11, 2016 5:56 pm
by bongolf
1. Who am I to disagree. It would be great if you could do that!

2. I see. I┬┤m not able to do that myself so I will just wait and see what might be implemented in the future ;-)

Re: ClimateDataCalculation

Posted: Fri Feb 12, 2016 7:01 am
by krambriw
New version uploaded

Supporting your Arduino based sensors

Re: ClimateDataCalculation

Posted: Fri Feb 12, 2016 8:20 pm
by bongolf
Thank you, works perfect!