[](https://opensource.org/licenses/Apache-2.0) [](https://pypi.org/project/meteocat) [![pipeline status
npm install meteocatThis is a project to obtain meteorological data from the Meteocat API inside the Home Assistant environment.
All the data is property of Meteocat ("Servei Meteorològic de Catalunya"). This project is only a tool to offer an easy and secure access to the meteorological data provided by the "Servei Meteorològic de Catalunya" API, so you can use the data for your personal use.
Commercial use of this project or the data obtained from the API is not allowed without prior permission from the author, in case of the project, or from the "Servei Meteorològic de Catalunya" in the case of the data provided by the API.
NOTE: Meteocat API requires to use an API_KEY, you should ask to (https://apidocs.meteocat.gencat.cat/documentacio/acces-ciutada-i-administracio/)
This is a personal project.
Authors:
- Figorr
Contributors:
- mcasellas – contributed c505f27 - Improve Catalan translations
Version 3.0.0 and later introduces a breaking change in how entities are identified.
town_id instead of region_id in their unique_id. region_id but different towns. 1. Uninstall the existing integration (v2.x).
🔗 See Uninstallation Guide for the proper way of removing prior versions.
2. Restart Home Assistant.
3. Install v3.0.0 or later and configure the integration again.
- Old entities will remain as Unavailable.
- New entities will be created (sometimes with a suffix like 2).
- You may need to manually remove old entities and update your automations, dashboards, or scripts to point to the new entities.
- This change affects all entity types, including sensors, diagnostic sensors, and alerts.
- Always backup your Home Assistant configuration before performing major upgrades.
#### HACS - Install using the custom repository method.
1. First of all you need to add a custom repository like this.
1. Then download the integration from HACS.
1. Restart Home Assistant.
1. Go to Settings > Devices & Services
1. Click + Add Integration
1. Search for Meteocat and follow the configuration instructions
#### HACS - Install from the store
1. Go to HACS
1. Search for Meteocat and add it to HACS
1. Restart Home Assistant
1. Go to Settings > Devices & Services
1. Click + Add Integration
1. Search for Meteocat and follow the configuration instructions
#### Manually
Copy the custom_components/meteocat folder into the config folder.
Configuration > Integrations in the UI. Then click the + button and from the list of integrations select Meteocat. You will then be prompted to enter your API Key.!Meteocat custom component login dialog
After submitting your API Key you will either be prompted to pick a town from the list as shown below.
!Meteocat custom component town picker dialog
Once you pick the town you will be prompted to pick a station from the list. These are the nearest stations to the picked town.
!Meteocat custom component station picker dialog
Then you will be asked to set the API limits from your plan.
!Meteocat custom component api limits setting dialog
Then you will be asked to pick an area for the device.
!Area
If the device is added successfully it should appear as shown.
This device will then have the entities shown below. The sensors are translated to your system language (according to tranlation folder: en, es, ca). Or English by default.
To change units select one of the entities and open the more info dialog and click the cog in the top right. This will bring up the settings for the entity. Then select Unit of Measurement, and a dropdown will appear where you can select the units you want.
!Entity more info settings dialog
Once the integration is installed, you can reconfigure some parameters without having to remove and reinstall Meteocat.
Go to:Settings > Devices & Services > Meteocat > Configure
You will see three available options:
- Update API Key and limits
Allows you to change the API Key and update all API plan limits at the same time.
- Update limits only
Allows you to adjust only the API plan limits, keeping the same API Key.
- Regenerate assets
If for any reason some files in the assets folder (towns.json, stations.json, variables.json, symbols.json, or stations_) are missing or outdated, you can regenerate them directly from the options menu.
> ℹ️ If the Meteocat API is not available at that moment, the integration will still start, and you can retry regeneration later.
- Update coordinates and elevation
Change the default station coordinates and elevation that were set during the first setup. So you can use your location coordinates and elevation for more accurate sun and moon data.
You can access the Options Menu in two ways, both inside the integration:
- Setup Options
- System Options
Once you are inside, you will see the following options:
To correctly uninstall the integration:
- If you are upgrading due to breaking changes, remove all configured entries from
Settings > Devices & Services > Integrations, restart Home Assistant, and reinstall the new version.
- If you want to completely remove Meteocat, after removing the entries and restarting, also uninstall the integration from HACS > Integrations.
👉 For detailed steps with screenshots, check the Uninstallation Guide.
Meteocat integration has its own weather card.
To install the card, please follow the instructions from its own repository, 🎫 Meteocat Card.
For more detailed information about:
- Installation and configuration
- Usage examples
- Extra attributes in sensors
- Known issues and troubleshooting
please visit the 📖 Meteocat Wiki.
1. Check for open features/bugs
or initiate a discussion on one.
2. Fork the repository.
3. Install the dev environment: make init.
4. Enter the virtual environment: pipenv shell
5. Code your new feature or bug fix.
6. Write a test that covers your new functionality.
7. Update README.md with any new documentation.
8. Run tests and ensure 100% code coverage for your contribution: make coverage
9. Ensure you have no linting errors: make lint
10. Ensure you have typed your code correctly: make typing
11. Add yourself to AUTHORS.md.
12. Submit a pull request!
Apache-2.0. By providing a contribution, you agree the contribution is licensed under Apache-2.0.