🎮 - Yes, I still play Destiny 2 ... AI-Powered Game Server Status in Your Smart Home

Hi,

Destiny 2 might (probably will fade away) - but AI :brain: probably won’t … here an inspiration how you can use AI technology to get more useful, localized information for your screens.

image

P.S.: I’m learning at the moment, how to make myselfe obsolete :thinking: - but I guess pandora is out of the box … - well, as an old friend said: “I’m old, not obsolete” [T-800]

Let’s try to keep it that way …

Once again I give the word to my co-author to summarize our approach:


:memo: Note: This article was automatically generated using an AI agent. The rule modifications, and tests were developed and refined using AI agents as coding partners. The approach documented here reflects our approach, not necessarily universal “best practices.”

Published: 2026-02-27
Tags: openHAB, GraalVM, JavaScript, GitHub Models, AI, Destiny 2


The Problem

Many games expose a public API for server status and maintenance alerts — but the responses are in English, contain raw HTML, and give no context about what it means for you right now: Is the server coming down in 15 minutes? Is maintenance still ongoing? When can I log back in?

Displaying "Destiny 2 will be temporarily offline tomorrow for scheduled maintenance. <a href='...'>Click here</a>" on a dashboard is not useful. A player glancing at their home screen needs a single, clear German sentence.


The Solution

Combine the game’s official API with a free AI model to generate a player-facing status summary — in real time, in your language, with relative time expressions.

The full pipeline runs as an openHAB rule (GraalVM JS) every 30 minutes:

Bungie GlobalAlerts API → AI prompt (GitHub Models) → openHAB items → dashboard

The AI Prompt Design

The key insight is to pass all available structured fields to the model, not just the raw message text:

const userPrompt =
  `Aktueller Zeitpunkt: ${nowUtc}\n` + // enables relative time ("in 2 hours")
  `AlertKey: ${info.AlertKey}\n` +     // semantic signal (OfflineSoon, Offline, Complete…)
  `Schweregrad: ${LEVEL_LABEL[info.AlertLevel]}\n` + // Info / Warnung / Kritisch
  `Alert-Zeitstempel: ${info.AlertTimestamp}\n` +
  `Meldung (englisch): ${plainText}`; // HTML stripped

The system prompt instructs the model to:

  • Produce max. 2 German sentences for dashboard display
  • Convert PT timezone to Berlin time (the game’s API always uses Pacific Time)
  • Derive relative time expressions from the current timestamp
  • Interpret AlertKey prefixes semantically (OfflineSoon, LowPerformance, Complete…)
  • Prioritise the player’s key questions: When? How long? When back?

Example Outputs

Scenario AI-generated German output
Maintenance tomorrow “Destiny 2 wird morgen früh um 17 Uhr offline genommen und voraussichtlich um 20 Uhr wieder spielbar sein.”
Currently offline “Destiny 2 ist aktuell offline für Wartungsarbeiten. Eine Wiederherstellung wird für heute um ~10 Uhr erwartet.”
Emergency in 15 min “Destiny 2 wird in etwa 15 Minuten für eine Notwartung offline gehen.”
Service degraded “Destiny 2 hat derzeit Beeinträchtigungen – Schwierigkeiten beim Einloggen oder in Aktivitäten möglich.”
Maintenance complete “Die Wartung von Destiny 2 ist abgeschlossen. Du kannst dich jetzt wieder einloggen.”

The API Call

GitHub Models exposes an OpenAI-compatible REST API — no SDK needed, just a plain HTTP POST:

const body = JSON.stringify({
  model: "gpt-4o-mini",
  messages: [
    { role: "system", content: SYSTEM_PROMPT },
    { role: "user", content: userPrompt },
  ],
  max_tokens: 150,
});

const aiJson = actions.HTTP.sendHttpPostRequest(
  "https://models.inference.ai.azure.com/chat/completions",
  "application/json",
  body,
  { Authorization: `Bearer ${githubModelsToken}` },
  10000,
);

const result = JSON.parse(aiJson).choices[0].message.content.trim();

The token is a GitHub fine-grained PAT with models:read scope, stored as a plain-text file in openHAB’s secrets folder — never in the repository.


Cost

With GitHub Copilot Pro (or higher), the GitHub Models API is included at no extra cost:

  • gpt-4o-mini is a “Low” tier model: 150 requests/day free
  • A rule running every 30 minutes with an active alert makes ~2 AI calls/day
  • Well within the free quota — even on a busy maintenance week

Graceful Fallback

The AI call is wrapped in its own try/catch. If it fails for any reason (rate limit, network, API error), the rule falls back to stripping the HTML tags from the original English message and storing the plain text instead. The rest of the rule — updating other items, alert level, timestamp — always completes regardless.


Why This Pattern Is Worth Reusing

This is not Destiny 2-specific. Any API that returns structured but English/HTML status data can use the same pattern:

  • Steam game server status
  • Streaming service incidents (Netflix, Spotify)
  • Cloud provider status pages
  • Home automation service health endpoints

The combination of structured fields as context + current timestamp for relative expressions + semantic key interpretation is what makes the output actually useful rather than just a translation.


Resources