Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-15 Thread Karen K
Dann bitte Version 1.3 benutzen.

Meteo Oberwallis schrieb am Sonntag, 15. Oktober 2023 um 12:46:46 UTC+2:

> Hallo.
>
> Ich habe die:
>
>
>- Programm version: 4.10.2
>- Skin Version: 1.2
>
>
> Gruss
>
> Karen K schrieb am Sonntag, 15. Oktober 2023 um 11:24:49 UTC+2:
>
>> Welche Belchertown-Version ist es denn? Die Option unit ist, glaube ich, 
>> erst irgendwann eingeführt worden.
>>
>> Funktioniert das mit der Einheit bei anderen Größen? Einfach mal 
>> ausprobieren, ob nur die absolute Luftfeuchtigkeit betroffen ist oder auch 
>> anderes. Zum Beispiel könnte man in einem Temperaturdiagramm mal testweise 
>> nach demselben Prinzip in graphs.conf die Werte in Grad Fahrenheit 
>> anzeigen lassen.
>>
>> Meteo Oberwallis schrieb am Sonntag, 15. Oktober 2023 um 09:40:04 UTC+2:
>>
>>> Hallo Karen.
>>>
>>> Genau so habe ich es. Trotzdem habe ich diese dezimalstellenfehler.
>>>
>>> Gruss
>>>
>>> Karen K schrieb am Samstag, 14. Oktober 2023 um 14:47:29 UTC+2:
>>>
 [[humidity]]

 title = "Luftfeuchtigkeit"

 [[[outHumidity]]]

 name = "relativ"

 [[[outHumAbs]]]

 name = "absolut"

 yAxis = 1

 unit = gram_per_meter_cubed

 numberFormat

 decimals = 1

 Meteo Oberwallis schrieb am Samstag, 14. Oktober 2023 um 12:03:33 UTC+2:

> Hallo.
> Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein 
> zu grosser Wert angezeigt. Wie kann ich das anpassen?
> [image: 2023_10_14_12_01_34_Clipboard.png]
> Grüsse
>
> Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:
>
>> Yes.
>>
>> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>>
>>> when it comes to coding the best we can do is copy and paste,  all 
>>> we wanna know is if this tag (*$daylight*) actually does work 
>>> within NOAA template file.
>>> thank you for your help
>>>
>>> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>>>
 Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:

 We want to add below code or similar to its action to the NOAA 
 monthly report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if 
 it is possible to do so because of the span tags?



 Why not trying it?

 If you are not sure about the $span tag, you can replace it by 
 something else like $ii
  

>>>

-- 
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/d8868b2a-4331-4eb6-94f3-613d13a82f23n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-15 Thread Meteo Oberwallis
Hallo.

Ich habe die:

- Programm version: 4.10.2
- Skin Version: 1.2

Gruss

Karen K schrieb am Sonntag, 15. Oktober 2023 um 11:24:49 UTC+2:

> Welche Belchertown-Version ist es denn? Die Option unit ist, glaube ich, 
> erst irgendwann eingeführt worden.
>
> Funktioniert das mit der Einheit bei anderen Größen? Einfach mal 
> ausprobieren, ob nur die absolute Luftfeuchtigkeit betroffen ist oder auch 
> anderes. Zum Beispiel könnte man in einem Temperaturdiagramm mal testweise 
> nach demselben Prinzip in graphs.conf die Werte in Grad Fahrenheit 
> anzeigen lassen.
>
> Meteo Oberwallis schrieb am Sonntag, 15. Oktober 2023 um 09:40:04 UTC+2:
>
>> Hallo Karen.
>>
>> Genau so habe ich es. Trotzdem habe ich diese dezimalstellenfehler.
>>
>> Gruss
>>
>> Karen K schrieb am Samstag, 14. Oktober 2023 um 14:47:29 UTC+2:
>>
>>> [[humidity]]
>>>
>>> title = "Luftfeuchtigkeit"
>>>
>>> [[[outHumidity]]]
>>>
>>> name = "relativ"
>>>
>>> [[[outHumAbs]]]
>>>
>>> name = "absolut"
>>>
>>> yAxis = 1
>>>
>>> unit = gram_per_meter_cubed
>>>
>>> numberFormat
>>>
>>> decimals = 1
>>>
>>> Meteo Oberwallis schrieb am Samstag, 14. Oktober 2023 um 12:03:33 UTC+2:
>>>
 Hallo.
 Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein 
 zu grosser Wert angezeigt. Wie kann ich das anpassen?
 [image: 2023_10_14_12_01_34_Clipboard.png]
 Grüsse

 Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:

