PS5-MQTT: Control PlayStation 5 devices using MQTT

have some errors when i try to start the addon

` Logger: homeassistant.components.hassio
Bron: components/hassio/websocket_api.py:135
integratie: Home Assistant Supervisor ([documentatie](https://www.home-assistant.io/integrations/hassio), [problemen](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+hassio%22))
Eerst voorgekomen: 23:57:14 (1 gebeurtenissen)
Laatst gelogd: 23:57:14

Failed to to call /addons/df2164f9_ps5_mqtt/stats - Container addon_df2164f9_ps5_mqtt is not running`

Fixed it, had to make sure that Remote Play is turned on. Didn’t see that written anywhere on the GitHub repo but setting it to on fixed the issue.

And also:

Hi!

Great addon!

I’ve scoured this thread and not seen it asked or answered succinctly; is it possible to capture achievements/trophies from my PS5 using this addon?

Thanks!

Hi All,

I’m currently migrating my Smart Home onto HA and slowly getting the various Integrations configured and working. However I’m struggling to get this working.

Using the default configuration I can start to Add-on but as soon as I open the web ui, I get “The add-on is not running. Do you want to Start it now?” When I click on START ADD-ON, I get another message asking me retry. In addition in the back ground I have the message “502: Bad Gateway”

Can anyone assist me with getting this working?

Thanks,

Garry

Hi,

I am strugling with the authentication. Every time I try to authenticate through the web ui, I receive the same message: “the connection to the server timed out” I tried through different pcs, browsers and even an android phone. Always the same message. Is the url broken? Is there any way of getting to the redirected URL (some workaround)?

Thanks for your help

Thank you! I am very happy with the result.
Schermafbeelding 2024-05-28 225102

2 Likes

Hi,

Since some time this error appears on and on again and add on stops reporting the playing states:

2024-05-29T10:02:20.899Z @ha:ps5:error SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /app/server/dist/redux/sagas/check-devices-state.js:78:38
    at step (/app/server/dist/redux/sagas/check-devices-state.js:35:23)
    at Object.next (/app/server/dist/redux/sagas/check-devices-state.js:16:53)
    at next (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1161:27)
    at currCb (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1255:7)
    at runSelectEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:735:5)
    at runEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1208:7)
    at digestEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1275:5)
    at next (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1165:9)
2024-05-29T10:02:20.904Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/5C9666DDD1C3
2024-05-29T10:02:40.935Z @ha:ps5:error SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /app/server/dist/redux/sagas/check-devices-state.js:78:38
    at step (/app/server/dist/redux/sagas/check-devices-state.js:35:23)
    at Object.next (/app/server/dist/redux/sagas/check-devices-state.js:16:53)
    at next (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1161:27)
    at currCb (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1255:7)
    at runSelectEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:735:5)
    at runEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1208:7)
    at digestEffect (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1275:5)
    at next (/app/node_modules/@redux-saga/core/dist/redux-saga-core.dev.cjs.js:1165:9)
2024-05-29T10:02:40.939Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/5C9666DDD1C

I know, that in some posts before it is said, that this will recover but it does not! I must restart the add on and than everything works again. I haven’t change a thing in my setting so what is wrong? Can anyone help?

thx,
Zavjah

Hi,
Can I ask you how did you manage to do it for the whole button pls?

I use Measure It integration MeasureIt: Measure all you need based on time and templates!

I’m having the same problem as you. Can’t get past the “The connection to the server timed out”

Hello,

Here is my configuration :slight_smile:

I’ve nothing in the web UI :

I miss something ?

OK find… My PS5 was in sleep mode…

By following this post:

I’ve been fighting with the same issue for some time. What helped me:

  1. Incognito window
  2. In one tab - log in to store first. If an error remains on this step - don’t close this tab, give it some time & retry.
  3. After logging into the store, follow the redirect link from the add-on pop-up in the same incognito window.

Is it also possible to read which color LED is on the PS5 controller?

I’m experiencing some problems with the sensor - after the last update on the ps5 it didn’t want to show when it was in a game - it only says idle or awake :melting_face:

1 Like

I have the same problem… tried to re-auth and still nothing…

I too am unable to reauthenicate.
The hyperlink provided is no longer valid, so the instructions are unable to be followed :frowning:

Good to know, I’ll try and get an update out somewhere this week! For future cases: feel free to create a GitHub issue for any bugs! :purple_heart:

2 Likes

Hi there,

I’ve set up PS5-MQTT with Home Assistant and most things are working great. However, I’ve noticed that the game title and game image are not being displayed, even though I’ve followed all the setup steps carefully. Here’s what I’ve done so far:

  1. Adjusted my PlayStation Network profile’s privacy settings to make game activity visible.
  2. Retrieved a valid NPSSO token and configured it in secrets.yaml.
  3. Authorized the integration using Remote Play with my PS5 (successfully connected and authenticated).
  4. Verified that MQTT messages are being sent and received (other device states like power status are working perfectly).

Despite all this, the game title and game image just don’t show up in Home Assistant.

sensor.ps5_512_activity:
power: AWAKE
device_status: online
activity: idle
friendly_name: PS5-512 activity

Starting PS5-MQTT...
2024-11-22T20:50:52.009Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/0C7043751C7E
2024-11-22T20:50:52.080Z @ha:ps5:webserver Server listening on PORT: 64605
2024-11-22T20:50:55.082Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/0C7043751C7E
2024-11-22T20:51:13.257Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/0C7043751C7E/set/power
2024-11-22T20:51:18.294Z @ha:ps5:turnOnDevice 
2024-11-22T20:51:18.311Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/0C7043751C7E
2024-11-22T20:51:28.281Z @ha:ps5:checkDevicesState Resume polling
2024-11-22T20:56:31.065Z @ha:ps5:checkDevicesState Update HA
2024-11-22T20:56:31.078Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/0C7043751C7E
Received 21:36:43
QoS: 0
Payload: power: AWAKE
device_status: online
activity: idle
Received 21:41:56
QoS: 0
Payload: power: STANDBY
device_status: online
activity: none
Received 21:42:30
QoS: 0
Payload: power: UNKNOWN
device_status: offline
activity: none
Received 21:42:37
QoS: 0
Payload: power: STANDBY
device_status: online
activity: none
Received 21:50:55
QoS: 0
Payload: power: STANDBY
device_status: online
activity: none

mqtt:
  host: XXX
  port: 1883           
  user: !secret mqtt_user
  pass: !secret mqtt_password

psn_accounts:
  - username: "USERNAME"
    npsso: !secret my_npsso
    preferred_ps5: "70C881D600B0" 

device_check_interval: 5000         
device_discovery_interval: 60000    
account_check_interval: 5000       

include_ps4_devices: false        
logger: @ha:ps5:*