Native PlayStation 4 Component Discussion

Can you post the output of

cd /use/bin
ls -al | grep python

bummer mate. Not sure what else to try. Iā€™ve literally tried everything that points to python. This one finally worked for me. Maybe the path is slightly different from you. Iā€™ve seen some setups use /srv/hass/bin. Maybe explore /srv/ and see whatā€™s there and where you end up.

Interestingly enough this works in WSL Debian Buster running Python 3.7 with HA in a venvā€¦

Do you guys have nginx set up too?

No I donā€™t.

Ran through the setup again with WSL Debian, the port bind seems to work but the config always fails:

image

Busted out an old Pi and completed a venv install using python 3.5 instead. The integration ā€œworksā€ after setcap command run but again the component fails to register:

image
image

Iā€™m also getting the fail message,
But on the PS4 (as well as on the PS4 app) the HomeAssistant is shown and paired.

What can I check?

I have Hassio under docker and was activated with --net=host .

Do I need any open port on the router (I hope not)?

Thanks

No ports need to be opened, this is entirely local.

setcap 'cap_net_bind_service=+ep' /usr/local/bin/python3.7

This was the command that finally worked for me on python 3.7.2. Now to work out why the pin isnā€™t being acceptedā€¦

More logs: looks like thereā€™s a problem with the credentials?

2019-03-07 17:04:29 DEBUG (SyncWorker_11) [pyps4_homeassistant.helpers] Searching for PS4 Devices
2019-03-07 17:04:29 DEBUG (SyncWorker_11) [pyps4_homeassistant.helpers] Found PS4 at: 10.0.0.210
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] Connect
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] TX: 28 b'1c0000007063636f0000020000000000000000000000000000000000'
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] RX: 36 b'240000007063636f0000020000000000010000004c1e7badaf9cc5526d1cb8cedacce6e3'
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] key b'c24bc2872e97ed9c1394f48fcfb6d7cb432f22ba42e1af75a5837d37cf6dcaf913dda5940931e30402d3230948e7a0451401ebfbc11f95f2189fad05517a044cdc3a144bd80d3d3373cf45342fe1$
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] TX: 280 b'1801000020000000c24bc2872e97ed9c1394f48fcfb6d7cb432f22ba42e1af75a5837d37cf6dcaf913dda5940931e30402d3230948e7a0451401ebfbc11f95f2189fad05517a044cdc3a144b$
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] Login
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] config {'app_label': b'PlayStation\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] TX: 384 b'800100001e0000000000000001020000646330653166353466633538303435653736636163633737373838336435613662613731626235313265326464373761393164326438383535333336$
2019-03-07 17:04:29 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] TX(cypted): 384 b'8b8c6b13c3325310a9d3e7e6043221fa736818ae22ce33a138421e33fc8a9918893c1162d225f5b61be176001bc664891158157c0a82072d9bb4411a26b61c16ed8feca7f9b7823f$
2019-03-07 17:04:30 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] RX: 16 b'6ec4b30a3e7e8d2347f83325c416502c'
2019-03-07 17:04:30 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] RX: 16 b'10000000070000001700000000000000'
2019-03-07 17:04:30 DEBUG (SyncWorker_4) [pyps4_homeassistant.connection] Login Failed

Iā€™ve just setup the component and it seems to work very well! It looks like the PS4 Waker also supports login on the PS4 with a pincode (I like the extra security). Are you also going to add support for that?
Is there a way to request images for games? I would love to make something in Lovelace which shows all the cover arts of the games.
And what do I need to start a game? I saw that if I select a game in the source that it will start, but what if itā€™s not in the list yet. Is there a way to start the game?

@Ktnrg45 thanks for the awesome component!

Very nice. But how do i activate cover, change game, etc.

@Uppling I use the mini media player to show the artwork and you can select a source to start a game, but it only shows games that youā€™ve started.

1 Like

Native PS4 media player component working very nicely! The only hiccup I had was an error that the PIN was incorrect, but that seems like it was because I had a space similar to how it was displayed on-screen.

I made an automation to send a media_player.turn_on command whenever I start my PS4 Harmony activity, so itā€™s finally automated. Very happy about that. Also added a few buttons and some time tracking stuff as conditional lovelace cards.

1 Like

Nice! can you share your buttons config? Thanks!

Sure.

Lovelace UI part - https://pastebin.com/SAhwWXeR
PS4.yaml package (time tracking + automations) - https://pastebin.com/NnqFvTWE

It uses two custom cards, mini-media-player (https://github.com/kalkih/mini-media-player) and custom button card (https://github.com/custom-cards/button-card).

5 Likes

@anon12983141 Theres a post below which describes the probable cause of the pin issue. @SeanM. PIN is 8 digits no spaces. Ill add errors and docs for this.

Have you tried configuring yet? OSX might not need extra configuration.

@Ktnrg45 Perhaps instead of showing an error that PIN code canā€™t contain space, maybe the setup flow could just automatically strip out a space? Just a suggestion to make it a little more user friendly.

Aside from that I think itā€™d be helpful to display a link to the docs page on the setup screen. Itā€™s pretty straightforward with the exception of the region dropdown.

Lastly, was also wondering could you think about displaying a generic fallback image if thereā€™s no cover available? For example when browsing the XMB/Store or any apps it doesnā€™t have a cover (or media title) and seems to report the ps4 media player in an ā€œidleā€ state. It seems not every game has a cover either (inFAMOUS First Light is one I noticed). Here is a mockup of what I mean: https://i.imgur.com/00v8EXQ.png

Thanks a ton for this component, itā€™s amazing.

I had an issue when entering the PIN code too. I typed in the numbers without any spaces, and ā€œAn unknown error occurredā€ message appeared. Tried typing in PIN code with a space, got the correct error message, then tried again without a space, and it magically worked. I used the same PIN code since I first received the error. I donā€™t have any logs to share for debugging unfortunately.

The component works great, but Iā€™m still wondering why cover art for certain games donā€™t show up. I tested two games I downloaded from PSN: Wipeout Fusion Collection and Titanfall 2 ā€“ art didnā€™t show. Cover art did show up for a disc-based game I have, Ace Combat 7. If cover art is using a DB that needs to be manually, Iā€™d be happy to add some entries.

So a cover for when state is idle? Ill look into that.

Hi, The component seems to work great for me, but I have a second ps4 (my sons) that I would like to monitor on top of mine, how do you add a second ps4?

Cheers