---
title: "Glofox room bookings — room preparation"
description: "Glofox-Raumbuchungen per Cloud-API, ein Modul pro Raum: Booked now, Minutes to next booking, Prepare room – Raum vor jeder Buchung heizen und beleuchten."
url: "https://taphome.com/de/compatibility/glofox-room-bookings-http/"
language: de
lastmod: 2026-11-10
generator: hugo
ai:
  topics: ["http","cloud-api","rest-api","sensor","room-booking","facility-booking","scheduling","occupancy","fitness-studio"]
  questions: ["Wie integriere ich Glofox-Raumbuchungen in TapHome?","Was liest die TapHome-Vorlage für Glofox-Raumbuchungen?","Wie beantrage ich den Glofox-API-Zugang für TapHome im ABC Fitness Developer Portal?","Wie finde ich die Glofox Branch ID und die Zeitzone des Studios?","Wie mache ich einen Raum in Glofox zu einer buchbaren Facility?","Wie finde ich die Facility ID eines Glofox-Raums?","Wie heize ich einen Raum und schalte das Licht vor einer Glofox-Buchung ein?","Warum sind die Werte der Glofox-Räume in TapHome um eine Stunde verschoben?"]
---

# Glofox room bookings — room preparation

Kommunikation: Packet Parser → HTTP

## Integrationsanleitung

Glofox ist eine Cloud-Buchungsplattform von ABC Fitness, daher gibt es nichts zu verdrahten: Die TapHome Core liest die Raumbuchungen über die Glofox REST-API per HTTPS. Die Einrichtung auf der Seite des Studios besteht aus drei Teilen — Glofox-API-Zugang für das Studio, jeder vermietete Raum als buchbare Facility sowie die Branch ID und die Zeitzone des Studios. Anschließend wird die Vorlage einmal pro Raum importiert.

Die Screenshots stammen von einem Glofox-Sandbox-Teststandort (ABC Fitness Developer Portal und Glofox-Dashboard, Oktober 2026) und aus der TapHome App, verbunden mit einer Test-Steuereinheit mit simulierten Buchungen.

## Konfiguration

### 1. Glofox-API-Zugang beantragen

