[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 11:34:04 UTC+1:

> fault with me 
> after reinstalling version 0.4.1
> everything's o.k
>

Thank you, too.
 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3472537f-4fcb-4e4d-bfa7-d9adbe7da4d4n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread hesf...@gmail.com
fault with me 
after reinstalling version 0.4.1
everything's o.k

Thank you for your work and your patience with me
Hartmut

kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 11:14:32 UTC+1:

> I added that in hilo.inc:
>
> #if $day.radiation.has_data 
>  
> Sonnenenergie 
> #for $archive in $archive_data 
>  
> $archive[1].radiation.energy_integral.format(add_label=False) 
>  
> #end for 
> Wh/m² 
>  
> #end if 
>
> Karen K schrieb am Donnerstag, 11. März 2021 um 11:11:06 UTC+1:
>
>> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 11:04:56 UTC+1:
>>
>>> in Seasons/current.inc 
>>>
>>
>> It seems ok to me. I will try it today in the evening myself and see.
>>
>> In the meantime, could you put a second # before #if and #end if in the 
>> snippet you posted? (for debugging purposes only)
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/c551e6ad-3549-4d28-8d5d-905bba0b8c40n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
I added that in hilo.inc:

#if $day.radiation.has_data 
 
Sonnenenergie 
#for $archive in $archive_data 
 
$archive[1].radiation.energy_integral.format(add_label=False) 
 
#end for 
Wh/m² 
 
#end if 

Karen K schrieb am Donnerstag, 11. März 2021 um 11:11:06 UTC+1:

> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 11:04:56 UTC+1:
>
>> in Seasons/current.inc 
>>
>
> It seems ok to me. I will try it today in the evening myself and see.
>
> In the meantime, could you put a second # before #if and #end if in the 
> snippet you posted? (for debugging purposes only)
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/33f4cf84-a66f-454d-bf0f-58ba19208f48n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 11:04:56 UTC+1:

> in Seasons/current.inc 
>

It seems ok to me. I will try it today in the evening myself and see.

In the meantime, could you put a second # before #if and #end if in the 
snippet you posted? (for debugging purposes only)
 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6b75ca50-057c-4a22-88a0-e63927c8d91cn%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
Commit 69cc037 


Karen K schrieb am Donnerstag, 11. März 2021 um 10:56:17 UTC+1:

> Could you send your skin.conf  and index.html.tmpl here?
>
> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:51:38 UTC+1:
>
>> Hallo,
>>
>> I have a small request, the values for day.radiation.energy_integral and 
>> week...  month... and year.radiation.energy_integral not displayed
>>
>> as proof, have a look at 
>>
>> http://wh3080.hes61.de/
>>
>> Hartmut
>> kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:41:08 UTC+1:
>>
>>> Yes, you are right. I did use ' instead of `.
>>>
>>> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:37:49 UTC+1:
>>>
 Are you sure you are using backticks, there are a number of similar 
 looking symbols. Actually, looking at my reply I said backticks but I 
 suspect I did not actually use them, you want this one:
 ‘
 Backticks will work in SQLite, if you look through the WeeWX code you 
 will find wherever interval is used in a SQL statement it is enclosed in 
 backticks. I believe double quotes can be used in MySQL in certain modes 
 only, but backticks can be used in all modes.

 Gary
 On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:

> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:
>
>> I think you will find the issue is that interval is a reserved word 
>> in MySQL. The solution is to enclose interval in backticks, eg: 
>> 'interval'
>
>
> Thank you, Gary, for your tip. Unfortunately, that in turn does not 
> work for Sqlite. There, it only works with quotes, "interval"
>  
>


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4e1a4d08-147e-4276-9339-23566e50189en%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread hesf...@gmail.com
in Seasons/current.inc 

#if $day.radiation.has_data
  
$obs.label.radiation
$current.radiation
  
  
Sonnenenergie Tag
$day.radiation.energy_integral
  
  
Sonnenenergie Vortag
$yesterday.radiation.energy_integral.kilowatt_hour_per_meter_squared
  
  
Sonnenenergie Woche
$week.radiation.energy_integral.kilowatt_hour_per_meter_squared
  
  
Sonnenenergie Monat
$month.radiation.energy_integral.kilowatt_hour_per_meter_squared
  
  
Sonnenenergie Jahr
$year.radiation.energy_integral.kilowatt_hour_per_meter_squared
  
#end if

and skin.conf which section

the installation runs under install   (wee_extension --install 
weewx-GTS.zip)

in configuration in weewx.conf

an 3 Installation instructions: was also implemented
GTS works
Hartmut
kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:56:17 UTC+1:

> Could you send your skin.conf  and index.html.tmpl here?
>
> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:51:38 UTC+1:
>
>> Hallo,
>>
>> I have a small request, the values for day.radiation.energy_integral and 
>> week...  month... and year.radiation.energy_integral not displayed
>>
>> as proof, have a look at 
>>
>> http://wh3080.hes61.de/
>>
>> Hartmut
>> kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:41:08 UTC+1:
>>
>>> Yes, you are right. I did use ' instead of `.
>>>
>>> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:37:49 UTC+1:
>>>
 Are you sure you are using backticks, there are a number of similar 
 looking symbols. Actually, looking at my reply I said backticks but I 
 suspect I did not actually use them, you want this one:
 ‘
 Backticks will work in SQLite, if you look through the WeeWX code you 
 will find wherever interval is used in a SQL statement it is enclosed in 
 backticks. I believe double quotes can be used in MySQL in certain modes 
 only, but backticks can be used in all modes.

 Gary
 On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:

> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:
>
>> I think you will find the issue is that interval is a reserved word 
>> in MySQL. The solution is to enclose interval in backticks, eg: 
>> 'interval'
>
>
> Thank you, Gary, for your tip. Unfortunately, that in turn does not 
> work for Sqlite. There, it only works with quotes, "interval"
>  
>


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/14c172fe-bdb0-4f0a-94ba-b223b19fa64an%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
Could you send your skin.conf  and index.html.tmpl here?

hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:51:38 UTC+1:

> Hallo,
>
> I have a small request, the values for day.radiation.energy_integral and 
> week...  month... and year.radiation.energy_integral not displayed
>
> as proof, have a look at 
>
> http://wh3080.hes61.de/
>
> Hartmut
> kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:41:08 UTC+1:
>
>> Yes, you are right. I did use ' instead of `.
>>
>> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:37:49 UTC+1:
>>
>>> Are you sure you are using backticks, there are a number of similar 
>>> looking symbols. Actually, looking at my reply I said backticks but I 
>>> suspect I did not actually use them, you want this one:
>>> ‘
>>> Backticks will work in SQLite, if you look through the WeeWX code you 
>>> will find wherever interval is used in a SQL statement it is enclosed in 
>>> backticks. I believe double quotes can be used in MySQL in certain modes 
>>> only, but backticks can be used in all modes.
>>>
>>> Gary
>>> On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:
>>>
 gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:

> I think you will find the issue is that interval is a reserved word in 
> MySQL. The solution is to enclose interval in backticks, eg: 'interval'


 Thank you, Gary, for your tip. Unfortunately, that in turn does not 
 work for Sqlite. There, it only works with quotes, "interval"
  

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/bfe6788e-2ecc-43f0-b371-439db0c2d93an%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread hesf...@gmail.com
Hallo,

I have a small request, the values for day.radiation.energy_integral and 
week...  month... and year.radiation.energy_integral not displayed

as proof, have a look at 

http://wh3080.hes61.de/

Hartmut
kk44...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:41:08 UTC+1:

> Yes, you are right. I did use ' instead of `.
>
> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:37:49 UTC+1:
>
>> Are you sure you are using backticks, there are a number of similar 
>> looking symbols. Actually, looking at my reply I said backticks but I 
>> suspect I did not actually use them, you want this one:
>> ‘
>> Backticks will work in SQLite, if you look through the WeeWX code you 
>> will find wherever interval is used in a SQL statement it is enclosed in 
>> backticks. I believe double quotes can be used in MySQL in certain modes 
>> only, but backticks can be used in all modes.
>>
>> Gary
>> On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:
>>
>>> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:
>>>
 I think you will find the issue is that interval is a reserved word in 
 MySQL. The solution is to enclose interval in backticks, eg: 'interval'
>>>
>>>
>>> Thank you, Gary, for your tip. Unfortunately, that in turn does not work 
>>> for Sqlite. There, it only works with quotes, "interval"
>>>  
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0db5d982-2a5e-448f-bef0-830bec97be20n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
Yes, you are right. I did use ' instead of `.

gjr80 schrieb am Donnerstag, 11. März 2021 um 10:37:49 UTC+1:

> Are you sure you are using backticks, there are a number of similar 
> looking symbols. Actually, looking at my reply I said backticks but I 
> suspect I did not actually use them, you want this one:
> ‘
> Backticks will work in SQLite, if you look through the WeeWX code you will 
> find wherever interval is used in a SQL statement it is enclosed in 
> backticks. I believe double quotes can be used in MySQL in certain modes 
> only, but backticks can be used in all modes.
>
> Gary
> On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:
>
>> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:
>>
>>> I think you will find the issue is that interval is a reserved word in 
>>> MySQL. The solution is to enclose interval in backticks, eg: 'interval'
>>
>>
>> Thank you, Gary, for your tip. Unfortunately, that in turn does not work 
>> for Sqlite. There, it only works with quotes, "interval"
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/37ba9597-cd51-4055-bef4-f6e6fd9cebd0n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread gjr80
Are you sure you are using backticks, there are a number of similar looking 
symbols. Actually, looking at my reply I said backticks but I suspect I did 
not actually use them, you want this one:
‘
Backticks will work in SQLite, if you look through the WeeWX code you will 
find wherever interval is used in a SQL statement it is enclosed in 
backticks. I believe double quotes can be used in MySQL in certain modes 
only, but backticks can be used in all modes.

Gary
On Thursday, 11 March 2021 at 19:19:54 UTC+10 kk44...@gmail.com wrote:

> gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:
>
>> I think you will find the issue is that interval is a reserved word in 
>> MySQL. The solution is to enclose interval in backticks, eg: 'interval'
>
>
> Thank you, Gary, for your tip. Unfortunately, that in turn does not work 
> for Sqlite. There, it only works with quotes, "interval"
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5b796660-7eed-4c51-97d9-9603b232ec4dn%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 10:19:02 UTC+1:

> yes interval set to 'interval'
>

Does it work with "interval", too? 

(As 'interval' does not work with Sqlite.)
 

> and the value dayET is in Vantage Pro2 by loop2 a value
> in the calculation I changed it to day_ET
>

You could change the entry "dayET = software,archive" in weewx.conf to 
"dayET = prefer_hardware,archive". Then, the value will only be calculated 
by the software, if the weather station / driver does not provide it.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/c96fe2f1-3e89-4d4e-b7fc-2df1d030f5cfn%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:

> I think you will find the issue is that interval is a reserved word in 
> MySQL. The solution is to enclose interval in backticks, eg: 'interval'


Thank you, Gary, for your tip. Unfortunately, that in turn does not work 
for Sqlite. There, it only works with quotes, "interval"
 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/2729772c-7982-4e30-9b1d-812fa3258108n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread hesf...@gmail.com
yes interval set to 'interval'

and the value dayET is in Vantage Pro2 by loop2 a value
in the calculation I changed it to day_ET

der Wert dayET wird bei Vantage Pro2 unter loop2 ermittelt
in der Berechnung habe ich es auf day_ET geändert

Hartmut
gjr80 schrieb am Donnerstag, 11. März 2021 um 10:07:01 UTC+1:

> I think you will find the issue is that interval is a reserved word in 
> MySQL. The solution is to enclose interval in backticks, eg: 'interval'
>
> Gary
>
> On Thursday, 11 March 2021 at 18:54:12 UTC+10 kk44...@gmail.com wrote:
>
>> You are using MySQL or MariaDB? I use Sqlite. There this statemant works. 
>>
>> I am not really at home with MySQL, but could you change the statement 
>> like that:
>>
>>   _result = db_manager.getSql(
>> "SELECT SUM(radiation*interval/60.0), "
>>
>> "MIN(usUnits), MAX(usUnits) FROM %s "
>> "WHERE dateTime >? AND dateTime<=?"
>> % db_manager.table_name, timespan)
>>
>> issue #5 
>>
>> If that does not help I would move the division by 60 from the SQL 
>> statement to the Python code. But first I ask you to check if that change 
>> works.
>>
>> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 09:23:39 UTC+1:
>>
>>> in line 546 
>>> def calc_radiation_integral(self, timespan, db_manager):
>>> """calculate radiation integral over time
>>>
>>> radiation: actual radiation in Watt per square meter
>>> interval:  registration interval as per database record in 
>>> minutes
>>>
>>> """
>>>
>>> try:
>>> _result = db_manager.getSql(
>>> "SELECT SUM(radiation*interval)/60.0, "
>>> "MIN(usUnits), MAX(usUnits) FROM %s "
>>> "WHERE dateTime >? AND dateTime<=?"
>>> % db_manager.table_name, timespan)
>>>
>>> is there a sql error
>>>
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>> File "/home/weewx/bin/user/GTS.py", line 559, in 
>>> calc_radiation_integral
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>>   % db_manager.table_name, timespan)
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>> File "/home/weewx/bin/weewx/manager.py", line 430, in getSql
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>>   _cursor.execute(sql, sqlargs)
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>> File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>>   raise klass(e)
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>>   weedb.DatabaseError: (1064, "You have an error in your SQL syntax; 
>>> check the manual that corresponds to your MariaDB server version for the 
>>> right syntax to use near ')/60.0, MIN(usUnits),MAX(usUnits) FROM archive 
>>> WHERE dateTime>1612825200 AND ...' at line 1")
>>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>>   Generator terminated
>>>
>>>
>>> kk44...@gmail.com schrieb am Mittwoch, 10. März 2021 um 20:39:50 UTC+1:
>>>
 The radiation observation type provides the actual sun power received 
 at the time of measurement. The value depends on cloud coverage and the 
 time of day.

 Besides that it is interesting to know which amount of energy was 
 received from the sun during the day or any other period of time.

 To get that value some calculation has to be done. Unlike with rain 
 that cannot be done by simply summarizing the observation readings. Energy 
 is no cumulative value. Instead, it is necessary to integrate (in the 
 mathematical meaning of that word) the radiation readings over the 
 aggregation interval.

 I extended GTS extension  to do 
 that.

 For example you can display the amount of sun energy received the day 
 before by using the tag $yesterday.radiation.energy_integral. Plots 
 are also possible.

 For examples showing these values see:
 sun radiation energy value 
 sun radiation energy plot 
 




-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/06047ce5-ce7c-4218-b7e7-5a156d4ba319n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread gjr80
I think you will find the issue is that interval is a reserved word in 
MySQL. The solution is to enclose interval in backticks, eg: 'interval'

Gary

On Thursday, 11 March 2021 at 18:54:12 UTC+10 kk44...@gmail.com wrote:

> You are using MySQL or MariaDB? I use Sqlite. There this statemant works. 
>
> I am not really at home with MySQL, but could you change the statement 
> like that:
>
>   _result = db_manager.getSql(
> "SELECT SUM(radiation*interval/60.0), "
>
> "MIN(usUnits), MAX(usUnits) FROM %s "
> "WHERE dateTime >? AND dateTime<=?"
> % db_manager.table_name, timespan)
>
> issue #5 
>
> If that does not help I would move the division by 60 from the SQL 
> statement to the Python code. But first I ask you to check if that change 
> works.
>
> hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 09:23:39 UTC+1:
>
>> in line 546 
>> def calc_radiation_integral(self, timespan, db_manager):
>> """calculate radiation integral over time
>>
>> radiation: actual radiation in Watt per square meter
>> interval:  registration interval as per database record in minutes
>>
>> """
>>
>> try:
>> _result = db_manager.getSql(
>> "SELECT SUM(radiation*interval)/60.0, "
>> "MIN(usUnits), MAX(usUnits) FROM %s "
>> "WHERE dateTime >? AND dateTime<=?"
>> % db_manager.table_name, timespan)
>>
>> is there a sql error
>>
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>> File "/home/weewx/bin/user/GTS.py", line 559, in 
>> calc_radiation_integral
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>   % db_manager.table_name, timespan)
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>> File "/home/weewx/bin/weewx/manager.py", line 430, in getSql
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>   _cursor.execute(sql, sqlargs)
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>> File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>   raise klass(e)
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>   weedb.DatabaseError: (1064, "You have an error in your SQL syntax; 
>> check the manual that corresponds to your MariaDB server version for the 
>> right syntax to use near ')/60.0, MIN(usUnits),MAX(usUnits) FROM archive 
>> WHERE dateTime>1612825200 AND ...' at line 1")
>> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>>   Generator terminated
>>
>>
>> kk44...@gmail.com schrieb am Mittwoch, 10. März 2021 um 20:39:50 UTC+1:
>>
>>> The radiation observation type provides the actual sun power received at 
>>> the time of measurement. The value depends on cloud coverage and the time 
>>> of day.
>>>
>>> Besides that it is interesting to know which amount of energy was 
>>> received from the sun during the day or any other period of time.
>>>
>>> To get that value some calculation has to be done. Unlike with rain that 
>>> cannot be done by simply summarizing the observation readings. Energy is no 
>>> cumulative value. Instead, it is necessary to integrate (in the 
>>> mathematical meaning of that word) the radiation readings over the 
>>> aggregation interval.
>>>
>>> I extended GTS extension  to do 
>>> that.
>>>
>>> For example you can display the amount of sun energy received the day 
>>> before by using the tag $yesterday.radiation.energy_integral. Plots are 
>>> also possible.
>>>
>>> For examples showing these values see:
>>> sun radiation energy value 
>>> sun radiation energy plot 
>>> 
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d0999073-e878-47cc-b180-0cf823ba5ee6n%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread Karen K
You are using MySQL or MariaDB? I use Sqlite. There this statemant works. 

I am not really at home with MySQL, but could you change the statement like 
that:

  _result = db_manager.getSql(
"SELECT SUM(radiation*interval/60.0), "
"MIN(usUnits), MAX(usUnits) FROM %s "
"WHERE dateTime >? AND dateTime<=?"
% db_manager.table_name, timespan)

issue #5 

If that does not help I would move the division by 60 from the SQL 
statement to the Python code. But first I ask you to check if that change 
works.

hesf...@gmail.com schrieb am Donnerstag, 11. März 2021 um 09:23:39 UTC+1:

> in line 546 
> def calc_radiation_integral(self, timespan, db_manager):
> """calculate radiation integral over time
>
> radiation: actual radiation in Watt per square meter
> interval:  registration interval as per database record in minutes
>
> """
>
> try:
> _result = db_manager.getSql(
> "SELECT SUM(radiation*interval)/60.0, "
> "MIN(usUnits), MAX(usUnits) FROM %s "
> "WHERE dateTime >? AND dateTime<=?"
> % db_manager.table_name, timespan)
>
> is there a sql error
>
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
> File "/home/weewx/bin/user/GTS.py", line 559, in 
> calc_radiation_integral
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>   % db_manager.table_name, timespan)
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
> File "/home/weewx/bin/weewx/manager.py", line 430, in getSql
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>   _cursor.execute(sql, sqlargs)
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
> File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
>   raise klass(e)
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine:   
> weedb.DatabaseError: (1064, "You have an error in your SQL syntax; check 
> the manual that corresponds to your MariaDB server version for the right 
> syntax to use near ')/60.0, MIN(usUnits),MAX(usUnits) FROM archive WHERE 
> dateTime>1612825200 AND ...' at line 1")
> Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine:   
> Generator terminated
>
>
> kk44...@gmail.com schrieb am Mittwoch, 10. März 2021 um 20:39:50 UTC+1:
>
>> The radiation observation type provides the actual sun power received at 
>> the time of measurement. The value depends on cloud coverage and the time 
>> of day.
>>
>> Besides that it is interesting to know which amount of energy was 
>> received from the sun during the day or any other period of time.
>>
>> To get that value some calculation has to be done. Unlike with rain that 
>> cannot be done by simply summarizing the observation readings. Energy is no 
>> cumulative value. Instead, it is necessary to integrate (in the 
>> mathematical meaning of that word) the radiation readings over the 
>> aggregation interval.
>>
>> I extended GTS extension  to do 
>> that.
>>
>> For example you can display the amount of sun energy received the day 
>> before by using the tag $yesterday.radiation.energy_integral. Plots are 
>> also possible.
>>
>> For examples showing these values see:
>> sun radiation energy value 
>> sun radiation energy plot 
>> 
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d637f004-f323-4843-a787-d841f856f87an%40googlegroups.com.


[weewx-user] Re: Calculating Sun Energy from Radiation Reading

2021-03-11 Thread hesf...@gmail.com
in line 546 
def calc_radiation_integral(self, timespan, db_manager):
"""calculate radiation integral over time

radiation: actual radiation in Watt per square meter
interval:  registration interval as per database record in minutes

"""

try:
_result = db_manager.getSql(
"SELECT SUM(radiation*interval)/60.0, "
"MIN(usUnits), MAX(usUnits) FROM %s "
"WHERE dateTime >? AND dateTime<=?"
% db_manager.table_name, timespan)

is there a sql error

Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
File "/home/weewx/bin/user/GTS.py", line 559, in 
calc_radiation_integral
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
  % db_manager.table_name, timespan)
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
File "/home/weewx/bin/weewx/manager.py", line 430, in getSql
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
  _cursor.execute(sql, sqlargs)
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine: 
  raise klass(e)
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine:   
weedb.DatabaseError: (1064, "You have an error in your SQL syntax; check 
the manual that corresponds to your MariaDB server version for the right 
syntax to use near ')/60.0, MIN(usUnits),MAX(usUnits) FROM archive WHERE 
dateTime>1612825200 AND ...' at line 1")
Mar 11 09:20:26 hesba weewx[16349] ERROR weewx.reportengine:   
Generator terminated


kk44...@gmail.com schrieb am Mittwoch, 10. März 2021 um 20:39:50 UTC+1:

> The radiation observation type provides the actual sun power received at 
> the time of measurement. The value depends on cloud coverage and the time 
> of day.
>
> Besides that it is interesting to know which amount of energy was received 
> from the sun during the day or any other period of time.
>
> To get that value some calculation has to be done. Unlike with rain that 
> cannot be done by simply summarizing the observation readings. Energy is no 
> cumulative value. Instead, it is necessary to integrate (in the 
> mathematical meaning of that word) the radiation readings over the 
> aggregation interval.
>
> I extended GTS extension  to do that.
>
> For example you can display the amount of sun energy received the day 
> before by using the tag $yesterday.radiation.energy_integral. Plots are 
> also possible.
>
> For examples showing these values see:
> sun radiation energy value 
> sun radiation energy plot 
> 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/353789f6-4fa8-4376-a362-8a38ea8722cen%40googlegroups.com.