Zum Hauptinhalt springen

Cisco Meraki Smart-Home-Integration, kostenlos und Open Source

Cisco Meraki-Integration für Gladys Assistant

Cisco Meraki by the Dashboard API: APs and switches online, clients, presence by MAC. Read only.

Info

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

Reads your Meraki organization through the official Dashboard API v1 (cloud, HTTPS) with an API key, read only: the access points and switches online, the clients online in your networks, and the presence of the MAC addresses you choose (a phone at home, for example).

Never tested with a real device: written from the official API documentation (OpenAPI spec 1.77.0) and tested against a simulated Dashboard. Unofficial integration, not affiliated with Cisco nor Meraki.

Before you start​

  1. In the Meraki Dashboard, Organization > Settings: enable the API access.
  2. In your profile (My profile > API access), generate an API key. A read-only administrator of the organization is enough: the integration never changes anything.
  3. In Gladys, paste the key, choose the region of your Dashboard (global for most organizations), save.

If the key sees several organizations, the status lists them: copy the ID of the one to read into "Organization ID".

What you get​

DeviceFeatures
The organizationaccess points online, switches online, clients online (in the networks read)
Each network readclients online
Each access point and switch (128 at most)online (online or alerting = 1; offline or dormant = 0)
Each MAC address you track (32 at most)present on the network

Add them from the Discovery page. The other clients are only counted, never kept.

How it reads​

Every refresh (120 s by default, 60 to 3600 s): GET /organizations, the networks, the device availabilities (access points and switches), then the clients online of each network read (the last hour, statuses[]=Online). One request at a time, at least 250 ms apart: 4 per second at most, under the 10 per second per organization of the API. Only GET: never a configuration change, a reboot nor any other request.

The networks read: the ones you type (ID or exact name, 10 at most), else every network with access points when there are 10 at most. With more, the status asks you to choose them, and the presence stays unknown meanwhile.

Presence​

  • Listed online in a client list: present at once.
  • Missing from complete lists for longer than the away delay (5 min by default, 0 to 60): away.
  • A list not read, cut (more than 5 pages, a network typed not found, more than 10 networks), or an entry that cannot be read: the presence stays unknown, never "away".
  • After a start, an address never seen is said away only after a full delay of complete lists.

A phone often uses a private Wi-Fi address per network: copy the one shown in its Wi-Fi settings for your network. The Dashboard updates the status of the clients with some delay: keep a few minutes of away delay.

Errors and limits​

  • Key refused (HTTP 401 on GET /organizations only): Gladys stops trying until you save another key or click Test the connection. A 401 or 403 on another request is never taken for a refusal: that value stays unknown and the others go on.
  • 429 or 5xx: every read pauses (at least 60 s, the Retry-After of the API when longer, 6 h at most), even across a restart.
  • API disabled for the organization, or an organization ID not seen by the key: said in the status.
  • The key is kept by Gladys in its database, sent only in the Authorization header to the API of the region chosen (and, on a redirect, to an n123 host of the same Meraki domain over HTTPS only). It is never written in the logs, the status nor /data; a refused key is only remembered as two 8-bit salted marks.
  • Answers are bounded (4 MB per page, 5 pages per list, 20 s per request).

Konfigurationseinstellungen​

Diese Einstellungen fragt Cisco Meraki in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
How it workssectionNeinGladys reads your Meraki organization through the official Dashboard API v1 (cloud, HTTPS) with an API key: the access points and switches online, the clients online in your networks, and whether the MAC addresses you list below are connected (presence). Read only: the integration only sends GET requests, never a configuration change nor a reboot. At most 4 requests per second, under the 10 per second per organization of the API. Never tested with a real device. Unofficial integration, not affiliated with Cisco nor Meraki.
API keysecretJaAn API key of the Meraki Dashboard (your profile, API access; the API must be enabled in Organization > Settings). A read-only administrator is enough. Kept by Gladys in its database, never shown again, sent only to the Meraki Dashboard API of the region below. If the Dashboard refuses it, Gladys stops trying until you save another key or click Test.
Dashboard regionselectNeinWhere your organization is hosted: the global Dashboard for most of them.
Organization ID (optional)stringNeinEmpty when the key sees one organization only. Otherwise the status lists those it sees: copy the ID of the one to read.
Networks to read (optional)stringNeinThe networks whose clients are read, by ID or exact name, separated by commas (10 at most). Empty: every network with access points, when there are 10 at most.
MAC addresses to track (presence)stringNeinThe addresses of the phones or devices whose presence you want in Gladys, separated by commas (32 at most), e.g. aa:bb:cc:dd:ee:ff. Each one becomes a device to add from the Discovery. Only these are kept; the other clients are only counted. A phone often uses a private address per Wi-Fi network: copy the one shown in its Wi-Fi settings for this network.
Away after (minutes)numberNeinA tracked address missing from complete client lists is said away only after this delay (a phone asleep leaves the Wi-Fi for a while, and the Dashboard updates the client status with some delay). 0 to 60 minutes.
Refresh (seconds)numberNeinHow often Gladys reads the Dashboard (3 requests, plus one per network read). 60 to 3600 seconds.
Language of names and messagesselectNeinThe names of the devices and features at their creation, and the messages.

So installierst du Cisco Meraki in Gladys​

  1. Öffne in Gladys Integrationen: Cisco Meraki 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-meraki: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-meraki.

Cisco Meraki 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​

Cisco Meraki 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 🙂