External integration - PlayStation Network

Hello everyone,

I present to you a new external integration for Gladys: PlayStation Network.

It allows you to see in Gladys who is playing on PlayStation, which game, and for how long today. It also tracks your trophies and indicates whether your PS4 or PS5 is on, in standby, or off.

What it does

Devices

  • Your PSN account: online, in game, current game, platform, current session, playtime today, trophy level, and number of trophies (platinum, gold, silver, bronze)
  • Up to 10 followed friends: online, current game, playtime
  • Your PS4/PS5 consoles: on or off (standby/off)

Local and cloud

  • PSN data is read from the cloud.
  • Consoles are read on the local network (PlayStation discovery protocol). Without the local network, their status follows your PSN presence.
  • The « Prefer local connection » button chooses the channel. The device badge displays local or cloud, with an orange dot when the integration uses the backup channel.

Scenes (Gladys 5.1 and later)

  • Triggers: « A game has started », « A game has stopped » (with session duration), « A trophy has been earned » (filter by category)
  • Actions: « Read a player’s status », « Read a console’s state »
  • The features also work with Gladys’s classic triggers. Example of parental control: when « Played today » of my son’s account exceeds 120 minutes, send me a message.

Dashboard widget

Playtime today, current session, trophies, who is playing what (with the game icon), console status, and a « Refresh » button.

Languages: French, English, German, and Spanish.

Installation

  1. You need Gladys 5.1 at minimum.
  2. Install the PlayStation Network integration from the integrations store.
  3. Retrieve your NPSSO token:
  4. Paste the token in the Configuration tab, click Test connection, then add devices from the Discovery tab.
  5. For consoles: in the console’s power-saving settings, enable « Stay connected to the Internet » and « Enable power-on from the network ». Then click Find my consoles.

The complete documentation is accessible from the Documentation link on the configuration screen.

Good to know

  • The integration is not official. Sony does not offer a public API: it reads the same data as the PlayStation app and may stop working if Sony changes them.
  • The NPSSO token gives access to your account: keep it secret. Gladys stores it in a secret field, and the integration never writes it to disk or in the logs. It lasts about two months; the integration will notify you when you need to renew it.
  • The integration only reads: it cannot turn on a console, send a message, or make a purchase.
  • The PSN is read every 2 minutes by default (minimum 1 minute), as Sony limits the number of requests.

Your feedback

This is a first version: your feedback, ideas, and bug reports are welcome, here or on GitHub.

Source code and bug tracking: GitHub - prohand/gladys-playstationnetwork: Gladys external integration to connect playstation networks in Gladys · GitHub

Happy gaming!