Component: BBC Weather Forecast (Comms: IoT/Cloud): Difference between revisions
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" 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"" |
||
| Line 96: | Line 96: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetDayName''' | ||
|- | |- | ||
| colspan="2" | Gets the name of the currently selected day as a string. | | colspan="2" | Gets the name of the currently selected day as a string. | ||
| Line 110: | Line 110: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetDaySummary''' | ||
|- | |- | ||
| colspan="2" | Gets the summary of the currently selected day as a string. | | colspan="2" | Gets the summary of the currently selected day as a string. | ||
| Line 124: | Line 124: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetHumidity''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast humidity in Relative Humdity for the selected day. | | colspan="2" | Reads the forecast humidity in Relative Humdity for the selected day. | ||
| Line 138: | Line 138: | ||
|- | |- | ||
| 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%" | | 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 152: | Line 152: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetMaxTemperature''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast maximum temperature in the selected scale for the selected day. | | colspan="2" | Reads the forecast maximum temperature in the selected scale for the selected day. | ||
| Line 171: | Line 171: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetMinTemperature''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast minimum temperature in the selected scale for the selected day. | | colspan="2" | Reads the forecast minimum temperature in the selected scale for the selected day. | ||
| Line 190: | Line 190: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetPollution''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast pollution as a string for the selected day. | | colspan="2" | Reads the forecast pollution as a string for the selected day. | ||
| Line 204: | Line 204: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetPressure''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast air pressure in milli bar (mb) for the selected day. | | colspan="2" | Reads the forecast air pressure in milli bar (mb) for the selected day. | ||
| Line 218: | Line 218: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetSunrise''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast sunrise time as a string for the selected day. | | colspan="2" | Reads the forecast sunrise time as a string for the selected day. | ||
| Line 232: | Line 232: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetSunset''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast sunset time as a string for the selected day. | | colspan="2" | Reads the forecast sunset time as a string for the selected day. | ||
| Line 246: | Line 246: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetUVRisk''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast UV Risk for the selected day. | | colspan="2" | Reads the forecast UV Risk for the selected day. | ||
| Line 260: | Line 260: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetVisibility''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast visibility for the selected day. | | colspan="2" | Reads the forecast visibility for the selected day. | ||
| Line 274: | Line 274: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetWindDirection''' | ||
|- | |- | ||
| colspan="2" | Reads the forecast wind direction as a string for the selected day. | | colspan="2" | Reads the forecast wind direction as a string for the selected day. | ||
| Line 288: | Line 288: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''GetWindSpeed''' | ||
|- | |- | ||
| colspan="2" | Reads the reported wind speed in MPH for the selected day. | | colspan="2" | Reads the reported wind speed in MPH for the selected day. | ||
| Line 302: | Line 302: | ||
|- | |- | ||
| 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%" | | 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 316: | Line 316: | ||
|- | |- | ||
| 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%" | | 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 330: | Line 330: | ||
|- | |- | ||
| 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%" | | width="90%" class="mtx-class-macrohead" | '''SetForecastDay''' | ||
|- | |- | ||
| colspan="2" | Chooses which day of the three day forecast to look at. | | colspan="2" | Chooses which day of the three day forecast to look at. | ||
| Line 349: | Line 349: | ||
|- | |- | ||
| 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%" | | 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 369: | Line 369: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | 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 Forecast component
Easily allows you to collect observed weather metrics for your area using the BBC Weather data service. Supports temperature and humidity 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_BBCWeatherForecast.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_BBCWeatherForecast.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Here is a basic example to read the three day forecast data and report the information on a graphical display.
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.
Here is an example of a next-day weather predictor that also shows the current-day weather for a ESP32 embedded device
Macro reference
GetDayName
| GetDayName | |
| Gets the name of the currently selected day as a string. | |
| Return | |
GetDaySummary
| GetDaySummary | |
| Gets the summary of the currently selected day as a string. | |
| Return | |
GetHumidity
| GetHumidity | |
| Reads the forecast humidity in Relative Humdity for the selected day. | |
| Return | |
GetLocationName
| GetLocationName | |
| Reads the reported location name as a string. | |
| Return | |
GetMaxTemperature
| GetMaxTemperature | |
| Reads the forecast maximum temperature in the selected scale for the selected day. | |
| Scale | |
| 0 = Celcius, 1 = Farenheit | |
| Return | |
GetMinTemperature
| GetMinTemperature | |
| Reads the forecast minimum temperature in the selected scale for the selected day. | |
| Scale | |
| 0 = Celcius, 1 = Farenheit | |
| Return | |
GetPollution
| GetPollution | |
| Reads the forecast pollution as a string for the selected day. | |
| Return | |
GetPressure
| GetPressure | |
| Reads the forecast air pressure in milli bar (mb) for the selected day. | |
| Return | |
GetSunrise
| GetSunrise | |
| Reads the forecast sunrise time as a string for the selected day. | |
| Return | |
GetSunset
| GetSunset | |
| Reads the forecast sunset time as a string for the selected day. | |
| Return | |
GetUVRisk
| GetUVRisk | |
| Reads the forecast UV Risk for the selected day. | |
| Return | |
GetVisibility
| GetVisibility | |
| Reads the forecast visibility for the selected day. | |
| Return | |
GetWindDirection
| GetWindDirection | |
| Reads the forecast wind direction as a string for the selected day. | |
| Return | |
GetWindSpeed
| GetWindSpeed | |
| Reads the reported wind speed in MPH for the selected day. | |
| Return | |
Initialise
| Initialise | |
| Sets up the component ready to collect weather data. | |
| Return | |
RequestData
SetForecastDay
| SetForecastDay | |
| Chooses which day of the three day forecast to look at. | |
| Day | |
| 0 = Today, 1 = Tomorrow, 2 = Day After Tomorrow | |
| Return | |
SetLocationCode