{"id":21327515,"url":"https://github.com/rare-magma/aemet-exporter","last_synced_at":"2026-03-04T06:08:07.370Z","repository":{"id":211721743,"uuid":"729448374","full_name":"rare-magma/aemet-exporter","owner":"rare-magma","description":"CLI tool that uploads the last 24h weather conditions from the AEMET OpenData API to InfluxDB on a hourly basis","archived":false,"fork":false,"pushed_at":"2026-02-01T11:04:59.000Z","size":526,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T20:54:44.842Z","etag":null,"topics":["aemet","eltiempo","golang","grafana","grafana-dashboard","influxdb","opendata","weather"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rare-magma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-09T09:04:26.000Z","updated_at":"2026-02-01T11:04:57.000Z","dependencies_parsed_at":"2023-12-21T00:24:22.382Z","dependency_job_id":"85913c00-5404-47f9-8425-e34ae20f8cdf","html_url":"https://github.com/rare-magma/aemet-exporter","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"61514968b846d552f71be9d18def8ecb26f63e79"},"previous_names":["rare-magma/aemet-exporter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rare-magma/aemet-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Faemet-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Faemet-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Faemet-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Faemet-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rare-magma","download_url":"https://codeload.github.com/rare-magma/aemet-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Faemet-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30073796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aemet","eltiempo","golang","grafana","grafana-dashboard","influxdb","opendata","weather"],"created_at":"2024-11-21T21:17:59.937Z","updated_at":"2026-03-04T06:08:07.356Z","avatar_url":"https://github.com/rare-magma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aemet-exporter\n\nCLI tool that uploads the last 24h weather conditions from the AEMET OpenData API to influxdb on a hourly basis\n\n## Dependencies\n\n- [go](https://go.dev/)\n- [influxdb v2+](https://docs.influxdata.com/influxdb/v2.6/)\n- Optional:\n  - [make](https://www.gnu.org/software/make/) - for automatic installation support\n  - [docker](https://docs.docker.com/)\n  - [systemd](https://systemd.io/)\n\n## Relevant documentation\n\n- [AEMET OpenData API](https://opendata.aemet.es)\n- [InfluxDB API](https://docs.influxdata.com/influxdb/v2.6/write-data/developer-tools/api/)\n- [Systemd Timers](https://www.freedesktop.org/software/systemd/man/systemd.timer.html)\n- [compose-scheduler](https://github.com/reddec/compose-scheduler)\n\n## Installation\n\n### With Docker\n\n#### docker-compose\n\n1. Configure `aemet_exporter.json` (see the configuration section below).\n1. Run it.\n\n   ```bash\n   docker compose up --detach\n   ```\n\n#### docker build \u0026 run\n\n1. Build the docker image.\n\n   ```bash\n   docker build . --tag aemet-exporter\n   ```\n\n1. Configure `aemet_exporter.json` (see the configuration section below).\n1. Run it.\n\n   ```bash\n    docker run --rm --tty --interactive --read-only --cap-drop ALL --security-opt no-new-privileges:true --cpus 2 -m 64m --pids-limit 16 --volume ./aemet_exporter.json:/app/aemet_exporter.json:ro ghcr.io/rare-magma/aemet-exporter:latest\n    ```\n\n### With the Makefile\n\nFor convenience, you can install this exporter with the following command or follow the manual process described in the next paragraph.\n\n```bash\nmake build\nmake install\n$EDITOR $HOME/.config/aemet_exporter.json\n```\n\n### Manually\n\n1. Build `aemet_exporter` with:\n\n   ```bash\n   go build -ldflags=\"-s -w\" -o aemet_exporter main.go\n   ```\n\n2. Copy `aemet_exporter` to `$HOME/.local/bin/`.\n\n3. Copy `aemet_exporter.json` to `$HOME/.config/`, configure it (see the configuration section below) and make it read only.\n\n4. Copy the systemd unit and timer to `$HOME/.config/systemd/user/`:\n\n   ```bash\n   cp aemet-exporter.* $HOME/.config/systemd/user/\n   ```\n\n5. and run the following command to activate the timer:\n\n   ```bash\n   systemctl --user enable --now aemet-exporter.timer\n   ```\n\nIt's possible to trigger the execution by running manually:\n\n```bash\nsystemctl --user start aemet-exporter.service\n```\n\n### Config file\n\nThe config file has a few options:\n\n```json\n{\n \"InfluxDBHost\": \"influxdb.example.com\",\n \"InfluxDBApiToken\": \"ZXhhbXBsZXRva2VuZXhhcXdzZGFzZGptcW9kcXdvZGptcXdvZHF3b2RqbXF3ZHFhc2RhCg==\",\n \"Org\": \"home\",\n \"Bucket\": \"aemet\",\n \"AemetApiKey\": \"ZXhhbXBsZXRva2VuZXhhcXdzZGFzZGptcW9kcXdvZGptcXdvZHF3b2RqbXF3ZHFhc2RhCg==\",\n \"AemetWeatherStationCode\": \"1234Y\"\n}\n```\n\n- `InfluxDBHost` should be the FQDN of the influxdb server.\n- `Org` should be the name of the influxdb organization that contains the data bucket defined below.\n- `Bucket` should be the name of the influxdb bucket that will hold the data.\n- `InfluxDBApiToken` should be the influxdb API token value.\n  - This token should have write access to the `Bucket` defined above.\n- `AemetApiKey` should be the AEMET API key requested in the AEMET OpenData's [website](https://opendata.aemet.es/centrodedescargas/altaUsuario?)\n- `AemetWeatherStationCode` should be the alphanumeric code assigned to the weather station. Can be found in AEMET OpenData's [website](https://opendata.aemet.es/centrodedescargas/productosAEMET?) \"Seleccione una estación\" dropdown.\n\n## Troubleshooting\n\nCheck the systemd service logs and timer info with:\n\n```bash\njournalctl --user --unit aemet-exporter.service\nsystemctl --user list-timers\n```\n\n## Exported metrics for each hour\n\nWeather stations might have a different set of sensors so not all metrics below might be populated.\n\n- temperature: `°C`\n- humidity: `%`\n- pressure: `hPa`\n- windspeed: `km/h`\n- windgust: `km/h`\n- winddirection: `°`\n- precipitation: `mm`\n- dewpoint: `°C`\n- visibility: `km`\n- insolation: `hours`\n- snow: `cm`\n\n## Exported metrics example\n\n```bash\naemet_weather_conditions,station=3195 temperature=11.1,humidity=99.0,pressure=949.7,windspeed=0.9,winddirection=271.0,windgust=2.9,precipitation=0.0,dewpoint=11.0,visibility=1.0,insolation=1.0,snow=0.0 1702206000\n```\n\n## Example grafana dashboard\n\nIn `aemet-dashboard.json` there is an example of the kind of dashboard that can be built with `aemet-exporter` data:\n\n\u003cimg alt=\"example grafana dashboard screenshot\" src=\"dashboard-screenshot.png\" title=\"Example grafana dashboard\" width=\"100%\"\u003e\n\nImport it by doing the following:\n\n1. Create a dashboard\n2. Click the dashboard's settings button on the top right.\n3. Go to JSON Model and then paste there the content of the `aemet-dashboard.json` file.\n\n## Uninstallation\n\n### With the Makefile\n\nFor convenience, you can uninstall this exporter with the following command or follow the process described in the next paragraph.\n\n```bash\nmake uninstall\n```\n\n### Manually\n\nRun the following command to deactivate the timer:\n\n```bash\nsystemctl --user disable --now aemet-exporter.timer\n```\n\nDelete the following files:\n\n```bash\n~/.local/bin/aemet_exporter\n~/.config/aemet_exporter.json\n~/.config/systemd/user/aemet-exporter.timer\n~/.config/systemd/user/aemet-exporter.service\n```\n\n## Credits\n\nInformación elaborada por la Agencia Estatal de Meteorología © AEMET\n\n- [reddec/compose-scheduler](https://github.com/reddec/compose-scheduler)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frare-magma%2Faemet-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frare-magma%2Faemet-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frare-magma%2Faemet-exporter/lists"}