Der **Superadmin** des Studios registriert sich im [ABC Fitness Developer Portal](https://api-portal.glofox.com/api-portal/#/glofox/request-access) (Account Type *Customer*) und klickt auf **Request Integrator**:

- **Environment:** *Live* (*Sandbox* ist nur ein Teststandort mit Demodaten).
- **Namespace:** der Glofox-Namespace des Studios.
- **Intended Use Case:** zum Beispiel "TapHome building automation reads facility bookings to prepare rooms (heating, lights, audio) before each booking. Read-only."

ABC Fitness prüft Live-Anfragen und antwortet per E-Mail. **API-Schlüssel** und **API-Token** werden danach mit **Request credentials** angefordert und an die E-Mail-Adresse des Portalkontos gesendet. Fragen zum Zugang: glofox.apisupport@abcfitness.com.

![Anleitung zum Zugangsantrag im ABC Fitness Developer Portal](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-request-access_hu_ad9d259835295a2f.jpg)

> [!WARNING]
> API-Schlüssel und API-Token gewähren Zugriff auf die Glofox-Daten des Studios. Glofox verlangt, sie nur in Backend-Integrationen zu verwenden, niemals in clientseitigen Anwendungen; in TapHome gehören sie ausschließlich in die Importparameter der Vorlage.

### 2. Jeden Raum als buchbare Facility einrichten

Schalten Sie zuerst **Settings → Booking → Facility Rental** ein; erst danach erscheinen die unten beschriebenen Schalter der Facilities. Anschließend listet **Manage → Facilities** die Räume auf. Jeder Raum, den Trainer mieten, muss eine Facility mit eingeschaltetem **Bookable** und einem Slot-Zeitplan (Registerkarte *Schedule*) sein und unter *Price / Eligibility* *Drop In Clients* oder *Clients* zulassen (ein Preis von 0 genügt). Fehlt das, endet die Buchung eines Trainers mit „Membership not allowed“.

![Facilities im Glofox-Dashboard](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-facilities_hu_1f8fd4b2268aac05.jpg)

![Detail einer Facility mit eingeschaltetem Public und Bookable](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-facility-bookable_hu_e15ed6a0933935cc.jpg)

### 3. Branch ID und Zeitzone des Studios ermitteln

Mit API-Schlüssel und API-Token liefert eine einzige Anfrage den Studiostandort, seine ID und seine Zeitzone:

```bash
curl -s -X POST https://gf-api.aws.glofox.com/prod/v3.0/locations/retrieve \
  -H "x-api-key: <API key>" -H "x-glofox-api-token: <API token>" \
  -H "Content-Type: application/json" -d '{}'
```

`data[]._id` ist die **BranchId**, `data[].address.timezone_id` die Zeitzone des Studios (zum Beispiel `Europe/Bratislava`). Ohne Filter liefert die Anfrage alle Standorte in den Namespaces, die die Integration lesen darf; bei mehreren Studios wählen Sie daher den Eintrag des Studios, dessen Räume die Module überwachen.

Die Skriptuhr der TapHome Core muss in der Zeitzone des Studios laufen: Auf Core 2025.2 ist das die Systemzeitzone der Steuereinheit, auf neueren Core-Versionen die Zeitzone des TapHome-Standorts.

### 4. Vorlage einmal pro Raum importieren

Öffnen Sie in der TapHome App die Schnittstelle **Packet Parser** (fügen Sie sie zuerst hinzu, falls die Steuereinheit noch keine hat), dann **Aus Vorlage hinzufügen → Aus Datei hinzufügen**, und wählen Sie die heruntergeladene Vorlage. Tragen Sie `ApiKey`, `ApiToken`, `BranchId`, `LeadMinutes` und die `FacilityId` des Raums ein.

Tragen Sie den Raumnamen in **Präfix des Gerätenamens** ein und schließen Sie ihn mit einem Trennzeichen ab, zum Beispiel `Yogaraum - `. Das Präfix wird genau so, wie es eingegeben wurde, mit den Gerätenamen verbunden; ohne Trennzeichen heißt ein Gerät also „YogaraumBooked now“. **Zone** ordnet die drei Geräte des Raums der Zone dieses Raums zu.

![Importparameter in der TapHome App](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-app-import_hu_5455f063da370ee.jpg)

Ist die Facility ID noch nicht bekannt, geben Sie einen beliebigen Text ein. Nach der ersten Abfrage meldet das Modul einen Fehler, der alle Facilities des Standorts mit ihren IDs auflistet (**Geräte → Fehler und Warnungen** → das Modul):

![Modulfehler mit der Liste der Facilities des Standorts](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-app-error_hu_e4c5cc3bd4339a45.jpg)

Kopieren Sie die richtige ID in die Variable `FacilityId` des Moduls (oder importieren Sie die Vorlage erneut) und wiederholen Sie den Vorgang für jeden Raum.

### 5. Mit dem Glofox-Kalender abgleichen

Die Buchungen eines Raums erscheinen im Glofox-**Calendar** (Filter *Facilities*). Bei einer Buchung von 10:00 bis 11:00 und `LeadMinutes` 60 hat der Raum folgende Werte:

| Uhrzeit | Booked now | Minutes to next booking | Prepare room |
|---|---|---|---|
| 8:30 | Free | 90 | Idle |
| 9:00 | Free | 60 | Prepare |
| 10:30 | Booked | nächste Buchung oder 1440 | Prepare |
| 11:00 | Free | nächste Buchung oder 1440 | Idle |

Die Minuten sind ganze Minuten, gezählt ab der Abfrage; ein Wert kann daher um eins von der Tabelle abweichen.

![Buchung einer Facility im Glofox-Kalender](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-calendar_hu_3b3e02e5fd126f55.jpg)

In der TapHome App zeigt jeder Raum die drei Werte unter seinem Modul:

![Werte eines Raums in der TapHome App](https://taphome.com/images/compatibility/glofox-room-bookings-http/glofox-app-devices_hu_e3c9e82eae9fa28e.jpg)

## Smart rules

**Prepare room** ist die Bedingung der smart rules des Raums: Sollwert für Heizen oder Kühlen, Licht- und Audioszene, solange der Wert *Prepare* ist, und alles aus, sobald er wieder auf *Idle* wechselt. **Booked now** eignet sich für Belegungsanzeigen; mit **Minutes to next booking** kann eine smart rule ein träges Heizsystem früher als `LeadMinutes` starten.

## Verfügbare Geräte 3

Diese Geräte erscheinen nach dem Import in TapHome.

Glofox Room Modul

Lesen (Modul)

```taphome
# Bookings of this room (FacilityId) that run now or start within 24 h. Glofox times are the studio's local time
# ("yyyy-MM-dd HH:mm:ss"), so the Core's time zone must be the studio's. Texts in that format sort like the times,
# which lets JSONPath filters compare them directly.
VAR now := NOW();
VAR nowText := TOSTRING(now, "yyyy-MM-dd HH:mm:ss");
VAR leadText := TOSTRING(DATETIMEADD(now, 0, 0, 0, 0, LeadMinutes), "yyyy-MM-dd HH:mm:ss");
VAR nowLocal := ROUND(now.UNIXTIME + LOCALTIMEZONE() / 1000);
VAR hKey := "x-api-key: " + ApiKey;
VAR hToken := "x-glofox-api-token: " + ApiToken;
VAR hBranch := "x-glofox-branch-id: " + BranchId;
VAR msg := "";
VAR i := 0;
VAR fid := "";

# Every failed poll ends in RETURN before the values are written. After five failed polls in a row (Glofox or the
# internet down) the room is released, so an old "Prepare" does not keep heating and lights on.
failCount := failCount + 1;
IF failCount > 5
    bookedNow := 0;
    prepareRoom := 0;
    minsToNext := 1440;
END

# After start and then once an hour: the configured room must exist; if not, the error lists the rooms of the branch
# with their ids. facilityCheck counts the polls until the next check.
IF facilityCheck <= 0
    VAR fresp := SENDHTTPREQUEST("/prod/3.0/locations/" + BranchId + "/facilities?limit=100", "GET", "", hKey, hToken, hBranch);
    IF !fresp.IsSuccess
        # no connection: StatusCode 0 and no ReasonPhrase
        IF !ISNULL(fresp.ReasonPhrase)
            msg := " " + fresp.ReasonPhrase;
        END
        ADDERROR(1, "Glofox API: HTTP " + TOSTRING(fresp.StatusCode, "F0") + msg);
        RETURN(0);
    END
    IF ISNULL(PARSEJSON(fresp.Content, "$.data", TRUE))
        msg := PARSEJSON(fresp.Content, "$.message", TRUE);
        ADDERROR(2, "Glofox API: " + IF(ISNULL(msg), "unexpected answer", msg));
        RETURN(0);
    END
    IF ISNULL(PARSEJSON(fresp.Content, "$.data[?(@._id == '" + FacilityId + "')].name", TRUE))
        msg := "";
        fid := PARSEJSON(fresp.Content, "$.data[0]._id", TRUE);
        WHILE !ISNULL(fid)
            msg := msg + IF(i = 0, ": ", "; ") + PARSEJSON(fresp.Content, "$.data[" + TOSTRING(i, "F0") + "].name", TRUE) + " = " + fid;
            i := i + 1;
            fid := PARSEJSON(fresp.Content, "$.data[" + TOSTRING(i, "F0") + "]._id", TRUE);
        LOOP
        ADDERROR(3, "Facility '" + FacilityId + "' is not in this branch. Facilities" + msg);
        RETURN(0);
    END
    facilityCheck := 60;
END
facilityCheck := facilityCheck - 1;

VAR path := "/prod/2.2/branches/" + BranchId + "/bookings?status=BOOKED&limit=50&time_finish_start_date=" + TOSTRING(nowLocal, "F0") + "&time_start_end_date=" + TOSTRING(nowLocal + 86400, "F0") + "&page=";
VAR room := "$.data[?(@.model_id == '" + FacilityId + "' && @.status == 'BOOKED' && ";
VAR newBooked := 0;
VAR newPrepare := 0;
VAR nextText := "";
VAR candidate := "";
VAR total := 0;
VAR page := 1;
VAR pages := 1;
VAR nextStart := now;

# limit=50: a booking is about 1 kB (0.9 kB measured) and SENDHTTPREQUEST accepts at most 128 kB; at most 10 pages =
# 500 bookings of the whole branch (class bookings included)
VAR resp := SENDHTTPREQUEST(path + "1", "GET", "", hKey, hToken, hBranch);
WHILE page <= pages
    IF page > 1
        resp := SENDHTTPREQUEST(path + TOSTRING(page, "F0"), "GET", "", hKey, hToken, hBranch);
    END
    IF !resp.IsSuccess
        IF !ISNULL(resp.ReasonPhrase)
            msg := " " + resp.ReasonPhrase;
        END
        ADDERROR(1, "Glofox API: HTTP " + TOSTRING(resp.StatusCode, "F0") + msg);
        RETURN(0);
    END
    # a wrong API token or BranchId answers HTTP 200 with success:false and a message, and no meta
    total := PARSEJSON(resp.Content, "$.meta.totalCount", TRUE);
    IF ISNULL(total)
        msg := PARSEJSON(resp.Content, "$.message", TRUE);
        ADDERROR(2, "Glofox API: " + IF(ISNULL(msg), "unexpected answer", msg));
        RETURN(0);
    END
    pages := MIN(10, CEIL(total / 50));
    IF !ISNULL(PARSEJSON(resp.Content, room + "@.time_start <= '" + nowText + "' && @.time_finish > '" + nowText + "')]._id", TRUE))
        newBooked := 1;
    END
    IF !ISNULL(PARSEJSON(resp.Content, room + "@.time_start <= '" + leadText + "' && @.time_finish > '" + nowText + "')]._id", TRUE))
        newPrepare := 1;
    END
    # earliest booking that has not started: take any later than now, then ask for an earlier one until none is left
    candidate := PARSEJSON(resp.Content, room + "@.time_start > '" + nowText + "'" + IF(nextText = "", "", " && @.time_start < '" + nextText + "'") + ")].time_start", TRUE);
    WHILE !ISNULL(candidate)
        nextText := candidate;
        candidate := PARSEJSON(resp.Content, room + "@.time_start > '" + nowText + "' && @.time_start < '" + nextText + "')].time_start", TRUE);
    LOOP
    page := page + 1;
LOOP
IF total > 500
    ADDWARNING(4, "More than 500 bookings of the branch in the next 24 hours; only the first 500 were read, a booking of this room beyond them is not seen");
END

failCount := 0;
bookedNow := newBooked;
prepareRoom := newPrepare;
IF nextText = ""
    minsToNext := 1440;
ELSE
    nextStart := DATETIME(nextText, "yyyy-MM-dd HH:mm:ss");
    minsToNext := MIN(1440, FLOOR((nextStart.TICKS - now.TICKS) / 60000));
END
```

Booked now Reed-Kontakt

Lesen

```taphome
RETURN(bookedNow);
```

Minutes to next booking Variable

Lesen

```taphome
RETURN(minsToNext);
```

Prepare room Reed-Kontakt

Lesen

```taphome
RETURN(prepareRoom);
```

**Verbindung:** Packet Parser → HTTP

## Importparameter

Diese Werte geben Sie beim Import des XML ein.

| In der App abgefragt                                                             | Standard             |
|----------------------------------------------------------------------------------|----------------------|
| Glofox API key (x-api-key header)                                                | Beim Import eingeben |
| Glofox API token (x-glofox-api-token header)                                     | Beim Import eingeben |
| Glofox Branch ID (x-glofox-branch-id header)                                     | Beim Import eingeben |
| Glofox Facility ID for this room (model\_id in booking response)                 | Beim Import eingeben |
| Lead time in minutes — Prepare Room activates this many minutes before a booking | `60`                 |

## Verwandte Dokumentation

- [Packet-Parser-Integration](https://taphome.com/de/compatibility/packet-parser-guide/)
- [Packet Parser (HTTP, TCP, UDP, FTP, MQTT)](https://taphome.com/de/docs/integration/packet-parser/)
- [Packet-Parser-Funktionen](https://taphome.com/de/docs/script/packet-parser/)
- [Parsing-Funktionen](https://taphome.com/de/docs/script/parsing-functions/)

