It's text.
I'm displaying the amount of sunshine hours on that day. In a somewhat 
dynamic way.

Here's the index_hook_after_station_info I'm using.

    #set sunshinetime = $day.sunshineTime.sum.raw
    #set sunshinetheoretical = $day.sunshineTheoretical.sum.raw
    #set ratio = 0 

    #set hours = int($sunshinetime / 60)
    #set minutes = int($sunshinetime - ($hours * 60))

    #if $sunshinetheoretical > 0
        #set $ratio = $sunshinetime / $sunshinetheoretical
    #end if

    #set $hoursstr = str($hours)

    #if $minutes < 10
        #set $minutesstr = '0' + str($minutes)
    #else
        #set $minutesstr = str($minutes)
    #end if

    #set $sundurationtext = $hoursstr + ':' + $minutesstr + ' Stunden'

    #if $sunshinetheoretical > 0 and $current.sunshineTheoretical.raw == 0 
and $sunshinetime > 0
        #set $suntext = 'Heute gab es insgesamt ' + $sundurationtext + ' 
Sonnenschein.'
    #else if $sunshinetheoretical > 0 and $current.sunshineTheoretical.raw 
== 0 and $sunshinetime == 0
        #set $suntext = 'Heute gab es leider gar keinen Sonnenschein.'
    #else if $ratio >= 0.7
        #set $suntext = 'Heute gab es schon ' + $sundurationtext + ' 
Sonnenschein.'
    #else if $ratio >= 0.4
        #set $suntext = 'Heute gab es bisher ' + $sundurationtext + ' 
Sonnenschein.'
    #else if $ratio < 0.4 and $sunshinetheoretical > 0 and $sunshinetime > 0
        #set $suntext = 'Heute gab es erst ' + $sundurationtext + ' 
Sonnenschein.'
    #else if $ratio < 0.4 and $sunshinetheoretical > 0 and $sunshinetime == 
0
        #set $suntext = 'Heute gab es leider noch keinen Sonnenschein.' 
    #else
        #set $suntext = ''      
    #end if

    #set $dailyrain = $day.rain.sum.raw 

    #if $dailyrain == 0
        #set raintext = 'Bisher kein Regen.'
    #else 
        #set $raintext = 'Bisher ' + str($day.rain.sum) + ' Regen.'
    #end if

<br>
<p align="center" style="font-size:24px">
$suntext $raintext
</p>
<br>

-- 
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/7ad319e9-6ece-44e8-9e0b-72e0e55c6ae6n%40googlegroups.com.

Reply via email to