> Yes.
>
> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>
>> when it comes to coding the best we can do is copy and paste,  all we 
>> wanna know is if this tag (*$daylight*) actually does work within 
>> NOAA template file.
>> thank you for your help
>>
>> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>>
>>> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>>>
>>> We want to add below code or similar to its action to the NOAA 
>>> monthly report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if 
>>> it is possible to do so because of the span tags?
>>>
>>>
>>>
>>> Why not trying it?
>>>
>>> If you are not sure about the $span tag, you can replace it by 
>>> something else like $ii
>>>  
>>>
>>

-- 
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/d7c08811-d7a8-4ee4-b558-90eb4344515bn%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-15 Thread Karen K
Welche Belchertown-Version ist es denn? Die Option unit ist, glaube ich, 
erst irgendwann eingeführt worden.

Funktioniert das mit der Einheit bei anderen Größen? Einfach mal 
ausprobieren, ob nur die absolute Luftfeuchtigkeit betroffen ist oder auch 
anderes. Zum Beispiel könnte man in einem Temperaturdiagramm mal testweise 
nach demselben Prinzip in graphs.conf die Werte in Grad Fahrenheit anzeigen 
lassen.

Meteo Oberwallis schrieb am Sonntag, 15. Oktober 2023 um 09:40:04 UTC+2:

> Hallo Karen.
>
> Genau so habe ich es. Trotzdem habe ich diese dezimalstellenfehler.
>
> Gruss
>
> Karen K schrieb am Samstag, 14. Oktober 2023 um 14:47:29 UTC+2:
>
>> [[humidity]]
>>
>> title = "Luftfeuchtigkeit"
>>
>> [[[outHumidity]]]
>>
>> name = "relativ"
>>
>> [[[outHumAbs]]]
>>
>> name = "absolut"
>>
>> yAxis = 1
>>
>> unit = gram_per_meter_cubed
>>
>> numberFormat
>>
>> decimals = 1
>>
>> Meteo Oberwallis schrieb am Samstag, 14. Oktober 2023 um 12:03:33 UTC+2:
>>
>>> Hallo.
>>> Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein zu 
>>> grosser Wert angezeigt. Wie kann ich das anpassen?
>>> [image: 2023_10_14_12_01_34_Clipboard.png]
>>> Grüsse
>>>
>>> Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:
>>>
 Yes.

 Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:

> when it comes to coding the best we can do is copy and paste,  all we 
> wanna know is if this tag (*$daylight*) actually does work within 
> NOAA template file.
> thank you for your help
>
> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>
>> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>>
>> We want to add below code or similar to its action to the NOAA 
>> monthly report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it 
>> is possible to do so because of the span tags?
>>
>>
>>
>> Why not trying it?
>>
>> If you are not sure about the $span tag, you can replace it by 
>> something else like $ii
>>  
>>
>

-- 
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/87b33511-feec-47cf-888e-31b84457a302n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-15 Thread Meteo Oberwallis
Hallo Karen.

Genau so habe ich es. Trotzdem habe ich diese dezimalstellenfehler.

Gruss

Karen K schrieb am Samstag, 14. Oktober 2023 um 14:47:29 UTC+2:

