Skip to main content

CasaOS smart home integration, free and open source

CasaOS integration for Gladys Assistant

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

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.

Configuration settings​

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

SettingTypeRequiredDescription
How it workssectionNoGladys 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 addressstringYesThe 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 namestringYesA CasaOS account (CasaOS has one account per server: yours).
PasswordsecretYesKept 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)numberNoHow often Gladys reads CasaOS (system values and apps; the disks every 5 minutes). 30 to 3600 seconds.
Stopping appssectionNoStarting 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 appsbooleanNoOn: the Stop button of an app device stops the app (checked again just before the command is sent).

How to install CasaOS in Gladys​

  1. In Gladys, open Integrations: CasaOS appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/lm1lc3n7/gladys-casaos:0.1.1), 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/LM1LC3N7/gladys-casaos.

CasaOS 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​

CasaOS 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 LM1LC3N7, 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 🙂