how I change what shows up in my Weewx RSS feed?

56 views
Skip to first unread message

Kevin Lloyd

unread,
Oct 8, 2018, 6:11:19 PM10/8/18
to weewx-user
Hello everyone,

I have been using Weewx for a couple of months on a two Raspberry Pi 3's, each connected to a weather station. That being said, I'm using dlvr.it to pull the most recent post from one of the Weewx's RSS feed, and publish those posts to Twitter every 15 minutes, or at often as a new post shows up.

How do I change what shows up in the RSS feed?

Case in point, a recent tweet (from Twitter.com/ComoxWeather):
"Time: 08/10/18 02:40:00 PM Outside Temperature: 11.9°C Inside Temperature: 22.8°C Wind Chill: 11.9°C Heat Index: 11.9°C Dewpoint: 11.2°C Humidity: 95% Barometer: 1012.1 hPa Wind: 6 km/h from 106° Rain Rate: 0.0 mm/hr"

I find it interesting that my weather station (Acurite) and my Weewx site shows the Wind Direction as km/h from ENE (for example), but in the RSS feed and tweets, it's showing up as "Wind: 6 kmh from 106°", for example. How do I change that to show up as ENE or whatever?

I spent a couple of hours this weekend researching online, but so far haven't found a solution. Hopefully someone here can help me figure this out?

It's important to note that I'm *very* new at scripting, and the Raspberry Pi. The only reason I got this far is because people have been kind enough to post step by step setup guides, including each command line instruction, and of course I followed the guides on weewx.com, and Meteotemplate.com.

Any help is very much appreciated! :)

gjr80

unread,
Oct 8, 2018, 9:20:15 PM10/8/18
to weewx-user
Hi,

When you refer to the 'RSS feed' I presume you are referring to the weewx_rss.xml file that appears in public_html/RSS ?

You can control what appears in weewx_rss.xml through the skins/Standard/RSS/weewx_rss.xml.tmpl template file. `Wind: 6 km/h from 106°` will likely be produced by the following:

$current.windSpeed from $current.windDir

though it really depends on what you are picking up and tweeting from weewx_rss.xml. In this case the tag $current.windDir will give you a numeric direction with degree sign (the default format). If you change that to use $current.windDir.ordinal_compass instead of just $current.windDir you will get an ordinal direction like ESE. If you wan to include both you could use $current.windDir ($current.windDir.ordinal_compass) or $current.windDir.ordinal_compass ($current.windDir) to get 106° (ESE) or ESE (106°) respectively.

You might want to have a read through the Tags section of the Customization Guide or if you are really adventurous the Wind section.

Any changes you do make to weewx_rss.xml.tmpl should be safe across WeeWX upgrades but you may wish to make a copy of your modified weewx_rss.xml.tmpl just in case.

Gary

PS. You may also want to have a look at the twitter extension, might save you a bit of double handling.

Kevin Lloyd

unread,
Oct 9, 2018, 9:33:46 AM10/9/18
to weewx...@googlegroups.com
I am indeed referring to that xml file. Thank you so much, Gary! I'll backup the tmpl file and give that a try and see what happens, and post an update here. :)

--
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/sO7TbQlGySU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Kevin Lloyd

unread,
Oct 12, 2018, 7:04:15 PM10/12/18
to weewx...@googlegroups.com
Finally found some time to figure this out today! Your suggestions worked, Gary! Thank you so much for helping me with that! Hopefully others will benefit as well! :)

Kevin Lloyd

unread,
Oct 12, 2018, 7:15:46 PM10/12/18
to weewx...@googlegroups.com
Actually, I have one more related thought. Having wind direction show up in the RSS and Twitter feeds is important, but I'd like to also have the max wind gust show up as well. What do I need to change or add to make that happen?

As always, I really appreciate the help. :)

gjr80

unread,
Oct 12, 2018, 8:00:08 PM10/12/18
to weewx-user
Kevin,

Try $day.windGust.max

Gary

gjr80

unread,
Oct 12, 2018, 8:02:25 PM10/12/18
to weewx-user
Sorry, assumed you meant today but I see you did not say that. $day can be replaced with $month or $year. Other periods are available too with custom search lists.

Gary

Kevin Lloyd

unread,
Oct 12, 2018, 10:37:50 PM10/12/18
to weewx...@googlegroups.com
Hi Gary,

Here's what part of my RSS tmpl file looks like right now:

<p>
             Time:                $current.dateTime<br/>
             Outside Temperature: $current.outTemp<br/>
             Wind Chill:          $current.windchill<br/>
             Heat Index:          $current.heatindex<br/>
             Dewpoint:            $current.dewpoint<br/>
             Humidity:            $current.outHumidity<br/>
             Barometer:           $current.barometer<br/>
             Wind:                $current.windSpeed from $current.windDir.ordinal_compass<br/>
             Rain Rate:           $current.rainRate<br/>
        </p>