> [[humidity]]
>
> title = "Luftfeuchtigkeit"
>
> [[[outHumidity]]]
>
> name = "relativ"
>
> [[[outHumAbs]]]
>
> name = "absolut"
>
> yAxis = 1
>
> unit = gram_per_meter_cubed
>
> numberFormat
>
> decimals = 1
>
> Meteo Oberwallis schrieb am Samstag, 14. Oktober 2023 um 12:03:33 UTC+2:
>
>> Hallo.
>> Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein zu 
>> grosser Wert angezeigt. Wie kann ich das anpassen?
>> [image: 2023_10_14_12_01_34_Clipboard.png]
>> Grüsse
>>
>> Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:
>>
>>> Yes.
>>>
>>> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>>>
 when it comes to coding the best we can do is copy and paste,  all we 
 wanna know is if this tag (*$daylight*) actually does work within NOAA 
 template file.
 thank you for your help

 On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:

> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>
> We want to add below code or similar to its action to the NOAA monthly 
> report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is 
> possible to do so because of the span tags?
>
>
>
> Why not trying it?
>
> If you are not sure about the $span tag, you can replace it by 
> something else like $ii
>  
>


-- 
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/af3c9962-0337-40a3-a28d-8a184a15dda5n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-14 Thread Karen K


[[humidity]]

title = "Luftfeuchtigkeit"

[[[outHumidity]]]

name = "relativ"

[[[outHumAbs]]]

name = "absolut"

yAxis = 1

unit = gram_per_meter_cubed

numberFormat

decimals = 1

Meteo Oberwallis schrieb am Samstag, 14. Oktober 2023 um 12:03:33 UTC+2:

> Hallo.
> Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein zu 
> grosser Wert angezeigt. Wie kann ich das anpassen?
> [image: 2023_10_14_12_01_34_Clipboard.png]
> Grüsse
>
> Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:
>
>> Yes.
>>
>> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>>
>>> when it comes to coding the best we can do is copy and paste,  all we 
>>> wanna know is if this tag (*$daylight*) actually does work within NOAA 
>>> template file.
>>> thank you for your help
>>>
>>> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>>>
 Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:

 We want to add below code or similar to its action to the NOAA monthly 
 report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is 
 possible to do so because of the span tags?



 Why not trying it?

 If you are not sure about the $span tag, you can replace it by 
 something else like $ii
  

>>>

-- 
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/3732611a-a904-4a1e-abe4-c9d083543c10n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-10-14 Thread Meteo Oberwallis
Hallo.
Bei mir wird unter Belchertown bei der Absoluten Luftfeuchtugkeit ein zu 
grosser Wert angezeigt. Wie kann ich das anpassen?
[image: 2023_10_14_12_01_34_Clipboard.png]
Grüsse

Karen K schrieb am Samstag, 30. September 2023 um 08:18:19 UTC+2:

> Yes.
>
> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>
>> when it comes to coding the best we can do is copy and paste,  all we 
>> wanna know is if this tag (*$daylight*) actually does work within NOAA 
>> template file.
>> thank you for your help
>>
>> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>>
>>> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>>>
>>> We want to add below code or similar to its action to the NOAA monthly 
>>> report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is 
>>> possible to do so because of the span tags?
>>>
>>>
>>>
>>> Why not trying it?
>>>
>>> If you are not sure about the $span tag, you can replace it by something 
>>> else like $ii
>>>  
>>>
>>

-- 
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/b3848de2-a591-4ae0-ae19-4ed0f4a0c0c9n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-09-30 Thread Mks Mk
Below is NOAA file code ,how can we insert *$daylight* in it?

#errorCatcher Echo
#set $YM="%Y %m"
#set $D=" %d"
#set $M=" %b"
#set $Time=" %H:%M"
#set $NODAY=" N/A"
#set $Temp="%6.1f"
#set $Wind="%6.1f"
#set $Dir="%6.0f"
#set $Count="%6d"
#set $NONE="   N/A"
#if $unit.unit_type_dict.group_rain == "mm"
#set $Rain="%6.1f"
#else
#set $Rain="%6.2f"
#end if
   MONTHLY CLIMATOLOGICAL SUMMARY for $month_name $year_name


NAME: $station.location  
ELEV: $station.altitudeLAT: $station.latitude[0]-$station.latitude[1] 
$station.latitude[2]LONG: $station.longitude[0]-$station.longitude[1] 
$station.longitude[2]


   TEMPERATURE ($unit.label.outTemp.strip()), RAIN 
($unit.label.rain.strip()), WIND SPEED ($unit.label.windSpeed.strip())

 
  MEAN   
DAY   TEMP   HIGH   TIMELOW   TIME   

#for $day in $month.days
#if $day.outTemp.has_data or $day.rain.has_data or $day.wind.has_data
$day.dateTime.format($D, add_label=False) 
$day.outTemp.avg.format($Temp,$NONE,add_label=False) 
$day.outTemp.max.format($Temp,$NONE,add_label=False) 
$day.outTemp.maxtime.format($Time,add_label=False) 
$day.outTemp.min.format($Temp,$NONE,add_label=False) 
$day.outTemp.mintime.format($Time,add_label=False)
#else
$day.dateTime.format($D)
#end if
#end for
#if $month.outTemp.has_data or $month.rain.has_data or $month.wind.has_data

$month.outTemp.avg.format($Temp,$NONE,add_label=False) 
$month.outTemp.max.format($Temp,$NONE,add_label=False)   
 $month.outTemp.maxtime.format($D,add_label=False) 
$month.outTemp.min.format($Temp,$NONE,add_label=False)   
 $month.outTemp.mintime.format($D,add_label=False)
#end if


thank you for your help
On Saturday, September 30, 2023 at 9:18:19 AM UTC+3 Karen K wrote:

> Yes.
>
> Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:
>
>> when it comes to coding the best we can do is copy and paste,  all we 
>> wanna know is if this tag (*$daylight*) actually does work within NOAA 
>> template file.
>> thank you for your help
>>
>> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>>
>>> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>>>
>>> We want to add below code or similar to its action to the NOAA monthly 
>>> report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is 
>>> possible to do so because of the span tags?
>>>
>>>
>>>
>>> Why not trying it?
>>>
>>> If you are not sure about the $span tag, you can replace it by something 
>>> else like $ii
>>>  
>>>
>>

-- 
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/cfe23259--4f31-9bef-b7e825663d02n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-09-29 Thread Karen K
Yes.

Mks Mk schrieb am Samstag, 30. September 2023 um 03:08:55 UTC+2:

> when it comes to coding the best we can do is copy and paste,  all we 
> wanna know is if this tag (*$daylight*) actually does work within NOAA 
> template file.
> thank you for your help
>
> On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:
>
>> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>>
>> We want to add below code or similar to its action to the NOAA monthly 
>> report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is possible 
>> to do so because of the span tags?
>>
>>
>>
>> Why not trying it?
>>
>> If you are not sure about the $span tag, you can replace it by something 
>> else like $ii
>>  
>>
>

-- 
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/47a6836e-5a7c-40d7-89b5-3dadc9d0eeaan%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-09-29 Thread Mks Mk
when it comes to coding the best we can do is copy and paste,  all we wanna 
know is if this tag (*$daylight*) actually does work within NOAA template 
file.
thank you for your help

On Friday, September 29, 2023 at 9:13:23 PM UTC+3 Karen K wrote:

> Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:
>
> We want to add below code or similar to its action to the NOAA monthly 
> report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is possible 
> to do so because of the span tags?
>
>
>
> Why not trying it?
>
> If you are not sure about the $span tag, you can replace it by something 
> else like $ii
>  
>

