Public IP Smart-Home-Integration, kostenlos und Open Source

Unofficial connector: public IP, IP change and outage triggers, Duck DNS and Cloudflare updates.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Unofficial connector, not affiliated with ipify, icanhazip, ident.me, Duck DNS or Cloudflare. It tells Gladys the public address of your home (IPv4, and IPv6 when available), warns your scenes when it changes or when the Internet goes down, and can keep a Duck DNS or Cloudflare name pointed at your home. No account needed for the detection.
What you get
| Surface | Content |
|---|---|
| The Internet device | Internet connected (yes / no), public IPv4, public IPv6 |
| Scene triggers | public IP changed (IPv4, IPv6 or both; old and new address), Internet lost, Internet restored (with the outage duration) |
| Scene actions | get the public IP (IPv4, IPv6, last change, connected), update the DNS now |
| Dashboard widget | Public IP: the connection, the addresses, how long they have not changed, the state of each DNS provider, an "Update DNS now" button |
| Dynamic DNS (optional) | Duck DNS and Cloudflare, updated at start and whenever the address changes |
Setup
- Install the integration. The check starts right away.
- Open Discovery and add the Internet device to see the connection and the addresses on the device page.
- Optional: put the Public IP widget on a dashboard.
- Optional: fill the Duck DNS or Cloudflare section (below), save, then press Test detection and DNS to check everything without writing anything.
The address is checked every 5 minutes (option Check interval, 1 to 60). Each check is one tiny request to one of three free services (ipify, icanhazip, ident.me), taken in turn. A new address is only believed once two different services give the same one: a broken service cannot fire a false "public IP changed".
IPv6: a Docker container usually has no IPv6. The integration then says so calmly in its status ("IPv6 is not available from the container") and tries again every 30 minutes; nothing is wrong. Turn Detect the public IPv6 too off to stop trying.
Dynamic DNS
Duck DNS
- Sign in on duckdns.org, create a sub-domain
(
myhomegivesmyhome.duckdns.org) and copy the token shown on the page. - In the configuration, type the sub-domain(s) (separated by commas) and paste the token.
- Also send the IPv6 is off by default: an IPv6 name only helps when your router lets incoming IPv6 through, otherwise it can break access over IPv4.
Duck DNS is updated once at start, then only when the address changes. Duck DNS has no test mode: the Test button only checks the fields.
Cloudflare
- In the Cloudflare dashboard, My Profile → API Tokens → Create Token, template Edit zone DNS, limited to your zone. Copy the token.
- Create the records you want to follow (type A, and AAAA for IPv6) in the DNS page of the zone, with any address: the integration never creates nor deletes a record, it only changes the address of existing ones. The proxy setting (orange cloud) and the TTL are kept as they are.
- In the configuration, paste the token, type the zone (
example.com, or its Zone ID from the zone's Overview page) and the record names (home.example.com, vpn— a short name is completed with the zone,@is the zone itself). - Press Test detection and DNS: it shows the token status and, for each record, whether it is up to date or would be updated.
An update that fails is tried again after 2, 4, 8… minutes, at most every hour. A refused token stops the updates until you save the configuration again; the Update DNS now button always tries.
Scenes
- Public IP changed: leave the version empty for both, or pick IPv4 or
IPv6. Variables:
family(ipv4oripv6),old_ip,new_ip. Example: send yourself the new address, restart a VPN. - Internet lost: no service answered the chosen number of checks in a
row (2 by default; while the checks fail they run every minute). Variables:
lost_at,ipv4(the last known address). - Internet restored: the services answer again. Variables:
duration_minutes,lost_at,ipv4.
The action get the public IP gives ipv4, ipv6, last_change and
online; update the DNS now gives success, updated and error.
The first check after a start only learns the address; after a restart, the address kept by the Internet device is compared with the new one, so a change during a power cut is still announced.
Troubleshooting
- "The IP services disagree": your connection leaves through several addresses (load balancing, VPN). The address is kept until two services agree.
- "Behind a carrier-grade NAT": your operator shares one public address between several customers. A DNS name cannot reach your home; ask your operator for a full-stack (dedicated) IPv4, or use IPv6.
- Internet lost while it works: a firewall or an ad blocker may block the
three services (
api.ipify.org,ipv4.icanhazip.com,4.ident.me). - Duck DNS answered KO: the token or a sub-domain is wrong.
- Cloudflare: zone not found: check the name, or paste the Zone ID instead (some tokens cannot list zones).
- Logs: the integration's log level is set with the
LOG_LEVELvariable. The addresses and the tokens never appear in the logs.
Privacy
The IP services see the address of your home (that is what they echo back),
nothing else. Duck DNS and Cloudflare receive the addresses you ask them to
publish. The tokens are stored by Gladys as secrets and only sent to their
own service: Duck DNS in its update request, Cloudflare in the
Authorization header.
Konfigurationseinstellungen
Diese Einstellungen fragt Public IP in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Your public IP address in Gladys | section | Nein | Unofficial connector, not affiliated with ipify, icanhazip, ident.me, Duck DNS or Cloudflare. No account needed: the public address of your home is asked to three free IP services in turn, and a change is only believed once two of them agree. You get an "Internet" device (connected, IPv4, IPv6) to add from Discovery, the scene triggers "public IP changed", "Internet lost" and "Internet restored", two scene actions and a dashboard widget. Optionally, a Duck DNS or Cloudflare name follows the address (sections below). |
| Check interval (minutes) | number | Nein | How often the public address is checked. One small request per check; while the Internet looks down, every minute. |
| Failed checks before "Internet lost" | number | Nein | The Internet is declared lost when no IP service answers this many checks in a row. |
| Detect the public IPv6 too | boolean | Nein | Only works when the container has IPv6 (a Docker bridge usually has not: it is then reported calmly and probed every 30 minutes). |
| Duck DNS (optional) | section | Nein | Keep a name.duckdns.org pointed at your home. Fill the sub-domains and the token shown on duckdns.org once signed in; leave them empty to turn it off. The name is updated at start and whenever the address changes. |
| Duck DNS sub-domains | string | Nein | Separated by commas, with or without .duckdns.org. |
| Duck DNS token | secret | Nein | |
| Also send the IPv6 to Duck DNS (AAAA) | boolean | Nein | Off by default: an IPv6 name is only useful when your router lets incoming IPv6 through. |
| Cloudflare DNS (optional) | section | Nein | Keep A / AAAA records of a domain managed by Cloudflare pointed at your home. Create an API token from the "Edit zone DNS" template, limited to that zone. Only the address (content) of existing records is changed: their proxy status and TTL are kept, no record is ever created or deleted. Leave the fields empty to turn it off. |
| Cloudflare API token | secret | Nein | |
| Zone (domain name or Zone ID) | string | Nein | |
| Record names to update | string | Nein | Separated by commas: full names, a name relative to the zone, or @ for the zone itself. |
So installierst du Public IP in Gladys
- Öffne in Gladys Integrationen: Public IP erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-public-ip: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-public-ip.
Public IP 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
Public IP 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