So, I would add something like this(?): Wind Gust:        $day.windGust.max

"$day can be replaced with $month or $year. Other periods are available too with custom search lists."

Max wind gust for the day would work, but max wind gust for the hour would be even better, since the main benefit of Twitter is that it's real-time.

What would I need to change/add to do that?

On Fri, Oct 12, 2018 at 5:02 PM gjr80 <gjrod...@gmail.com> wrote:
Sorry, assumed you meant today but I see you did not say that. $day can be replaced with $month or $year. Other periods are available too with custom search lists.

Gary

--
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/sO7TbQlGySU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gjr80

unread,
Oct 12, 2018, 10:46:58 PM10/12/18
to weewx-user
Kevin,

Try $span($hour_delta=1).windGust.max

Gary

Kevin Lloyd

unread,
Oct 12, 2018, 10:54:36 PM10/12/18
to weewx...@googlegroups.com
Thanks Gary! I'll give that a try and let you know what happens. :)

On Fri, Oct 12, 2018 at 7:47 PM gjr80 <gjrod...@gmail.com> wrote:
Kevin,

Try $span($hour_delta=1).windGust.max


Gary

--
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/sO7TbQlGySU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Lloyd

unread,
Oct 12, 2018, 11:10:13 PM10/12/18
to weewx...@googlegroups.com
Hi Gary,

That worked!

The most recent tweet:

Time: 12/10/18 08:00:00 PM Temp: 11.4°C Wind Chill: 11.4°C Heat Index: 11.4°C Dewpoint: 4.4°C Humidity: 62% Barometer: 1017.4 hPa Wind: 10 km/h from WNW Max Wind Gust this hour: 18 km/h Rain Rate: 0.0 mm/hr

Sorry, one more quick thing (I promise). What can I add/change to show total rain rate for the hour?

gjr80

unread,
Oct 12, 2018, 11:18:37 PM10/12/18
to weewx-user
Kevin, in this case you want the sum so $span($hour_delta=1).rain.sum should do what you want. Note that this gives the sum over the last 60 minutes, you can use $hour.rain.sum to get the total rain since the top of the hour (same for windGust).

Gary

Kevin Lloyd

unread,
Oct 12, 2018, 11:52:35 PM10/12/18
to weewx...@googlegroups.com
Hi Gary,

That's very helpful. Thank you. Now that you mention it, showing from the top of the hour would probably be better. So to be clear...

If I want to display the total rain since the top of the hour, I would use: $span($hour.rain.sum)

If I want to display the max wind gust since the top of the hour, I would use: $span($hour.windGust.sum)

Is that correct?

On Fri, Oct 12, 2018 at 8:18 PM gjr80 <gjrod...@gmail.com> wrote:
Kevin, in this case you want the sum so $span($hour_delta=1).rain.sum should do what you want. Note that this gives the sum over the last 60 minutes, you can use $hour.rain.sum to get the total rain since the top of the hour (same for windGust).

Gary

--
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/sO7TbQlGySU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gjr80

unread,
Oct 13, 2018, 12:37:44 AM10/13/18
to weewx-user
Hi Kevin,

No not quite. Just like $day gives aggregates since the start of the day, $hour provides aggregates from the start of the hour. So to use $hour you use exactly the same syntax as with $day eg:

$hour.rain.sum displays total rainfall since the top of the hour

and

$hour.windGust.max displays the highest windGust seen since the top of the hour

On the other hand $span provides an aggregate over some time span, that time span can be 1 or more hours, 1 or more days etc. So using $span with 1 hour gives you aggregates over the last hour. The $span syntax is slightly different in that we need to specify how long the 'span' is. To to that we use the $hour_delta parameter (or the $day_delta or the $week_delta parameter etc). So

$span($hour_delta=1).rain.sum displays the total rainfall over the last 1 hour

and

$span($hour_delta=1).windGust.max displays the highest windGust over the last 1 hour

$day, $hour etc also have a similar parameter (though not used as often); $xxxx_ago (where xxxx is day or hour etc) to give you an aggregate over the day before, the day before that, the hour before the current, the hour before that etc. $day, $hour and friends always start on a day or hour etc boundary whereas that is not necessarily the case with $span. Probably best explained in the Customization Guide (http://weewx.com/docs/customizing.htm) under the Customizing templates section (http://weewx.com/docs/customizing.htm#customizing_templates), should have pointed you there before but was on the mobile and typing much on the mobile is a pain (well for me anyway).

Gary

Reply all
Reply to author
Forward
0 new messages