Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for metoffice to support migration to DataHub API #35954

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions source/_integrations/metoffice.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,32 @@ ha_platforms:
ha_integration_type: integration
---

The `metoffice` weather platform uses the Met Office's [DataPoint API](https://www.metoffice.gov.uk/datapoint) for weather data.
The `metoffice` weather platform uses the Met Office's [DataHub API](https://www.metoffice.gov.uk/services/data/met-office-weather-datahub) for weather data.
## Getting started
Their website is not as straightforward so check the [getting started](https://www.metoffice.gov.uk/services/data/datapoint/getting-started).
1. Register for a [Met Office account](https://register.metoffice.gov.uk/WaveRegistrationClient/public/register.do?service=datapoint).
2. After registration and verification of your account, [login](https://register.metoffice.gov.uk/MyAccountClient/account/view) to retrieve your API key.
1. Register for a [Met Office DataHub](https://datahub.metoffice.gov.uk/) account.
2. After registration, [subscribe](https://datahub.metoffice.gov.uk/profile/subscriptions) to [Site Specific Global Spot](https://datahub.metoffice.gov.uk/pricing/site-specific) dataset to obtain your API key. Free tier subscription gives 360 calls per day which is enough for using this integration

{% include integrations/config_flow.md %}

## Entities

This integration creates a number of weather entities for each entry created in the configuration by location: one weather entity with a summary and a forecast, and twelve sensor entities for individual reporting on each of the individual measurements, for both 3-hourly and daily updates (to a grand total of 26 entities available). Note that only one of the two summary entities and the 3-hourly sensor entities flagged below are enabled by default, so your system isn't overrun on initial configuration. The time supplied for each forecast is the start time for the forecast.
This integration creates a number of weather entities for each entry created in the configuration by location: one weather entity with a summary and a forecast (twice-daily and hourly), and twelve sensor entities for individual reporting on each of the individual measurements. Note that only some of the sensor entities flagged below are enabled by default, so your system isn't overrun on initial configuration.

The available sensor entities:

- "feels like" temperature
- humidity
- pressure
- probability of precipitation
- station name
- temperature
- UV index
- visibility
- visibility distance
- weather
- wind direction
- wind gust
- wind speed

Only probability of precipitation, temperature, weather and wind speed are enabled by default.
Only probability of precipitation, pressure, temperature, weather and wind speed are enabled by default.

Details about the API are available in the [DataPoint API documentation](https://www.metoffice.gov.uk/services/data/datapoint/api-reference). The [DataPoint](https://github.com/EJEP/datapoint-python) library is used to retrieve data.
Details about the API are available in the [DataHub API documentation](https://datahub.metoffice.gov.uk/docs/f/category/site-specific/overview). The [datapoint-python](https://github.com/EJEP/datapoint-python) library is used to retrieve data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Based on the search results, I can generate the final response as I have found clear evidence about the datapoint-python library's status with the Met Office integration:

Documentation needs update: datapoint-python library reference is outdated

The documentation is incorrect. According to the changelog entries from release 2024.2, while the datapoint-python library (v0.9.9) is still used, there were compatibility issues with the DataHub API that were reported upstream (EJEP/datapoint-python#183). The documentation should be updated to reflect this transition period and potential limitations.

🔗 Analysis chain

Verify datapoint-python library compatibility with DataHub API

The documentation references the datapoint-python library, but the integration has moved to the DataHub API.

Please verify:

  1. Is the datapoint-python library still used with the DataHub API?
  2. If yes, does it support the DataHub API?
  3. If no, should we update the library reference?

Run this script to check the core implementation:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if and how datapoint-python is used in the core implementation
rg -A 5 "datapoint" $(fd -t f -e py metoffice)

Length of output: 8390