Zum Hauptinhalt springen

CasaOS Smart-Home-Integration, kostenlos und Open Source

CasaOS-Integration für Gladys Assistant

Your CasaOS server: CPU, memory, disks, temperatures, apps; start and stop an app.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Gladys reads your CasaOS home server through its local API: the load of the processor, the memory, the system disk, the temperatures, and the apps installed from the CasaOS app store. Each app becomes a Gladys device with Start and Stop buttons.

Unofficial integration, not affiliated with IceWhale (the makers of CasaOS and ZimaOS).

Tested against CasaOS 0.4.15 running in a container (the dockurr/casa image), with a test app installed, started and stopped. Never tested with a real device (a real CasaOS box, its sensors and disks). ZimaOS is not verified: its API may differ.

What you get​

  • The server (one device): CPU (%), CPU temperature, memory (% and MB used), system disk (% used and GB free), apps running and stopped, and the temperature of each physical disk CasaOS lists. A temperature CasaOS gives as 0 (no sensor, a virtual machine) is left unknown, never shown as 0 °C.
  • Each app (one device per app): running (yes / no), update available (yes / no), and the Start and Stop buttons. The app that runs Gladys itself (recognized by "gladys" in its id, title, service names, image, container or host name) is never offered.

The values are read every minute by default (30 s to 1 h), the disks every 5 minutes.

Configuration​

  1. CasaOS address: the one you open CasaOS with, http://192.168.1.20 (add :port when it is not 80). https:// only behind a reverse proxy whose certificate comes from a known authority; a self-signed certificate is refused. No path.
  2. User name and password of your CasaOS account. The password is kept by Gladys in its database, never shown again, and sent only to CasaOS, at login. With http:// it crosses your local network in clear, as it does when you log in to the CasaOS page.
  3. Refresh: how often Gladys reads CasaOS.
  4. Allow stopping apps: off by default (see below).
  5. Save, then add the devices from the Discovery tab.

One login, then the session​

CasaOS accepts five logins, then one login a minute, for all its clients (your browser included). The integration logs in once, then renews its session with the refresh token CasaOS gives (no password). It does not log in twice within a minute, even across a restart of the integration (the time of the last login is written to /data before the login is sent; when /data cannot be written, there is no login and the status says so).

If CasaOS refuses the user name or the password, the integration stops and says so: nothing is tried again until you save the configuration or press Test the connection. The refusal is remembered across restarts as a 6-bit mark (it can never tell the password).

Start and stop an app​

  • Start needs no option.
  • Stop can cut a service of the house (a database, an MQTT broker, a camera recorder Gladys uses): it is off by default. Tick Allow stopping apps to use it. The option is checked when the press arrives and again just before the command is sent.
  • Both are buttons, never a switch: a voice assistant or a "turn everything off" never reaches them.

Each press reads the app first. The command is refused, and nothing is sent, when:

  • stopping is not allowed (Stop only);
  • the app is the one running Gladys (its id, title, a service name, image, container or host name holds "gladys");
  • the app is not installed any more, or CasaOS shows one of its services paused, restarting or in another state than running, exited, created or dead;
  • the user name or password was refused, CasaOS asked to wait (HTTP 429), the integration is not connected, or the configuration changed meanwhile;
  • another command of the same app is still running, or the previous one is still being applied;
  • the time left within the 5 s Gladys waits is too short.

When the app is already in the state asked, nothing is sent and the press succeeds. An app of several services with some running and some stopped is shown running; Start then aims at every service running, Stop at none running.

The acknowledgement never waits for the states sent to Gladys.

CasaOS applies a command in the background. The press succeeds only once a read shows the app in the state asked; otherwise Gladys is told "sent, without confirmation", and the app is read again 5 s and 20 s after the command (the state published then is the one read). A command is never sent twice.

Troubleshooting​

  • "Login to CasaOS in N s": CasaOS accepts one login a minute; the integration waits.
  • "CasaOS refused the user name or the password": correct them and save.
  • "not an answer of CasaOS": the address points to another web server.
  • "CasaOS asked to wait": too many requests; every read and command pauses (1 min to 6 h, kept across restarts).
  • The integration logs what it does (LOG_LEVEL=debug for more), never a password nor a token.

Limits​

  • One CasaOS server per integration. Up to 100 apps and 16 disks.
  • The disk health CasaOS reports is not used: it is true whenever SMART gives nothing.
  • Apps installed outside the CasaOS app store (a plain docker run) are not listed by CasaOS as apps, so not here either.

Konfigurationseinstellungen​

Diese Einstellungen fragt CasaOS in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
How it workssectionNeinGladys reads your CasaOS server through its local API, with a CasaOS account: CPU, memory, system disk, temperatures, and the installed apps, each one a device (Discovery tab) with start and stop buttons. The app running Gladys is never offered. Stopping an app is off by default. Tested against CasaOS 0.4.15 in a container. Never tested with a real device (a real CasaOS box); ZimaOS not verified. Unofficial integration, not affiliated with IceWhale.
CasaOS addressstringJaThe address you open CasaOS with: http://<IP>, with :port when it is not 80. https:// only behind a reverse proxy with a certificate of a known authority. No path.
User namestringJaA CasaOS account (CasaOS has one account per server: yours).
PasswordsecretJaKept by Gladys in its database, never shown again, sent only to CasaOS, at login (once, then the session is renewed without it). Over http:// it crosses your local network in clear, as with the CasaOS page itself.
Refresh (seconds)numberNeinHow often Gladys reads CasaOS (system values and apps; the disks every 5 minutes). 30 to 3600 seconds.
Stopping appssectionNeinStarting an app needs no option. Stopping one can cut a service of the house (a database, an MQTT broker, a camera recorder Gladys uses): it is off until you tick the box below. The app running Gladys is never started nor stopped from Gladys.
Allow stopping appsbooleanNeinOn: the Stop button of an app device stops the app (checked again just before the command is sent).

So installierst du CasaOS in Gladys​

  1. Öffne in Gladys Integrationen: CasaOS erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/lm1lc3n7/gladys-casaos:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-casaos.

CasaOS benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

CasaOS ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