PS5-MQTT: Control PlayStation 5 devices using MQTT

Update: I switched the auth to use the npsso token and now I’m able to turn my console on and off but it doesn’t show which game I’m playing, just “idle”. I was playing a PS4 game though. Not sure if that matters.

Hey guys,

Sony unfortunately changed the way NPSSO tokens can be used to acquire access tokens for using PSN api’s. Until further notice activity tracking will be unavailable.
Turning the ps5 (and 4) on/off will still work.

You can follow along with this github issue to see when, or if, the issue is resolved.

1 Like

Bummer but thanks for the heads up and all of your work on this!

Thanks <3

Btw; the web-ui is only used for authentication required for turning the ps5/4 on or off. The NPSSO is only needed for account activity tracking, which as you know, currently doesn’t work.

1 Like

I unfortunately couldn’t get my PS5 to turn on or off without using the npsso token. The PSN account attribute should be null just for remote play right?

No it should be an empty array: [] (yaml), the addon configuration editor unfortunately isn’t that great.

This is what my config looks like:

mqtt: {}
logger: "@ha:ps5:*"
device_check_interval: 5000
device_discovery_interval: 60000
account_check_interval: 15000
include_ps4_devices: true
psn_accounts: []
1 Like

Ah yeah that’s what I meant, an empty array which isn’t null haha. I’ll try that config again though! Are you supposed to go through the same linking process despite the two different APIs? I.e. getting the auth URL and then entering the code.

You only have to follow the steps described in the web-ui popup to authenticate a device. You will have to repeat this process for each device.

This page right? I just want to confirm it’s the same page.

Yes. That is correct.

v1.3.1 fixes the issue, let’s hope Sony doesn’t mess with this stuff for a while… :joy:

1 Like

I got it working, thank you!

1 Like

In case anyone wants the code for my dynamic PS5 Now Playing card! Instead of name: Playstation 5 Game Being Played you can also do entity_id: sensor.ps5_799_activity.

type: custom:auto-entities
card:
  type: grid
  columns: 1
  square: false
  title: Now Playing (PS5)
card_param: cards
filter:
  include:
    - name: Playstation 5 Game Being Played
      state: playing
      options:
        type: custom:mushroom-template-card
        primary: PlayStation 5
        secondary: >
          {{ state_attr('sensor.ps5_799_activity', 'title_name') or
          states('sensor.ps5_799_activity')}}
        icon: mdi:sony-playstation
        entity: switch.ps5_power
        picture: '{{state_attr(''sensor.ps5_799_activity'', ''title_image'')}}'
  exclude: []
show_empty: false

5 Likes

I can’t seem to get mine to successfully link. I have put in the redirected URL and remote play code a number of times now. Once I authenticate, the code disappears on the PS5 but the add-on doesn’t seem to authenticate.

Ive rebooted HA a few times as well as the PS5 to no avail

1 Like

How do you know the authentication failed?

I tried to copy this in my HA instance but it’s not usable, the format is misformed it seems.

Do you have auto-entities and mushroom cards installed? Beyond that, I’d just check to make sure the indentation pasted properly.

Hello guys, any idea what is this error about? this happens when i try to start the addon.

Can’t create container from addon_df2164f9_ps5_mqtt: 500 Server Error for http+docker://localhost/v1.41/containers/create?name=addon_df2164f9_ps5_mqtt: Internal Server Error (“error creating overlay mount to /var/lib/docker/overlay2/8b596e515988ad533bae95b034a26efcbd85647a2fab33e920afb0e700f8b260-init/merged: too many levels of symbolic links”)

thanks!

Are you running the addon in Home Assistant OS or in docker?

If you’re running the addon in docker: please read and follow the full documentation located in the repository.

If you’re running the addon in HA OS; please share your config.

yes i am following this instructions, is the docker version:

i am missing something?
thanks for reply