-- 
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/7ea17351-647b-4a3e-8345-54eaa856cd65n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-09-29 Thread Karen K
Mks Mk schrieb am Freitag, 29. September 2023 um 19:09:10 UTC+2:

We want to add below code or similar to its action to the NOAA monthly 
report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is possible to 
do so because of the span tags?



Why not trying it?

If you are not sure about the $span tag, you can replace it by something 
else like $ii
 

-- 
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/6fadffa2-f14c-40d8-931e-bd8b2ea9b696n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-09-29 Thread Mks Mk
Hi

We want to add below code or similar to its action to the NOAA monthly 
report file "*NOAA-%Y-%m.txt.tmpl*" but we do not know if it is possible to 
do so because of the span tags?


  
day
sunrise
sunset
avg. temperature while sun is up 
 
#for $span in $LMTmonth.daylights 
 
$span.dateTime.format("%d") 
$span.start
$span.end
$span.outTemp.avg 
 
#end for 


thank you for your help

On Monday, January 30, 2023 at 3:45:53 PM UTC+3 Rory Gillies wrote:

> Thanks Again Karen K! It needed a little bit of tweaking but now it’s 
> working great. Here’s the working code extract from week.html.tmpl:
>
>
>   #from weewx.units import ValueTuple, ValueHelper
>   #attr $dayradiationacc=0
>   #attr $n=0
>   #for $dd in $year.days
>   #set $light=$daylight(timestamp=$dd)
>   #set $dayradiation=$light.radiation.avg.raw
>
>   #if $dayradiation is not None
>   #set $dayradiationacc=$dayradiationacc+$dayradiation
>   #set $n=$n+1
>   #end if
>   #end for
>   #if $n is not None
>
>   #set $dayradiationavg=$dayradiationacc/$n
> 
>   #set 
> $dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)
>   #else
>   #set $dayradiation_vh=0
>   #end if
>
>   $dayradiation_vh 
>   $Extras.Translations[$Extras.language].avg
>
>
> I had to change the initial values for $dayradiationacc and $n to #attr= 
> rather than #set=, and I put in a test for $n is not None to avoid a divide 
> by zero error at the start of a new week / month / year before the 
> $daylight tag returns a value > 1
>
> You can see it in action here: 
> https://www.360shetland.co.uk/weather/week.html
>
> Using the standard $week.radiation.avg tag returns a very low value 
> (around 4w/sqm prior to getting this working) as it is averaging each day 
> over 24 hours.
>
> Cheers!
>
> Rory
>
> On 28 Jan 2023, at 19:45, Karen K  wrote:
>
>
> #from weewx.units import ValueTuple, ValueHelper
> #set $dayradiationacc=0
> #set $n=0
> #for $dd in $week.days
> #set $light=$daylight(timestamp=$dd)
> #set $dayradiation=$light.radiation.sum.raw
> #if $dayradiation is not None
> #set $dayradiationacc=$dayradiationacc+$dayradiation
> #set $n=$n+1
> # end if
> #end for
> #set $dayradiationavg=$dayradiationacc/$n
> #set 
> $dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> weewx-user+...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/79c7e465-551b-43dd-84d3-08a7129be8c4n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/ba1ad1ff-1562-420e-b801-cf393212896en%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-30 Thread 'Rory Gillies' via weewx-user
Thanks Again Karen K! It needed a little bit of tweaking but now it’s working 
great. Here’s the working code extract from week.html.tmpl:

   
  #from weewx.units import ValueTuple, ValueHelper
  #attr $dayradiationacc=0
  #attr $n=0
  #for $dd in $year.days
  #set $light=$daylight(timestamp=$dd)
  #set $dayradiation=$light.radiation.avg.raw
  #if $dayradiation is not None
  #set $dayradiationacc=$dayradiationacc+$dayradiation
  #set $n=$n+1
  #end if
  #end for
  #if $n is not None
  #set $dayradiationavg=$dayradiationacc/$n
  #set 
$dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)
  #else
  #set $dayradiation_vh=0
  #end if
  $dayradiation_vh 
  $Extras.Translations[$Extras.language].avg
   

I had to change the initial values for $dayradiationacc and $n to #attr= rather 
than #set=, and I put in a test for $n is not None to avoid a divide by zero 
error at the start of a new week / month / year before the $daylight tag 
returns a value > 1

You can see it in action here: https://www.360shetland.co.uk/weather/week.html 


Using the standard $week.radiation.avg tag returns a very low value (around 
4w/sqm prior to getting this working) as it is averaging each day over 24 hours.

Cheers!

Rory

> On 28 Jan 2023, at 19:45, Karen K  wrote:
> 
> 
> #from weewx.units import ValueTuple, ValueHelper
> #set $dayradiationacc=0
> #set $n=0
> #for $dd in $week.days
> #set $light=$daylight(timestamp=$dd)
> #set $dayradiation=$light.radiation.sum.raw
> #if $dayradiation is not None
> #set $dayradiationacc=$dayradiationacc+$dayradiation
> #set $n=$n+1
> # end if
> #end for
> #set $dayradiationavg=$dayradiationacc/$n
> #set 
> $dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe 
> .
> To unsubscribe from this group and all its topics, 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/79c7e465-551b-43dd-84d3-08a7129be8c4n%40googlegroups.com
>  
> .

-- 
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/3437D5F1-D768-4E4E-861A-8C716C7A7C25%40googlemail.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-28 Thread Karen K

#from weewx.units import ValueTuple, ValueHelper
#set $dayradiationacc=0
#set $n=0
#for $dd in $week.days
#set $light=$daylight(timestamp=$dd)
#set $dayradiation=$light.radiation.sum.raw
#if $dayradiation is not None
#set $dayradiationacc=$dayradiationacc+$dayradiation
#set $n=$n+1
# end if
#end for
#set $dayradiationavg=$dayradiationacc/$n
#set 
$dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)

-- 
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/79c7e465-551b-43dd-84d3-08a7129be8c4n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-28 Thread 'Rory Gillies' via weewx-user
I'm still struggling with this. Here's the updated code:

#errorCatcher Echo
#from weewx.units import ValueTuple, ValueHelper
#set $dayradiationacc=0
#for $dd in $week.days
#set $light=$daylight(timestamp=$dd)
#set $dayradiation=$light.radiation.sum.raw
#set $dayradiationacc=$dayradiationacc+$dayradiation
#end for
#set $dayradiationavg=$dayradiationacc/$week.days
#set 
$dayradiation_vh=ValueHelper(ValueTuple($dayradiationavg,$unit.unit_type.radiation,'group_radiation'),formatter=$station.formatter)

And the error:

Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator: 
Evaluation of template /etc/weewx/skins/neowx-material/week.html.tmpl 
failed with exception ''
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:  
Ignoring template /etc/weewx/skins/neowx-material/week.html.tmpl
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:  
Reason: unsupported operand type(s) for +: 'float' and 'NoneType'
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:  
 Traceback (most recent call last):
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:    
 File "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in generate
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:    
   unicode_string = compiled_template.respond()
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:    
 File 
"cheetah__etc_weewx_skins_neowx_material_week_html_tmpl_1674912028_8195086_18355.py",
 
line 930, in respond
Jan 28 13:20:28 weather weewx[625144] ERROR weewx.cheetahgenerator:  
 TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'
I'm sure there must be an easy way to do this, I need to calculate the 
average UV index and solar radiation based on daylight hours only.

Thanks in advance!

Rory


On Thursday, January 26, 2023 at 7:43:57 PM UTC kk44...@gmail.com wrote:

