Playstation 4/PS4 custom component

I can do that. Thanks.

Been tinkering with HA for the last year (really, just a vanity set-up with a couple non-essential lights (I’ve been collecting hardware)) and only recently decided to go at it a little harder and build… anyway… point is… plenty other stuff I can move on to, just didnt know how quickly things tend to get adopted… me being relatively new and all.

Hi everyone!

Great component ! I love it !
Quick question : has anyone succeeded to display the game image with the custom mini-media-player card (Lovelace: Mini Media Player) ? I use local images in the www/games folder.
It works in the state UI view (the standard media player card is used) but not with lovelace UI view (mini-media-player cards are used there). See screenshot below:


Thanks for your help!

EDIT / SOLVED : replace the ps4.py python file by Abdel’s : https://github.com/abdel-elbel/homeassistant-config/blob/master/custom_components/media_player/ps4.py

1 Like

Thank you ! I spent hours trying to figure out what was wrong with my config until I find your post.

1 Like

I tried using the html file but quickly moved to the “www/games” folder solution… that html is outdated…
You have to download each image as a .jpg and name using the app code like my screen shot ! image|282x137
Good luck :wink:

Sorry @Wheezy I know this is an older topic but I am running a clean 86.1 and now .3 actually install.

I got root access (#) and ran the docker ps
I get the vkorn/aarch64-ps4waker instead because I am running on newer b+ PI I guess
I connect to the image via
docker exec -it “container ID” /bin/bash
I get another # prompt
I then try to run the install…
npm install -g ps4-waker
It sits for a second then returns…

Error: could not get uid/gid
[ ‘nobody’, 0]

What am I maybe missing here…

Everyone

For future reference:
You MUST USE THE 32bit version of HASS.IO - I was using the X64 and that doesn’t work at all…
Once I installed HASS.IO 32bit @Wheezy instructions worked perfectly…

Try to run this command first:

npm config set unsafe-perm true

After that run this command:

npm install -g ps4-waker

I have added the following section to my configuration:

local_store: games

and created a games.json file in the /config of hassio.
I have made a copy of the raw content of this one: https://github.com/hmn/ps4-imagemap

For the game the entry was missing in the games.json file, so I have added this:

"CUSA01788": "https://gamegator.net/thumbnails/TCRSS-PC-big.jpg",

My ps4-games.json file looks like this:

{
    "CUSA01262": "Tom Clancy's The Division\u2122", 
    "CUSA01788": "Tom Clancy's Rainbow Six\u00ae Siege"
}

Somehow it does not show any picture (or icon) and it remains blank.

What I am doing wrong?
Thanks!

1 Like

If I’m not wrong, this line means the games covers are stored locally, in www/games folder. Try saving a cover under the name CUSA01788.jpg and check if it appears in the ps4 component.

If it does not work, take a look at Abdel’s post: Playstation 4/PS4 custom component - #242 by abdel.elbel. The original ps4.py component seems buggy and covers usually do not show up

editing ps4.py from Abdel is leading to “No state available for media_player.playstation4” for me

Makes sense, thanks! Will give it a try.

Besides the local store, I would expect that it should gather images from an online json file at: https://github.com/hmn/ps4-imagemap/raw/master/games.json

However, it does not contains all the games, that’s why I was thinking about local_store

Theoretically, if you want to use a json file that links game ID to a game cover, you must use this option: imagemap_json. Check again the wiki of the PS4 component. Default is supposed to be https://github.com/hmn/ps4-imagemap/raw/master/games.json.
However, if you look at the python code, there is no reference to the imagemap_json option. That’s why I think HMN’s component is buggy and using Abdel’s ps4.py file with local game images solved the problem in my case. But I agree, an online json file would be much better !

1 Like

Thanks to your guidance it works almost now:

  • created a www/games folder
  • added .jpg per game based on the code

It is shown in as icon:

image

The full media control card still does not show an image

image

Thanks!

I was at the same stage one week ago. I could see a small round icon, but there was no cover on the full media card.
Next step is to try using this modified ps4.py component : https://github.com/abdel-elbel/homeassistant-config/blob/master/custom_components/media_player/ps4.py (that solved the issue in my case)

1 Like

You are right again :wink: Thanks! Seems to work now:

image

As of today my Hassio log is full with these messages, all day long and every minute:

image

The playstation shows idle:

image

Anybody an idea what’s going on?

Somehow I was able to resolve this by going to the configuration in docker again, a reboot of hassio and now it seems to work again. Not sure why it was broken.

Have you managed how to get rid of this error?
I have it too.

**Official PS4 Pull request: https://github.com/home-assistant/home-assistant/pull/20007
Native PlayStation 4 Component Discussion

Hi sholofly,

Have you been able to fix this issue? I have the component running just fine. Just struggling with the artwork, like you. Greetz, Roland.