Saltar al contenido principal

Integración domótica Cisco Meraki, gratuita y de código abierto

Integración Cisco Meraki para Gladys Assistant

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

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

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).

Parámetros de configuración​

Estos son los parámetros que Cisco Meraki te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
How it workssectionNoGladys 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 keysecretSíAn 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 regionselectNoWhere your organization is hosted: the global Dashboard for most of them.
Organization ID (optional)stringNoEmpty 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)stringNoThe 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)stringNoThe 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)numberNoA 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)numberNoHow often Gladys reads the Dashboard (3 requests, plus one per network read). 60 to 3600 seconds.
Language of names and messagesselectNoThe names of the devices and features at their creation, and the messages.

Cómo instalar Cisco Meraki en Gladys​

  1. En Gladys, abre Integraciones: Cisco Meraki aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/lm1lc3n7/gladys-meraki:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-meraki.

Cisco Meraki requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

Cisco Meraki es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