Skip to main content

Biathlon IBU smart home integration, free and open source

Biathlon IBU integration for Gladys Assistant

IBU biathlon: next races, World Cup standings, results and shooting stats.

Follow biathlon in Gladys with the official data of the International Biathlon Union (IBU datacenter, the data behind biathlonresults.com): dates and times of the next races, World Cup / IBU Cup standings, race results and shooting statistics of your favourite athletes.

This is a cloud integration: the data comes from the Internet, nothing runs on your local network.

1. Get an IBU API key​

The IBU datacenter only answers requests carrying an API key (apikey header). Two ways to get one:

  • A personal key — ask the IBU for access to its datacenter API (see biathlonworld.com). This is the cleanest option.

  • The key of the public website — biathlonresults.com sends a key with every request your browser makes. To read it:

    1. open https://www.biathlonresults.com in a desktop browser (Chrome, Firefox, Edge);
    2. press F12 to open the developer tools, then the Network tab;
    3. reload the page (F5);
    4. type sportapi in the filter field and click one of the requests (Events, Competitions…);
    5. in Headers → Request headers, copy the value of apikey.

    This key belongs to the IBU website and may change at any time: if the integration reports "The IBU API refused the key (401)", read it again. Use it reasonably, for your personal use only.

The key is stored by Gladys as a secret, sent only to biathlonresults.com and never written to the logs.

2. Configure the integration​

  1. Open the Configuration tab of the integration.
  2. Paste the IBU API key, then click Test the IBU connection.
  3. Followed athletes: click Find an athlete, type a family name (e.g. Jeanmonnot, Preuss, Bø) and copy the IBU ID shown (e.g. BTFRA21503199701) into the field. Separate several IDs with commas (20 at most).
  4. Pick the competition level (World Cup by default), the language of the device texts, your time zone (Europe/Paris by default), the refresh interval (15 minutes by default, 5 minimum) and the race reminder delay (30 minutes by default).
  5. Save: the devices appear in the Discovery tab, ready to be added.

Devices​

  • Biathlon calendar — next race (name, venue, date and time), minutes to the next race, last winner.
  • Biathlon standings — Men / Women — overall leader and points.
  • Biathlete name (one per followed athlete) — overall rank and points, shooting accuracy of the season (total, prone, standing, in %), last race rank and result.

Shooting accuracy is computed on the individual races of the current season (sprint, pursuit, individual, mass start), 5 targets per shooting stage. Relays are left out: their spare rounds do not compare.

Dashboard widgets​

  • Next biathlon races — the next races with their date and time, a badge shortly before the start and a LIVE badge while a race runs. Settings: gender, number of races.
  • Biathlon standings — overall, sprint, pursuit, individual, mass start or nations cup, men or women, podium, top 5 or top 10, followed athletes in green.
  • Biathlete — one followed athlete, chosen by typing part of their name or their IBU ID (empty: the first followed athlete): rank, points, shooting gauge, prone and standing accuracy, last race.
  • Last biathlon results — podium of the last race, and where your followed athletes finished.

Widgets follow the language of each Gladys user.

Scenes​

Triggers (scene editor, Integrations category):

  • Biathlon race starting soon — a race starts within the reminder delay. Filters: gender, discipline. Variables: {{triggerEvent.data.race}}, location, start_time_local, minutes…
  • Biathlon race results — the results of a race are available. Variables: winner, winner_nation, second, third, race, location…
  • Result of a followed athlete — a followed athlete finished a race. Filters: athlete, placement (victory, 2nd/3rd, top 10, 11th–40th, beyond). Variables: athlete_name, rank, shootings (e.g. 0+1+0+0), misses, behind, race.
  • New overall leader — the yellow bib changed hands. Variables: leader, leader_nation, points, previous_leader.

Actions:

  • Get the next biathlon race — outputs found, race, location, start_time_local, minutes_until.
  • Get an athlete's statistics — outputs rank, points, shooting_accuracy, prone_accuracy, standing_accuracy, last_rank…
  • Get a standings leader — outputs leader, nation, points, second, gap.
  • Refresh the biathlon data — reads the IBU data right now.

Example: "Race starting soon" → send a message "{{triggerEvent.data.race}} in {{triggerEvent.data.location}} starts at {{triggerEvent.data.start_time_local}}" and turn the TV on.

Texts of scene variables use the language chosen in the configuration. A detection fires once: the integration remembers what it already announced, even across restarts. Right after installation, the first refresh only learns the past and fires nothing.

Troubleshooting​

  • "Enter your IBU API key" — the key field is empty.
  • "The IBU API refused the key (401)" — the key is wrong or expired: get a new one (see step 1).
  • No races — between seasons the calendar can be empty; check the competition level.
  • Check the integration logs from the Gladys UI (LOG_LEVEL=debug for the full detail).

The data belongs to the IBU. This integration is not affiliated with the IBU.

Configuration settings​

These are the settings Biathlon IBU asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Getting an IBU API keysectionNoThe IBU datacenter (biathlonresults.com) requires an API key. Ask the IBU for a personal key, or reuse the key of the public website: open biathlonresults.com in a desktop browser, press F12, open the Network tab, reload the page, click a request to "sportapi" and copy the value of its "apikey" request header. See the documentation for details.
IBU API keysecretYesSent only to biathlonresults.com, as the "apikey" header.
Followed athletesstringNoIBU IDs separated by commas (20 at most). Use the "Find an athlete" button below to get them.
Competition levelselectNo
Language of the device textsselectNoWidgets follow the language of each user; device states and scene variables use this one.
Time zonestringNoIANA time zone of the displayed start times.
Refresh interval (min)numberNoHow often the IBU data is read, in minutes (5 minimum).
Race reminder (min)numberNoMinutes before the start at which the "Race starting soon" trigger fires.

How to install Biathlon IBU in Gladys​

  1. In Gladys, open Integrations: Biathlon IBU appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/gboulvin/gladys-ibu:1.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/gboulvin/Gladys-IBU.

Biathlon IBU requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Biathlon IBU is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by gboulvin, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