PS5-MQTT: Control PlayStation 5 devices using MQTT

@QNimbus The addon was still using host names instead of ip addresses when checking for device state. I just changed this and a new edge version should be done in a bit. :kissing_heart:

Hi,
When I start the add on, it looks like it shuts itself down within 10-15 seconds. I get a 502: bad gateway notification when I open the web ui. Does anyone how to solve this?

This message means there is no MQTT broker service available. Install one of you havenā€™t done so already.

I got stuck when trying to run it on Docker. MQTT broker installed and configured.
Container seems to be running. Web UI discovers my PS5 and I can authenticate it. But thenā€¦ Nothing happens. Nothing new under Devices in HA.

Some logs from container:

Starting PS5-MQTT...
2022-11-22T13:54:55.366Z @ha:ps5:error config could not be read from 'undefined'
2022-11-22T13:54:57.253Z @ha:ps5:error FetchError: request to https://m.np.playstation.net/api/userProfile/v1/internal/users/2950236614441498611/basicPresences?type=primary failed, reason: getaddrinfo ENOTFOUND m.np.playstation.net
    at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:527:28)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-11-22T13:54:57.269Z @ha:ps5:webserver Server listening on PORT: 8645

Thanks for any help.

Without docker config itā€™ll be hard to help. :upside_down_face:

Also; what version are you using? The https://m.np.playstation.net was changed quite a while back to https://m.np.playstation.com. Make sure youā€™re running the latest version.

Actually, You helped a lot :wink:
I just copypasted image url for docker-compose from documentation page (version 1.1.0) :rofl:
Changed to 1.2.2 and now it works perfectly.

1 Like

Can you use this to control a remote with scripts? Like click this script and it will go left, left, left, select!

:warning: :warning: :warning: VERY important to use 2 different browsers / sessions for retrieving the NPSSOā€™s if your using multiple PS5ā€™s! :warning: :warning: :warning:

Amazing little add-on, thanks for creating it! :+1:

I have to admit the configuration part was confusing due to me not being able to spot the configuration tab on the add on itself lol, was searching for configuration files etc using old manual and wasted some time, maybe you could make it more clear in the setup documentation.

BTW Itā€™s pity Sony doesnā€™t publish the activity for multimedia like Netflix, was hoping to set up some automations based on that :slightly_frowning_face:

Thanks! <3

I donā€™t quite follow, what ā€œold manualā€ are you referring to?

iv noticed sony keeps blocking my account password.
any one else experiencing this?
at leat once a week since using this my password is being asked to be reset.

Yeah. Same issue for me.

Same here. Have to change password once a week now. Received a blocked warning this morning on my sons account.

I have the same issue ā€¦ changed it about three time by now

Iā€™ll try to change the update Intervalls ā€¦ Iā€™ll keep you posted

1 Like

@Killa-V, @arczowsky Iā€™ve only experienced it once since adding the feature a couple of months ago. Did you lower the recommended account_check_interval by any chance?

If the issues persists Iā€™d recommended increasing the interval and see if this (at least) lowers the frequency of the password reset. If it does; try going higher with the interval until it completely removes the issue.

I didnā€™t changed interval.
I will try to increase it tomorrow and weā€™ll see.

Iā€™ve changed it to 15000ms (15 secs). As Iā€™m tracking two accounts, It might be a reason of the blocking or is the API limit per account?

I setup Mosquitto Broker and itā€™s running (created a new user for it to run too) and I also installed the addon on but when I click on ā€œlaunch web UIā€, it doesnā€™t show my Playstation 5. I donā€™t need to specify my username and password in the config if Iā€™m just using remote play right?

@Theloneranger08, what does your config look like?
Is MQTT Auto Discovery enabled?

@sammyke007 I have two wireless networks right now (going to call to have the other one disabled this week). One from the modem and one from the mesh system I have. My HA box couldnā€™t see my PS5 because the PS5 is hard wired (although not sure how that works with ethernet). I connected my PS5 to WIFI and now the MQTT server can see it. However, when I select the power toggle, nothing happens. For now I donā€™t need to see whatā€™s playing but Iā€™d like the ability to turn it on and off because my Harmony remote canā€™t do that. Hereā€™s my config.

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