Template format for wxnow.txt. **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
kds
Junior Boarder
Junior Boarder
Posts: 24
Joined: Sat Jan 26, 2019 10:13 pm

Template format for wxnow.txt. **solved**

Post by kds »

Good afternoon,

I am trying to replicate the wxnow.txt file that Cumulus creates (https://www.cumuluswiki.org/a/Wxnow.txt), which will then be ingested by an APRS client. However I'm having some trouble getting the correct template created, particularly with the rainfall amounts. I currently have this:

Code: Select all

[MMM] [DD] [YYYY] [hh]:[mm]
[wind0dir-act.000]/[wind0wind-act=mph.000]g[wind0wind-max10=mph.000]t[th0temp-act=F.000]r[rain0total-sum60=in.000]p[rain0total-sum24h=in.000]P[rain0total-daysum=in.000]h[th0hum-act.00]b[thb0seapress-act=mbar10.00000]
This is currently creating:

Code: Select all

Feb 15 2024 11:36
314/000g000t034r0p00P0h57b10245
It should reflect .2" of rain in the past 24 hours but I must have something wrong with the decimal.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1392
Joined: Mon Sep 22, 2014 3:24 am

Re: Template format for wxnow.txt

Post by Mattk »

p[rain0total-sum24h=in.000] if there is 0.2" is giving the correct output for .000, that is 0

So what is the value/length expected in the output? .2, 0.2 or ....?
kds
Junior Boarder
Junior Boarder
Posts: 24
Joined: Sat Jan 26, 2019 10:13 pm

Re: Template format for wxnow.txt

Post by kds »

Mattk wrote: Thu Feb 15, 2024 10:03 pm p[rain0total-sum24h=in.000] if there is 0.2" is giving the correct output for .000, that is 0

So what is the value/length expected in the output? .2, 0.2 or ....?
It should be "019". Basically 0.19, but no decimal. (sorry, I wrote 0.2" earlier but I meant 0.19").
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template format for wxnow.txt

Post by admin »

I just want to remark that your template definitions are incomplete, as they are lacking what to report if a sensors does not provide data. This is important for not stepping into sudden problems later on, once you believe everything is working fine. Please adapt!

Now to your original question... I guess you are looking or 1/100 inches of total rain reported into the target format, not inches. "in" gives you inches. Wiki explains in converter section of template page how to achieve this. Your rain total definition should look like this
[rain0total-daysum=in+100.000:000]. "+100" is a factor to apply. Please find more about this in the wiki. It is all described there.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1392
Joined: Mon Sep 22, 2014 3:24 am

Re: Template format for wxnow.txt. **solved**

Post by Mattk »

Ok read the cumuluswiki, answered my own question?

You will note if you read the wiki decimals are not included/allowed/used and all rainfall values are in hundredths of an inch so for 0.2" the value will be p020

p{*[rain0total-sum24h=in]*100*000}
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1392
Joined: Mon Sep 22, 2014 3:24 am

Re: Template format for wxnow.txt. **solved**

Post by Mattk »

Arh oh we cross posted Boris?

So should that be +100 or *100?
kds
Junior Boarder
Junior Boarder
Posts: 24
Joined: Sat Jan 26, 2019 10:13 pm

Re: Template format for wxnow.txt. **solved**

Post by kds »

Mattk wrote: Thu Feb 15, 2024 11:21 pm Ok read the cumuluswiki, answered my own question?

You will note if you read the wiki decimals are not included/allowed/used and all rainfall values are in hundredths of an inch so for 0.2" the value will be p020

p{*[rain0total-sum24h=in]*100*000}
Thank you! This worked!

I was using this wiki page: https://www.meteobridge.com/wiki/index.php/Templates but I must have been missing the point when it came to decimals and numerical expressions. I guess I was either making it too complicated or not enough. Maybe I just didn't understand the original output. I used to have a pretty good handle on Meteobridge templates but for some reason I just couldn't get this one right.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template format for wxnow.txt. **solved**

Post by admin »

I don't talk about the cumulus wiki. When you want to understand how templates in Meteobridge work you have to read the Meteobridge wiki. It is very explicit about templates: https://meteobridge.com/wiki/index.php/ ... Converters
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template format for wxnow.txt. **solved**

Post by admin »

Mattk wrote: Thu Feb 15, 2024 11:24 pm Arh oh we cross posted Boris?

So should that be +100 or *100?
first number is factor, second is offset. so "+100" is right as factor "+100+10" would be factor 100 plus an offset of 10.
You can also use the more versatile "{* *}" computations within templates but it will not work in charts or exports where the simple factor/offset addition as a converter is the only option.
kds
Junior Boarder
Junior Boarder
Posts: 24
Joined: Sat Jan 26, 2019 10:13 pm

Re: Template format for wxnow.txt. **solved**

Post by kds »

admin wrote: Fri Feb 16, 2024 12:01 am I don't talk about the cumulus wiki. When you want to understand how templates in Meteobridge work you have to read the Meteobridge wiki. It is very explicit about templates: https://meteobridge.com/wiki/index.php/ ... Converters
I understand that. I was just linking to the Cumulus wiki to demonstrate my expected output and the reason for doing so. I even linked to the Meteobridge wiki article I referenced in my last post, which you also referenced in the quoted post above, so it's not like I had no idea that it existed or I wasn't already referencing it. I just needed a little assistance from someone in the community to help connect the dots. Posting on the forum was my last resort after coming back to figure it out over the span of weeks, believe me when I say that. Regardless, Mattk helped me figure it out for which I am appreciative.
Post Reply