Any suggestions on adding ocean surface temperature to weewx?

88 views
Skip to first unread message

Gerard Cerchio

unread,
Aug 14, 2022, 5:23:07 PM8/14/22
to weewx-user
I would like to add the San Francisco Ocean temperature to my  weewx site. I found a couple pay for this free data we got from NOAA, but I am too retired and too cheap to be taken by that grift. I think the data would be very helpful to those hardy souls performing all sorts of water/wind sports out my window.

Does anyone have some code that extracts ocean surface data from any of NOAA's many complicated API's? I would even settle for a pointer to the appropriate NOAA documentation, it's a bear to dig through all those offerings. I think it would be fun to push the data into weewx's data base and post an ocean temperature graph on my site.

Thanks

Dan Hinckley

unread,
Aug 14, 2022, 5:41:41 PM8/14/22
to weewx...@googlegroups.com
You can start here.

They offer RSS feeds which can be parsed fairly easily with Python’s feedparser.

And a web page widget here. For example, this pasted into a web page gets you the buoy data for 46237, the San Francisco Bar buoy (though it used iframes which may not suit you.)
<iframe src="https://www.ndbc.noaa.gov/widgets/station_page.php?station=46237" style="border: solid thin #3366ff; width:300px; height:300px"></iframe>

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0b308c4f-941b-4a76-a6f2-274ba73344can%40googlegroups.com.

Gerard Cerchio

unread,
Aug 14, 2022, 5:51:11 PM8/14/22
to weewx-user
Awesome! Thanks Dan'l B. I never ran across the buoy page, this is going to get me started just fine.

Dan Hinckley

unread,
Aug 14, 2022, 10:54:02 PM8/14/22
to weewx...@googlegroups.com
As a PS, I forgot to mention that you can use the forecasting extension from M Wall (which integrates Xtide) to generate a table, which can then be displayed  like this using Highcharts, or in tabular form, like this.

Happy to send you the code if it interests you. I have been a happy user of Xtide for a long time.



Gerard Cerchio

unread,
Aug 18, 2022, 6:47:39 PM8/18/22
to weewx-user
Hi Dan'l B I manged to get through all the HTML, RSS, Cheetah and Python layers and hacked to together a first pass solution. This is truly a hack, the data is being updated by a python chron job sending the RSS feed summary to file that cheetah then includes into the table cell. Very inelegant, but it gets the data onto the site. Interesting fun fact, Ubuntu 20.04.4 apt by default installs python3-feedparser_5.2.1 which has a bug that causes it to fail the buoy RSS feed. I had to manually install python3-feedparser_6.0.8-1 to successfully perform the download and parse.

Anyway, now I must explore best practices to integrate the data into weewx so I can put up a few gauges and display some historical data. Thanks very much for your help.

Capture.JPG
Reply all
Reply to author
Forward
0 new messages