Good question. I'm not sure that'll work either unless you're able to 
inject that data into your MQTT broker since the station observation table 
is updated by MQTT payloads that match the observation's name. 

What would be idea is a way to have a folder called "hooks", and have weewx 
generate any html.tmpl file within that folder. Then I could use javascript 
to get the contents of those HTML files much like how I am doing today with 
the other data. But that won't work because you have to define the folder 
and template file in skin.conf. If the file is missing, then weewx won't 
process the skin website generation. 

Not sure how best for you to move forward with custom text being updated 
automatically. There's gotta be a way, just need to think it through with 
the limitations in place. 



On Wednesday, June 24, 2020 at 2:44:35 PM UTC-4, Manfred Maier wrote:
>
> So a better strategy for me would be to try to include the hours of 
> sunshine in the station observations?
>
> Pat schrieb am Mittwoch, 24. Juni 2020 um 20:37:13 UTC+2:
>
>> Ok that makes more sense. Right now the reloads are only for images, not 
>> text. 
>>
>> I'm not sure how I'd be able to reliably reload the hook area text. Those 
>> .inc files are only called when the skin is generated, and when the page is 
>> reloaded. The AJAX portion does not reload them (since they're unavailable 
>> to the public because they live in the skins folder).
>>
>>
>> On Wednesday, June 24, 2020 at 2:30:12 PM UTC-4, Manfred Maier wrote:
>>>
>>> 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/902dbfb7-e42d-4f70-b6f1-81bfbeddb1afo%40googlegroups.com.

Reply via email to