2N IP Intercom Smart-Home-Integration, kostenlos und Open Source

2N IP intercoms, locally over HTTPS: doorbell, door switches, inputs, access events.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
External integration for Gladys Assistant (5.1.0 or later) for the 2N IP intercoms and access units (Verso, Force, Safety, Solo, Style, Base, Access Unit...) on your local network, through their official HTTP API over HTTPS, without any cloud. Unofficial, not affiliated with 2N. Never tested with a real device: it is written from the "2N IP HTTP API" manual (version 3.3, firmware 2.50) and tested against a simulated intercom. Your feedback is welcome.
What you get
For each intercom:
- Doorbell (read only): 1 while a visitor rings (the intercom starts an outgoing call), 0 otherwise;
- Switch n (state) (read only), for each switch (1 to 4) enabled in the intercom: 0 active (lock released), 1 at rest;
- Activate switch n: a push button, off by default (see below);
- Input ... (read only): the state of each digital input (door contact, exit button...);
- scene triggers: "2N doorbell" (once per call), "2N switch activated" (with its number and the
origin as the intercom says it:
auth,ap,dtmf,automation...), "2N access granted" and "2N access denied" (with the name of the directory user, the directionentryorexit, and the reason of a refusal).
Codes typed, card numbers and user ids are never published nor kept.
Prepare the intercom
- In the web page of the intercom, Services > HTTP API: enable the System, Switch, I/O, Phone/Call and Logging services, each over HTTPS with Digest authentication (the setting 2N recommends).
- On the same tab, create an account (5 at most) for Gladys, with the privileges: switch monitoring and control, I/O monitoring, call monitoring, and, for the access events, UID (card) monitoring. A missing privilege is no error: that part is only "not allowed" in the status, the rest works.
- Give the intercom a fixed IP address in your router.
Configure the integration
- Addresses of the intercoms: their IP addresses separated by commas (8 at most), with
:portwhen the HTTPS port is not 443. - Authentication, user, password: those of the account created above (the same on every intercom). The password is kept by Gladys in its database, never shown again, and sent only to the intercoms listed, once their certificate is trusted; with Digest, only a proof of it travels.
- Reading interval (5 to 300 s, 10 by default): how often the switches, inputs and calls are read again. Events arrive at once (the event channel of the intercom).
Trust the certificate (required)
The intercom shows a certificate of its own, that no authority vouches for. Nothing is sent to an intercom until its certificate is trusted: the status then shows the SHA-256 fingerprint seen. To trust it:
- click Trust the certificates: the integration reads the certificate of every intercom not
trusted yet and shows its fingerprint (nothing else is sent); compare it with the one your browser
shows on the web page of the intercom (padlock, certificate, SHA-256 fingerprint); then click
again within 2 minutes: every intercom that still shows the same fingerprint is trusted, kept in
/data(if/datacannot be written, nothing is trusted); - or paste the fingerprints into the Certificate fingerprints field, separated by commas.
If an intercom later shows another certificate, nothing is sent to it (no password, no command), the status shows the fingerprint seen, and the integration never learns it by itself: trust it again (two clicks) if it was replaced on purpose (new certificate, factory reset).
Activating a switch (opening a door)
Anyone who can control the devices in Gladys (dashboard, scenes, app) can open the doors once Allow activating the switches from Gladys is checked: check it only if your Gladys is well protected.
- An activation is a push button, never a switch: a "turn everything off" never opens a door.
- Right before each activation, the integration reads the identity of the intercom again (its serial number must be the one of the button's device) and the settings of the switch, then checks the option one last time before sending.
- Only monostable switches are activated, and only when their activation time (set in the intercom) is 60 s at most: the switch turns off by itself after it, whatever happens to Gladys. There is therefore no "close" command.
- An activation is never sent again by the integration, nor after a restart.
- The answer says: "confirmed" (the switch is read active, or the intercom reports the activation by the API), "accepted, not read back yet", "sent, no answer (maybe activated)", "refused by the intercom" (switch locked or disabled), or "nothing sent" with the reason.
An activation is refused, with nothing sent, when: the option is unchecked; the certificate is not trusted or changed; the credentials were refused; the intercom was not read yet, is unreachable or does not answer in time; another intercom answers at the address; the switch is missing, disabled, bistable, of unreadable mode or duration, or on for more than 60 s; the account lacks the switch control privilege; more than 4 commands are already waiting; the integration is stopping or being reconfigured; the 3.3 s deadline passed before sending.
The "2N switch activated" trigger ignores the activation Gladys made itself (a scene opening the door on this trigger does not loop).
Good to know
- Credentials refused (401 on the identity, confirmed by a second read made alone): the intercom is not asked again, even after a restart, until you change the credentials, save the configuration or click Test the connection. A refusal on another function (missing privilege) is no credentials refusal: that function is asked again after 1 min, then doubling up to 1 h.
- A wrong password is tried twice (one Digest proof, or the Basic header, per identity read) before it is
kept, 3 times at most if the password changes on the intercom while the integration runs; then no
automatic try at all. Each click on Test the connection costs 2 tries again (one click every 5 s at
most). The 2N documentation lists a
LoginBlockedevent after 3 wrong logins to the web interface; it does not say whether API failures count too. If the intercom blocks the address of Gladys, wait for the block to end before testing new credentials. - With Digest, one request at a time answers a new challenge of the intercom; the others wait for its answer, 0.5 s at most after it is sent (3.5 s if the connection to the intercom is slow), even when it is a channel read the intercom holds open up to 20 s.
- An activation is "confirmed" only when the state of the switch could be read right before it. Beyond about 650 ms per answer of the intercom, that read is skipped to leave the activation its time: it still goes, but is only "accepted".
- The event channel is opened again after a cut; events during the cut are lost, and a channel read arriving after a long silence (over 90 s) is ignored, so old events are never published. The states are corrected by the next reading.
/dataonly keeps the trusted certificates (their fingerprint, a public value) and an 8-bit mark of refused credentials, never a password.
More
Code and issues: https://github.com/LM1LC3N7/gladys-2n-intercom. API manual: https://wiki.2n.com/hip/hapi/latest/en.
Konfigurationseinstellungen
Diese Einstellungen fragt 2N IP Intercom in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Your 2N intercoms | section | Nein | For 2N IP intercoms and access units (Verso, Force, Safety, Solo, Style, Base, Access Unit...) on your network, through their official HTTP API over HTTPS, without any cloud: a doorbell, the state of the switches (door locks) and of the inputs, an activation button per switch (off by default), and scene triggers (doorbell, switch activated, access granted or denied). Create an HTTP API account in the web page of each intercom first (see the guide). Never tested with a real device. Unofficial, not affiliated with 2N. |
| Addresses of the intercoms | string | Ja | The IP address of each intercom, separated by commas (8 at most), with ":port" if its HTTPS port is not 443. Give each intercom a fixed address in your router. |
| Authentication of the HTTP API | select | Nein | As set for the services in the Services > HTTP API page of the intercoms. Digest (the default of the intercoms) never sends the password; Basic sends it inside the HTTPS connection; None sends nothing. |
| User of the HTTP API account | string | Nein | The same on every intercom listed above. |
| Password of the HTTP API account | secret | Nein | Kept by Gladys in its database, never shown again, sent only to the intercoms listed above, and only once their certificate is trusted (with Digest, only a proof of it travels). An intercom that refuses it is not asked again until you change it or click "Test the connection". |
| Certificate fingerprints (optional) | string | Nein | The intercoms show a certificate of their own, that no authority vouches for: nothing is sent to an intercom before its certificate is trusted. Either click "Trust the certificates" twice (the first click shows what each intercom presents), or paste here the SHA-256 fingerprint of each certificate, separated by commas. |
| Reading interval (seconds) | number | Nein | How often the switches, the inputs and the calls are read again (5 to 300). Events (doorbell, switches, inputs, access) arrive at once when the account may read them. |
| Activating the switches (doors) | section | Nein | Anyone who can control the devices in Gladys (dashboard, scenes, the Gladys app) can open the doors once this is allowed: allow it only if your Gladys is well protected. An activation is a push button, never a switch: a "turn everything off" never opens a door. Only monostable switches are activated (they turn off by themselves after their duration, 60 s at most); it is never sent again by the integration, nor after a restart. Every activation is written in the integration logs; the password never is. |
| Allow activating the switches from Gladys | boolean | Nein | Once checked, every Gladys user, every scene and the Gladys mobile app can activate the door switches. |
| Language of the names | select | Nein | Used for the names of the devices and features added from now on. |
So installierst du 2N IP Intercom in Gladys
- Öffne in Gladys Integrationen: 2N IP Intercom erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-2n-intercom:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-2n-intercom.
2N IP Intercom 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
2N IP Intercom 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.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation