Difference between revisions of "Component: BBC Weather Observation (Comms: IoT/Cloud)"

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 24: Line 26:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 65: Line 69:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 91: Line 95:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:]] -  
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Scale
 
| width="90%" | Scale
 
|-
 
|-
 
| colspan="2" | 0 = Celcius, 1 = Farenheit 
 
| colspan="2" | 0 = Celcius, 1 = Farenheit 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}

Revision as of 13:28, 17 November 2021

Author MatrixTSL
Version 1.0
Category Comms: IoT/Cloud


BBC Weather Observation component

Easily allows you to collect observed weather metrics for your area using the BBC Weather data service. Supports temperature and humidty for your selected area. Also available are Wind Direction, Wind Speed and Air Pressure but please note these are not always available depending on your selected area.

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example to read the observation data and report the information on a graphical display.

FC6 Icon.png BBCWeatherDemo


The location can be set by adjusting the BBC Weather location property, see the component property tooltips for more information on how to do this.

On an embedded device you would need a TCP/IP component to allow the communications to the BBC server. This then links to the Network Comms component.


Downloadable macro reference

Fc9-comp-macro.png GetWindDirection
Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png RequestData
Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros. 
Fc9-bool-icon.png - BOOL Return


Fc9-comp-macro.png GetHumidity
Reads the reported humidity in Relative Humdity. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetTemperature
Reads the reported temperature in the selected scale. 
Fc9-bool-icon.png - BOOL Scale
0 = Celcius, 1 = Farenheit 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetWindSpeed
Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetLocationCode
Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
Fc9-string-icon.png - STRING NewLocation
New location string, see Location property tooltip for more info. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetPressure
Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png GetLocationName
Reads the reported location name as a string. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Sets up the component ready to collect weather data. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-17-icon.png Network Comms Component
Network Communications component to use as the bridge to the TCP/IP network. 
Fc9-type-10-icon.png BBC IP Address
IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk 
Fc9-type-10-icon.png Location Code
BBC code for your area. In a web browser go to www.bbc.co.uk/weather/ Then type in your city in the search bar and your code will be shown at the end of the URL. For example Manchester in the UK = 2643123 In the UK you can also use the first half of your post code, e.g. HX1 
Fc9-type-21-icon.png Receive Timeout
Maximum time to wait for valid incoming data. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations