Zum Hauptinhalt springen

myStrom Smart-Home-Integration, kostenlos und Open Source

myStrom-Integration für Gladys Assistant

myStrom Wi-Fi switches, bulbs, LED strips, buttons and motion sensors, locally.

Info

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

Your myStrom Wi-Fi devices in Gladys, on your local network, through the REST API the devices serve themselves: no myStrom cloud, no account. Unofficial integration, not affiliated with myStrom AG.

What you get​

DeviceIn Gladys
Switch (CH v1, CH v2, EU, Zero)On/off, power (W), energy index (kWh), temperature (°C), as far as the model measures them
BulbOn/off, brightness, colour, white temperature, power
LED StripOn/off, brightness, colour, power
Button, Button Plus (1st and 2nd gen)A button feature, and the myStrom button scene trigger (single, double, long, touch)
Motion Sensor (PIR)Motion, light level (lux), temperature

The switches, lights and motion sensors are read every 10 seconds (the Refresh interval setting, 5 seconds to 5 minutes): a motion is seen at most that late. The energy index keeps growing when a switch restarts.

Setup​

  1. In your router, give every myStrom device a fixed IP address (a DHCP reservation): the integration reaches them by address.
  2. In Gladys, open the integration Configuration tab and type the addresses in IP addresses of the devices, separated by commas, for example 192.168.1.30, 192.168.1.31. Or press Find the myStrom devices: the devices announce themselves on the network every few seconds, and Gladys listens for 7 seconds.
  3. Save. The devices appear in the Discovery tab: add the ones you want.

If you secured the local API of your devices with a token in the myStrom app, type it in API token. One token for all the devices: devices secured with different tokens are not supported yet. A device found by the search is first asked without the token: the token is only sent to a device that asks for it.

The integration checks regularly that the device answering at an address is still the same one (its MAC address). If your router gives the address of a device to another one, the first is shown unreachable and searched again, and the status of the integration names both: give your devices fixed addresses.

Buttons​

A myStrom button sleeps between presses: Gladys cannot ask it anything. When pressed, it calls the address it was given (its "action URL"). The integration runs a small receiver for these calls, in a second container that Gladys starts and publishes on a port of the Gladys machine (shown in the configuration screen).

  1. Type the IP address of the Gladys machine on your network in Address of Gladys for the buttons (for example 192.168.1.10), and save.
  2. Plug each button on USB: it stays awake while charging. Make it known to Gladys (its address in the list, or Find the myStrom devices).
  3. Press Set the button action URLs. The single, double and long presses (and the touch of a Button Plus) of every awake button now call Gladys. This replaces what the myStrom app had set on these presses.
  4. In a scene, use the myStrom button trigger, pick the button and the press. The press is in the press variable of the trigger.

A button not reached (asleep) is named in the answer: plug it on USB and press the configuration button again.

The action URLs contain a random secret, so another machine of your network cannot fire your scenes by guessing them. It is a limited protection: the buttons call Gladys in plain HTTP, so the secret can be seen by anyone listening on your network, and read back from a button by anyone who can reach its local API. It only starts scenes, it gives no access to Gladys. If you think it leaked, see "Troubleshooting".

Good to know​

  • Everything stays on your network: Gladys talks to the devices in plain HTTP, as the myStrom API does. Keep your Wi-Fi closed to strangers.
  • The Button Plus wheel, the Bulb effects (sunrise, rainbow) and the motion sensor settings are not handled.
  • The devices reached by Gladys show a "local" badge, an "unreachable" one when they stop answering.

Troubleshooting​

  • "Token refused": the device has a token in the myStrom app; type it in API token.
  • Nothing found by the search: some networks do not let Gladys hear the announcements, and buttons only announce themselves while awake. Type the addresses instead.
  • The button secret leaked: renewing it is not possible from the configuration screen yet (planned). Meanwhile, remove the action URLs of the button in the myStrom app.
  • A button press does nothing: check that the Gladys address is the one the buttons reach (not a VPN or Gladys Plus address), and set the action URLs again after changing it.

Konfigurationseinstellungen​

Diese Einstellungen fragt myStrom in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Your myStrom devices, on your local networksectionNeinSwitches (on/off, power, energy, temperature), bulbs and LED strips (on/off, brightness, colour, white), buttons and motion sensors, through the local REST API of the devices, without the myStrom cloud. Give each device a fixed IP address in your router, then type the addresses below, or use "Find the myStrom devices". The devices then appear in the Discovery tab. Unofficial integration, not affiliated with myStrom.
IP addresses of the devicesstringNeinSeparated by commas, for example 192.168.1.30, 192.168.1.31. Devices found by the search are kept without being typed here.
API token (optional)secretNeinOnly for devices whose local API is secured with a token in the myStrom app. Leave empty otherwise.
Refresh interval (s)numberNeinHow often the switches, lights and motion sensors are read, in seconds. A motion is seen at most this late.
ButtonssectionNeinA button sleeps between presses: it calls Gladys on {{gladys_host}}:{{port:buttons}} when pressed. Type the IP address of the Gladys machine below (the one the buttons reach on your network), save, plug each button on USB so it stays awake, then press "Set the button action URLs". Each press then starts the scenes that use the "myStrom button" trigger.
Address of Gladys for the buttonsstringNeinThe IP address of the machine running Gladys on your local network, for example 192.168.1.10.

So installierst du myStrom in Gladys​

  1. Öffne in Gladys Integrationen: myStrom 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-mystrom:0.1.2) 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-mystrom.

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

myStrom 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 🙂