Jump to content

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

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(One intermediate revision by the same user not shown)
Line 94: Line 94:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidity'''
| width="90%" class="mtx-class-macrohead" | '''GetHumidity'''
|-
|-
| colspan="2" | Reads the reported humidity in Relative Humdity. 
| colspan="2" | Reads the reported humidity in Relative Humdity. 
Line 108: Line 108:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLocationName'''
| width="90%" class="mtx-class-macrohead" | '''GetLocationName'''
|-
|-
| colspan="2" | Reads the reported location name as a string. 
| colspan="2" | Reads the reported location name as a string. 
Line 122: Line 122:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPressure'''
| width="90%" class="mtx-class-macrohead" | '''GetPressure'''
|-
|-
| colspan="2" | Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
| colspan="2" | Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
Line 136: Line 136:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperature'''
| width="90%" class="mtx-class-macrohead" | '''GetTemperature'''
|-
|-
| colspan="2" | Reads the reported temperature in the selected scale. 
| colspan="2" | Reads the reported temperature in the selected scale. 
Line 155: Line 155:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindDirection'''
| width="90%" class="mtx-class-macrohead" | '''GetWindDirection'''
|-
|-
| colspan="2" | Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
| colspan="2" | Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
Line 169: Line 169:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindSpeed'''
| width="90%" class="mtx-class-macrohead" | '''GetWindSpeed'''
|-
|-
| colspan="2" | Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
| colspan="2" | Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
Line 183: Line 183:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Sets up the component ready to collect weather data. 
| colspan="2" | Sets up the component ready to collect weather data. 
Line 197: Line 197:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RequestData'''
| width="90%" class="mtx-class-macrohead" | '''RequestData'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 211: Line 211:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLocationCode'''
| width="90%" class="mtx-class-macrohead" | '''SetLocationCode'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 230: Line 230:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Latest revision as of 14:23, 13 July 2026

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 humidity, pressure, Wind direction etc 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. This component is used for data gathering from the internet.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_BBCWeatherObservation.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_BBCWeatherObservation.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example to read the observation data and report the Manchester weather information for today and tomorrow, on a graphical display.

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.


Macro reference

GetHumidity

GetHumidity
Reads the reported humidity in Relative Humdity. 
- BYTE Return


GetLocationName

GetLocationName
Reads the reported location name as a string. 
- STRING Return


GetPressure

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


GetTemperature

GetTemperature
Reads the reported temperature in the selected scale. 
- BOOL Scale
0 = Celcius, 1 = Farenheit 
- INT Return


GetWindDirection

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


GetWindSpeed

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


Initialise

Initialise
Sets up the component ready to collect weather data. 
- VOID Return


RequestData

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. 
- BOOL Return


SetLocationCode

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. 
- STRING NewLocation
New location string, see Location property tooltip for more info. 
- VOID Return


Property reference

Properties
LinkTo
 
BBC IP Address
IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk 
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 
Receive Timeout
Maximum time to wait for valid incoming data.