Playstation 4/PS4 custom component

Let me know if you get the image to work. I have put it aside after wasting what feels like 100hrs on trying to get it to work.

Take a look at this. But this use a html file to see what img put for each game, but it dosen’t have the last game in it and i don’t know how to update it. It work with ex. youtube and cod 4 but not with GoW.

1 Like

So- two things…

  1. …I see that there was a PR to make this a default component… should I just wait until this happens before trying to add my PS4 to my HA?

  2. …if the answer to the above ‘should I wait’ is ‘no’, would anyone care to link or write up a quick ‘dummies guide’ for the installation and configuration… the github instructions say ‘pip install…’ but thats where I get lost. As this is a working HA install I’m a bit hesitant to rely on my normal ‘google it’ method and do the whole ‘experiment while I learn’ gig…

There is a new PR awaiting review.

I already have the custom component installed, but for some reason it won’t let me control my ps4 from time to time. But It still shows me my launched games.
I’m planning to move to HassOS from Hass.io on Raspbian, but I will do so only when the ps4 component is official.
So, to answer your first question, I would recommend you to wait for the official component. It doesn’t look like it will take long to include it to the official branch.

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?