FunkeyFlo / ps5-mqtt

Integrate your PlayStation 5 with Home Assistant
MIT License
312 stars 33 forks source link

PS5 suddenly become unavailable #409

Open Osher-Levy opened 1 month ago

Osher-Levy commented 1 month ago

Description of the issue

Suddenly my PS5 become unavailable. I tried to reconnect it from the add-on but it doesnt work. On the logs of the addo-on I can see it have an issue with the .json file, but I can't tell what the problem exactlly.

Addon version

1.3.3

Platform

Core: 2024.5.4 Supervisor: 2024.05.1 Operating System: 12.3 Frontend: 20240501.1

Logs of the issue (if applicable)

2024-05-20T15:25:29.605Z @ha:ps5:error SyntaxError: Unexpected end of JSON input at JSON.parse () 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-20T15:25:29.607Z @ha:ps5:mqtt MQTT Message received ps5-mqtt/00U3893DLS92

RobertD502 commented 2 weeks ago

This is addressed in the documentation

Can devices be powered on/off from/to other modes than rest mode? No. The underlying remote play protocol from sony does not support this.

You will see this error in your log when your PS5 is completely powered off (not in rest mode) or unreachable on your network. In particular, this line of code is where the error originates from. When your PS5 is completely off/unreachable, stdout is empty and results in the error since you can't parse it. Since it relies on Sony's remote play protocol, it is seeing the same thing that you would see, when your PS5 is completely off, if you attempted to control your PS5 through the remote play app - you wouldn't be able to as it would be unavailable.

The only other time you may see this error, from my testing, is when using the switch entity to send your PS5 into rest mode - it occurs once and then resumes working as normal.

xhemp commented 2 days ago

@Osher-Levy I had the same issue, what fixed for me was going to settings, system, power saving, features available in rest mode and set stay connnected to the internet and enable turning on ps5 from network on.