Thanks to both of you for your replies.

- since.py etc are in /usr/share/weewx/user already so indeed I can try and 
use them. I tried to directly use since in the format line of 
weewx-mastodon, but haven't succeeded yet: 
`{since($hour=24).rain.sum:%.3f}` , `{since(hour=24).rain.sum:%.3f}`... not 
sure I can do it like that.
- I'll look in the template file.
- final option is that I directly tweak wxtoot.py ...

I'll investigate and post back if I have a question... or with my solution 
if I succeed :)

On Tuesday, August 29, 2023 at 6:22:22 AM UTC+2 Greg from Oz wrote:

> I used since.py and time_since.py
> Check my page:
> https://weather.ubeaut.work/
> If you check the week month year for the cumulative rain is that what you 
> are looking for?
>
> <tr>
>                         <td>Today's Rain since 12am</td>
>                         <td>$day.rain.sum</td>
>                       </tr>
>                       <tr>
>                         <td>Today's Rain since 9am</td>
>                         <td>$since($hour=9).rain.sum</td>
>                       </tr>
>                       <tr>
>                       <td>Last rain was:</td>
>                         
> <td>$time_at('rain>0')<br>$time_since('rain>0').long_form ago</td>
>                       </tr>
>
>     search_list_extensions = 
> user.aussearch.ausutils,user.historygenerator.MyXSearch,user.xstats.ExtendedStatistics,
> *user.time_since.TimeSince,user.since.Since*
>
> Here are the files for python3
>
>
> On Tuesday, 29 August 2023 at 12:35:22 UTC+10 Glenn McKechnie wrote:
>
>> Short answer, when using the inbuilt FORMAT strings - no. 
>> Long answer - see the templates - which are lacking instruction but 
>> follow standard weewx methods - I believe. 
>>
>> Despite being the author / maintainer of weewx-mastodon I had to go 
>> back and check on the code. 
>>
>> It gets its units directly from the raw data, the archive values. 
>>
>> day.rain.sum is generated at a later stage of the weewx cycle by the 
>> StdReport engine. 
>>
>> If however you use the template method, whereby you generate a 
>> StdReport in your skins DATA directory - eg:- 
>> skins/Seasons/DATA/mastodon.txt.tmpl then you should be able to do 
>> what you are asking. 
>>
>> It's been a long while since I've looked at it, but I believe that will 
>> do it . 
>> The README notes for 24th Jan 2023 v0.04 outline one hiccup when 
>> testing the templates but it should be straight forward. 
>> Use the default as is then start tweaking it. 
>>
>>
>> On 29/08/2023, Invisible Man <[email protected]> wrote: 
>> > I am using the Mastodon extension for 
>> > Weewx. https://github.com/glennmckechnie/weewx-mastodon. 
>> > I believe my question is however not strictly related to this 
>> extension, 
>> > see below. 
>> > 
>> > It is possible to format the message which is tooted regularly and 
>> supply a 
>> > 
>> > specific format. 
>> > One of the default formats is: 
>> > 
>> > ``` 
>> > format = '{station:%s} ' \ 
>> > '\n Windspeed: {windSpeed:%.1f} ' \ 
>> > '\n Winddir: {windDir:%03.0f} ' \ 
>> > '\n Windgust: {windGust:%.1f} ' \ 
>> > '\n outTemp: {outTemp:%.1f} ' \ 
>> > '\n outHumidity: {outHumidity:%.2f} ' \ 
>> > '\n Pressure: {barometer:%.3f} ' \ 
>> > '\n Rain: {rain:%.3f} ' \ 
>> > '\n Date Time: {dateTime:%d %b %Y %H:%M}' 
>> > ``` 
>> > 
>> > The value of the rain does not work well for me, because, to my 
>> > understanding, it's the current rain, and I seldom have rain, so I 
>> rather 
>> > want to have at least the daily sum of rain. I thought I could perhaps 
>> > change the format to {day.rain.sum:%.3f}, but it is not understood... 
>> > 
>> > So, how can I get this daily sum? 
>> > 
>> > The code imports the following modules. 
>> > 
>> > ```python 
>> > import weewx 
>> > import weewx.restx 
>> > import weewx.units 
>> > from weeutil.weeutil import to_bool 
>> > ``` 
>> > 
>> > -- Axelle. 
>> > 
>> > -- 
>> > 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 [email protected]. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/weewx-user/6d7873c7-f325-414a-9471-d9387b469802n%40googlegroups.com.
>>  
>>
>> > 
>>
>>
>> -- 
>>
>>
>> Cheers 
>> Glenn 
>>
>> rorpi - read only raspberry pi & various weewx addons 
>> https://github.com/glennmckechnie 
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/877b9b0c-b101-4c3b-9a06-ce69d833fc00n%40googlegroups.com.

Reply via email to