> Just before the loop.
>
> #set $dayradiationacc=0
>
> rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 
> 20:35:07 UTC+1:
>
>> Thanks again. I have removed the .raw, but as you say $dayradiationacc is 
>> not initialised:
>>
>> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator: 
>> Evaluation of template /etc/weewx/skins/neowx-material/week.html.tmpl 
>> failed.
>>
>> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
>> Ignoring template /etc/weewx/skins/neowx-material/week.html.tmpl
>>
>> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
>> Reason: cannot find 'dayradiationacc'
>>
>> I’m not sure where this should be initialised so it can increase in value 
>> through the for loop?
>>
>> On 26 Jan 2023, at 18:46, Karen K  wrote:
>>
>> There are 3 problems in the next line:
>>
>>- $dayradiation is already raw, so another raw is too much.
>>- $dayradiationacc is not initialized for the first loop
>>- $dayradiationacc is already raw, so another raw is too much for the 
>>following loops
>>
>>
>> rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 
>> 18:08:23 UTC+1:
>>
>>> Thanks! That’s moved the error down a line so I’m moving in the right 
>>> direction. I can’t seem to iterate through the for loop to add each day’s 
>>> average radiation.
>>>
>>> On 26 Jan 2023, at 12:59, Karen K  wrote:
>>>
>>> rory.g...@googlemail.com schrieb am Mittwoch, 25. Januar 2023 um 
>>> 14:22:27 UTC+1:
>>>
 #set $dayradiation=$dd.$light.radiation.sum.raw <-- this is where it 
 fails

>>>
>>> Try $light.radiation.sum.raw
>>>
>>> $dd and $light in one statement is too much.
>>>
>>>  
>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "weewx-user" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/dab05ce0-7f02-4cfe-bd31-1e3e31c9632cn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>
>>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx-user+...@googlegroups.com.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/7760fae9-9ee4-4ec7-90fc-73654c2ec4f7n%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>

-- 
You received this me

Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-26 Thread Karen K
Just before the loop.

#set $dayradiationacc=0

rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 20:35:07 
UTC+1:

> Thanks again. I have removed the .raw, but as you say $dayradiationacc is 
> not initialised:
>
> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator: 
> Evaluation of template /etc/weewx/skins/neowx-material/week.html.tmpl 
> failed.
>
> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
> Ignoring template /etc/weewx/skins/neowx-material/week.html.tmpl
>
> Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
> Reason: cannot find 'dayradiationacc'
>
> I’m not sure where this should be initialised so it can increase in value 
> through the for loop?
>
> On 26 Jan 2023, at 18:46, Karen K  wrote:
>
> There are 3 problems in the next line:
>
>- $dayradiation is already raw, so another raw is too much.
>- $dayradiationacc is not initialized for the first loop
>- $dayradiationacc is already raw, so another raw is too much for the 
>following loops
>
>
> rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 
> 18:08:23 UTC+1:
>
>> Thanks! That’s moved the error down a line so I’m moving in the right 
>> direction. I can’t seem to iterate through the for loop to add each day’s 
>> average radiation.
>>
>> On 26 Jan 2023, at 12:59, Karen K  wrote:
>>
>> rory.g...@googlemail.com schrieb am Mittwoch, 25. Januar 2023 um 
>> 14:22:27 UTC+1:
>>
>>> #set $dayradiation=$dd.$light.radiation.sum.raw <-- this is where it 
>>> fails
>>>
>>
>> Try $light.radiation.sum.raw
>>
>> $dd and $light in one statement is too much.
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx-user+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/dab05ce0-7f02-4cfe-bd31-1e3e31c9632cn%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> weewx-user+...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/7760fae9-9ee4-4ec7-90fc-73654c2ec4f7n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/ff6c81ae-b96f-411e-8fcd-03bf3f041b93n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-26 Thread 'Rory Gillies' via weewx-user
Thanks again. I have removed the .raw, but as you say $dayradiationacc is not 
initialised:

Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator: Evaluation 
of template /etc/weewx/skins/neowx-material/week.html.tmpl failed.
Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
Ignoring template /etc/weewx/skins/neowx-material/week.html.tmpl
Jan 26 19:30:32 weather weewx[625144] ERROR weewx.cheetahgenerator:  
Reason: cannot find 'dayradiationacc'

