Versions
- Node-RED v0.16.2
- InfluxDB v1.2.2
- Grafana v4.2.0
- Ubuntu 16.04.2
I'm looking to access weather data from a local official weather station. The options available are in either csv or JSON format.
- I am attempting to retrieve the JSON feed using Node-RED.
- Using an HTTP request node, I managed to obtain parsed JSON data.
The retrieved data is structured as follows:
object
- observations: object
- notice: array[1]
- 0: object
- copyright: "Copyright Commonwealth of Australia 2017, Bureau of Meteorology. For more information see: urlhere urlhere"
- copyright_url: "urlhere"
- disclaimer_url: "urlhere"
- feedback_url: "urlhere"
- header: array[1]
- 0: object
- refresh_message: "Issued at 9:32 pm EST Tuesday 2 May 2017"
- ID: "IDV60801"
- main_ID: "IDV60800"
- name: "Moorabbin Airport"
- state_time_zone: "VIC"
- time_zone: "EST"
- product_name: "Weather Observations"
- state: "Victoria"
- data: array[155]
- [0 … 9]
- 0: object
To isolate and extract only the data: array, I used a function node called "Extract Value" containing the following code:
msg.payload = msg.payload.observations.data[0]
return msg;
The output object generated by this function contains relevant weather data fields.
Upon attempting to store this data into InfluxDB, an error occurred due to invalid number parsing.
Inserting a JSON node before saving to InfluxDB yielded successful debug output but resulted in no values being visible within Grafana charts or tables.
Your assistance is needed on the best approach to fetch data from the specified website and effectively display it graphically via Grafana after storing it in InfluxDB.