Skip to main content

UPnP Presence smart home integration, free and open source

UPnP Presence integration for Gladys Assistant

Know which UPnP devices are on (TV, console, NAS, speaker) from their SSDP answers, 100% local.

Know whether the UPnP devices of your network are on: TV, game console, NAS, media box, amplifier, speaker, printer. Gladys asks the network at a regular interval which UPnP devices are there (an SSDP search); a device that answers is on, a device that stops answering is shown off after a delay. No configuration per device, no IP address to type: a device is recognized by its UPnP identifier, even when its address changes.

Nothing is ever sent to your devices but this search and the reading of their description (their name and model): no command, no wake-up. A device in deep standby simply stops answering and shows off.

Tested on real UPnP devices (their announcements and descriptions), not yet with every brand of TV or console: feedback welcome on the community forum.

What you get​

  • One Gladys device per UPnP device you add, with three features:
    • Switched on (presence sensor): on / off, kept in history, usable in scene conditions;
    • IP address (text): the address of the last answer, it follows DHCP changes;
    • Last answer (text): local date and time of the last answer (refreshed every 10 minutes while the device is on, exactly when it goes off).
  • Two scene triggers: "A UPnP device is switched on" and "A UPnP device is switched off".
  • A scene action "Check a UPnP device now", to act on a fresh state.
  • A dashboard widget "UPnP devices" listing which devices are on.

Requirements​

  • Gladys 5.2.0 or later (the core searches the network for the integration: the integration runs in a sandboxed container that cannot reach the SSDP multicast by itself).
  • Devices on the same network (same subnet, same VLAN) as the Gladys host: SSDP does not cross routers.
  • The firewall of the Gladys host must let the SSDP answers in (UDP, sent by the devices to the port the search came from). With ufw, for example: sudo ufw allow from 192.168.1.0/24 proto udp (adapt the network). Without it, the search finds nothing.
  • Devices that speak UPnP: most smart TVs (Samsung, LG, Sony, Philips, Android TV), game consoles, NAS (Synology, QNAP), boxes and routers, Sonos, Denon/HEOS, Yamaha MusicCast amplifiers, network printers, media servers (Plex, Jellyfin, Kodi, minidlna).

Configuration​

Settings​

  • Search interval: how often Gladys asks the network (30 seconds to 5 minutes, default 1 minute).
  • Off after: time without an answer before a device is shown off. Automatic (default) follows the lifetime the device announces in its answers (CACHE-CONTROL max-age), bounded between 3 searches (a single lost answer never switches a device off) and 10 minutes (TVs and boxes announce 30 minutes, too slow to tell they were switched off). Or a fixed 2, 5, 10 or 30 minutes; a fixed delay never goes below two searches.
  • Language of names and messages: language of the feature names of the devices added from now on (Gladys keeps them once a device is added) and of the action messages. French by default.

Adding a device​

  1. Switch the device on.
  2. Open the Discover tab of the integration: every UPnP device that answered is listed, with its name and model as it announces them. Refresh the tab to search again.
  3. Add the devices you want to follow, and rename them if you like.

The Search the network now action of the configuration screen lists the devices that answer, and refreshes the Discover tab.

A device with several network services (an amplifier with a media renderer and a media server) is one device: the integration follows the UPnP root device.

Devices​

FeatureTypeValues
Switched onPresence sensor1 = on, 0 = off
IP addressTexte.g. 192.168.1.20
Last answerTexte.g. 2026-12-02 21:47

The states are pushed by the integration itself, at the search interval (the devices are published without Gladys polling). Only the changes are sent, plus a repeat every 12 hours so that a device on for days keeps a recent value. Right after a restart of the integration, a device that does not answer is shown off only after a whole delay.

Dashboard widget​

UPnP devices: one line per device, "On · IP address" in green or "Off · seen date" in red, with the name you gave in Gladys. Settings: the devices to show (all by default, 10 at most) and whether to show the address and last answer.

Scene triggers​

  • A UPnP device is switched on: a device you follow answers again after being off.
  • A UPnP device is switched off: a device stopped answering for the "Off after" delay.

Both can be limited to one device. Variables: device name, IP address, and the minutes the device spent in its previous state (empty right after a restart). No event is sent when the state was unknown (first search after a restart).

Scene action​

Check a UPnP device now searches the network at once (or reuses a search of the last 10 seconds) and returns, for a following "Continue only if":

  • On (1 = yes, 0 = no): the state after this search;
  • Answered this search (1 / 0): the device answered right now ("On" follows the "Off after" delay: a device that just missed one search still counts as on);
  • IP address and Seconds since the last answer.

The action fails (in red) for a device that is not a UPnP device of the integration, and when Gladys cannot search.

Scene examples​

  • When the TV is switched on after 18:00, dim the living room lights.
  • When the game console is switched off, switch its smart plug off 10 minutes later.
  • Before sending a notification to the TV, check it is on with "Check a UPnP device now".

Troubleshooting​

  • The Discover tab stays empty / "No UPnP device answered": the firewall of the Gladys host drops the SSDP answers (see Requirements), or the devices are on another subnet or VLAN. Check from the host with gssdp-discover or a UPnP tool.
  • "Gladys cannot search the network": Gladys is older than 5.2.0; update it.
  • A device blinks off and on: it misses some searches (busy Wi-Fi, power saving). Choose a longer "Off after" delay.
  • A device stays on in standby: many TVs and boxes keep their network on in standby and keep answering; there is nothing to tell them apart. Prefer a smart plug measuring the power, or the device's own integration.
  • A device stays off while on: it does not answer SSDP searches (some only announce themselves) or its UPnP / DLNA / "screen sharing" option is disabled in its settings.

Limits​

  • Presence means "answers UPnP searches": a device can be on without UPnP (option disabled) or answer in standby.
  • The ssdp:alive and ssdp:byebye announcements never reach the sandboxed container: switching off is seen at the next unanswered searches, not instantly.
  • IPv4 only. Not for the UPnP IGD box control (port mappings, traffic): see the UPnP IGD integration.

Not affiliated with the Open Connectivity Foundation (UPnP Forum) nor with any device brand.

Configuration settings​

These are the settings UPnP Presence asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your UPnP devicessectionNoGladys searches the network for UPnP devices: open the Discover tab and add the ones to follow, while they are on. A device is shown off when it stops answering. Nothing is ever sent to the devices but the search.
Search intervalselectNoHow often Gladys asks the network which UPnP devices are there.
Off afterselectNoTime without an answer before a device is shown off. Automatic: the lifetime the device announces, between 3 searches and 10 minutes.
Language of names and messagesselectNoNames of the features of the devices added from now on (Gladys keeps them once a device is added), and messages of the actions.

How to install UPnP Presence in Gladys​

  1. In Gladys, open Integrations: UPnP Presence appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-upnp-availability:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-upnp-availability.

UPnP Presence requires Gladys >=5.2.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

UPnP Presence is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