Hey all — sharing a build I’m pretty happy with: my stock PS5 (no jailbreak) is now a first-class Home Assistant device, and HA tracks how much I play each game — and even compares that to how much I stream it on Twitch.
The two-integration pattern (you need both):
- PlayStation Network integration (core) → status only: online state, now-playing + cover art, PS Plus, trophies. It’s read-only (
supported_features: 0) — it can’t power anything on. - ps5-mqtt add-on (via Mosquitto + MQTT) → control:
switch.ps5_power(wake / rest) + an activity sensor. Discovered my console instantly; one-time Remote Play pairing (PSN login + the 8-digit code on the console).
Reliability note: remote wake only works from Rest Mode (the console keeps its network alive there) — a fully powered-off PS5 can’t be woken over the network. HA’s “turn off” sends it to rest, so it stays wakeable.
Per-game playtime (the fun part). HA can’t natively make a counter for a game it’s never seen, so I used pyscript: it watches the current-game sensor and tallies lifetime hours per game into durable sensors — any game auto-appears the first time I play it, free ones included. Rough shape:
# pyscript: tally lifetime hours per game, persisted to JSON@state_trigger("sensor.ps5_current_game")def on_game_change(value=None, old_value=None): now = time.time() if cur["game"] and cur["since"] and cur["game"] not in IGNORE: totals[cur["game"]] = totals.get(cur["game"], 0) + (now - cur["since"]) publish(cur["game"]); save() # -> sensor.game_hours_<slug> + JSON store cur["game"], cur["since"] = (value, now) if value not in IGNORE else (None, None)
Played vs streamed. A second pyscript samples my Twitch live-status (community Twitch integration) once a minute and buckets streamed time by the game Twitch reports, then a third merges both stores into one “Played | Streamed” table per game. Turns out I play way more than I stream — which is exactly the kind of thing I wanted to see.
Everything (playtime, app usage, listening history) stays local on the hub — that’s half the point.
Happy to share the full pyscript / configs if anyone wants them, and very open to ideas — especially cleaner ways to match a PS5 game title to the Twitch category (string matching gets me ~90% there). Anyone else automating their console?

