# Installation

{% hint style="warning" %}
Ich empfehle zur Installation von Scripts **WinSCP**

**FileZilla** überträgt in den meisten Fällen einige verschlüsselte Dateien nicht. Dadurch kann es passieren, dass die Scripts nicht funktionieren!
{% endhint %}

## 1. Alarmos herunterladen

Lade Alarmos über unser License Panel herunter.

{% embed url="<https://license.wavecore.dev>" %}

Füge Alarmos (wavecore\_alarmos) anschließend in deine Start Config hinzu.&#x20;

Alarmos muss **nach** der Framework (z.B. es\_extended), MySQL (z.B. mysql-async oder oxmysql) und deinen Handy (z.B. lb-phone) Ressource starten.

```
start wavecore_alarmos
```

## 2. SQL einfügen

Führe die SQL aus. Wir empfehlen dort **HeidiSQL**

```sql
-- SQL für Alarmos Berechtigung
-- Fügt neue Spalten zur bestehenden 'users' Tabelle hinzu

-- Grundberechtigung für Alarmos App
ALTER TABLE `users` ADD COLUMN `alarmos` tinyint(1) DEFAULT 0;

-- JSON-Feld für Melder-Berechtigungen (z.B. ["apiretterapp", "ffmelder"])
ALTER TABLE `users` ADD COLUMN `alarmos_melder` JSON DEFAULT NULL;

-- Beispiel-Daten für Testing (optional)
-- UPDATE `users` SET `alarmos` = 1, `alarmos_melder` = '["apiretterapp"]' WHERE `identifier` = 'char1:123';
-- UPDATE `users` SET `alarmos` = 1, `alarmos_melder` = '["apiretterapp", "ffmelder"]' WHERE `identifier` = 'char1:456';

-- Indices für bessere Performance bei Abfragen
CREATE INDEX IF NOT EXISTS `idx_users_alarmos` ON `users` (`identifier`, `alarmos`);

-- Für JSON-Spalten verwenden wir einen funktionalen Index oder separate Indices
CREATE INDEX IF NOT EXISTS `idx_users_identifier` ON `users` (`identifier`);
CREATE INDEX IF NOT EXISTS `idx_users_alarmos_only` ON `users` (`alarmos`);

-- Abfragen für Testing
-- Alle berechtigten Nutzer anzeigen:
-- SELECT identifier, alarmos, alarmos_melder FROM `users` WHERE `alarmos` = 1;

-- Nutzer mit spezifischem Melder finden:
-- SELECT * FROM `users` WHERE `alarmos` = 1 AND JSON_CONTAINS(`alarmos_melder`, '"apiretterapp"');

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wavecore.dev/wavecore/alarmos/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
