I have a Netatmo weather station and want to display outdoor readings on my local website. I use the plugin Weather Station, v 3.2.5 at time of writing.
There’s a very easy to use widget, but today I wanted to explore putting the information in a separate Page. It took me ages to figure out, although it should have been quite simple, so this post aims to help others.
The Weather Station widget is pretty easy to use: drag it into a sidebar and check the various options for displaying temperature, rainfall and so on. There are also some styling options.
My problem came when I wanted to display data in a Page. I just couldn’t see any way to do that. Referring to the Help files, available online, told me to use shortcodes, but I couldn’t for the life of me find the shortcodes to use. They weren’t in the help files, they weren’t in the plugin’s dashboard — they were an utter and frustrating mystery. Until I found them … then it was just a struggle to use them.
- Go to the plugin’s Dashboard.
Manage stations. One or more stations are listed on the Stations page.
- Note the
Shortcodescolumn, with links to a bewildering array of shortcodes.
- I selected the
Textual dataslink so I could list the data on a page rather than displaying gauges and dials. An overlay appears with numerous possibilities for choosing data to be displayed.
Having at least found the right place I now spent quite a while fighting with this. I’d create shortcodes, put them in my page, preview, and be puzzled by what I got. So here’s the trick: the area headed
Verify the generated output is where you can see what will be displayed on the page.
Start at the top and choose the correct module. For me, that was the Outdoor module (first).
- Measurement: Temperature.
- Element: Measurement value.
- Format: Converted value with unit.
The output is now what I want: 9.8 °C.
Now I copy the shortcode from the box at the bottom:
[live-weather-station-textual device_id=’70:ee:50:19:c2:5c’ module_id=’02:00:00:19:b7:bc’ measure_type=’temperature’ element=’measure_value’ format=’computed-unit’]
Repeat this process for all the measurements you want to use.
So far, so good, but then getting the page to display as I wanted was my next problem — I was plagued by line-breaks and line spacing problems. In the end, I opted for a table. Here’s a portion of what I came up with:
<div class="weather-data"> <table width="80%" summary="Weather data from the Henham station."> <tr> <th>Measurement</th> <th>Value</th> </tr> <tr> <th>Reading at</th> <td>[live-weather-station-textual device_id='70:ee:50:19:c2:5c' module_id='06:00:00:00:d2:b6' measure_type='last_refresh' element='measure_timestamp' format='local-time'] on [live-weather-station-textual device_id='70:ee:50:19:c2:5c' module_id='06:00:00:00:d2:b6' measure_type='last_refresh' element='measure_timestamp' format='local-date'] </td> </tr>
And here’s a portion of my page once I’d finished getting all the shortcodes and creating the table.
I hope these instructions will help you,, if you’re using the Weather Station plugin.