I’m not sure where this should be initialised so it can increase in value 
through the for loop?

> On 26 Jan 2023, at 18:46, Karen K  wrote:
> 
> There are 3 problems in the next line:
> $dayradiation is already raw, so another raw is too much.
> $dayradiationacc is not initialized for the first loop
> $dayradiationacc is already raw, so another raw is too much for the following 
> loops
> 
> rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 18:08:23 
> UTC+1:
>> Thanks! That’s moved the error down a line so I’m moving in the right 
>> direction. I can’t seem to iterate through the for loop to add each day’s 
>> average radiation.
>> 
>> 
>>> On 26 Jan 2023, at 12:59, Karen K > wrote:
>>> 
>> 
>>> rory.g...@googlemail.com <> schrieb am Mittwoch, 25. Januar 2023 um 
>>> 14:22:27 UTC+1:
 #set $dayradiation=$dd.$light.radiation.sum.raw <-- this is where it fails
>>> 
>>> Try $light.radiation.sum.raw
>>> 
>>> $dd and $light in one statement is too much.
>>> 
>>>  
>>> 
>> 
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "weewx-user" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> weewx-user+...@googlegroups.com <>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/dab05ce0-7f02-4cfe-bd31-1e3e31c9632cn%40googlegroups.com
>>>  
>>> .
>> 
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/7760fae9-9ee4-4ec7-90fc-73654c2ec4f7n%40googlegroups.com
>  
> .

-- 
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/B5224CFB-38E5-4798-A9EB-F6DEDA5251EF%40googlemail.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-26 Thread Karen K
There are 3 problems in the next line:

   - $dayradiation is already raw, so another raw is too much.
   - $dayradiationacc is not initialized for the first loop
   - $dayradiationacc is already raw, so another raw is too much for the 
   following loops
   

rory.g...@googlemail.com schrieb am Donnerstag, 26. Januar 2023 um 18:08:23 
UTC+1:

> Thanks! That’s moved the error down a line so I’m moving in the right 
> direction. I can’t seem to iterate through the for loop to add each day’s 
> average radiation.
>
> On 26 Jan 2023, at 12:59, Karen K  wrote:
>
> rory.g...@googlemail.com schrieb am Mittwoch, 25. Januar 2023 um 14:22:27 
> UTC+1:
>
>> #set $dayradiation=$dd.$light.radiation.sum.raw <-- this is where it 
>> fails
>>
>
> Try $light.radiation.sum.raw
>
> $dd and $light in one statement is too much.
>
>  
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> weewx-user+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/dab05ce0-7f02-4cfe-bd31-1e3e31c9632cn%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/7760fae9-9ee4-4ec7-90fc-73654c2ec4f7n%40googlegroups.com.


Re: [weewx-user] New Timespan $daylight for the time while sun is up

2023-01-26 Thread 'Rory Gillies' via weewx-user
Thanks! That’s moved the error down a line so I’m moving in the right 
direction. I can’t seem to iterate through the for loop to add each day’s 
average radiation.

> On 26 Jan 2023, at 12:59, Karen K  wrote:
> 
> rory.g...@googlemail.com schrieb am Mittwoch, 25. Januar 2023 um 14:22:27 
> UTC+1:
>> #set $dayradiation=$dd.$light.radiation.sum.raw <-- this is where it fails
> 
> Try $light.radiation.sum.raw
> 
> $dd and $light in one statement is too much.
> 
>  
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/7CPWHA8azqY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/dab05ce0-7f02-4cfe-bd31-1e3e31c9632cn%40googlegroups.com
>  
> .

-- 
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/CDF45252-2BFA-4A9C-9E5C-902BDC1FE3A3%40googlemail.com.