Playstation 4/PS4 custom component

Tags: #<Tag:0x00007f739bc14600>

This is really cool. It works quite well, but I don’t see any media images. Where do these come from? I see that there is a json file woth all games, but it does not contain any links to image URLs or similar.
What do I have to do to add the media images?

As you can read in the documentation on the images are mapped using this site so you can add any games that are missing

Ok, I now see this. However, I strongly recommend to change the code. As it is right now requests the image from your(?) web site every time the frontend is displayed. That is s serious privacy problem as it means the web site will track all users and what they are doing when with their PS4.
You should at least store the retrieved URLs locally (e.g. in the JSON file that is already there) and use the web service only if there is no image URL known.

This is what i was thinking about the last 2 days. To store them into the json file is a good idea. So that mean less request to the site and more privacy for the users :thumbsup: .

1 Like

Yes the image stuff is not a good solution at the moment, I thought about changing it so it’s just a static json file in a github project and then download the file if it’s been updated and do lookups in that

then there would be no need for anyone to do server setups, and anyone would be able to either have their own version or do pull requests

I changed the image handling to a github project and get the data then setting up the platform, so there is no information leak, and the speed should be better as well because all maps are in memory.

If games are missing just create a pull request

I also added a config option if you want to point to your own mapping file


Before i get started, i noticed you don’t !include the custom_component/media_player directory.

Does this dir get included automatically then?


Yes, for more info see

Literally just saw that. Cheers mate should have looked first

Hi mate

Iv got your component all working now. I installed ps4-waker with sudo in root so needed to adjust cmd in your script to include sudo before everything. I also removed the ports/host/credentials etc as they were preventing mine from working - prob as the directory was wrong:

cmd = ‘ps4-waker -c ’ + self._credentials +
’ -d ’ + self._host +
’ -t 5000’ + bind_port +
’ ’ +

cmd = 'sudo ps4-waker ’ +
’ ’ +

It all works now.

Im just trying to get the images to show, this is my config:

  • platform: ps4
    games_filename: ‘games.json’

games.json is in the same directory as my credentials.json file.

I added my games to games.json:

{ "CUSA00127": "", "CUSA00219": "", "CUSA00411": "", "CUSA01116": "", "CUSA01262": "$Icon$", "CUSA01433": "", "CUSA01692": "", "CUSA01703": "", "CUSA01780": "", "CUSA02369": "", "CUSA02387": "", "CUSA02491": "", "CUSA02819": "", "CUSA02993": "", "CUSA03214": "", "CUSA04013": "$Icon$", "CUSA04294": "$Icon$", "CUSA05282": "", "CUSA05486": "", "CUSA06118": "" **"CUSA02821": "$MediaCarousel_Original$"** }

But nothing is showing still.

Do you know where i’ve gone wrong at all?

Thanks again for the component - works great

you are mixing stuff up, so I updated the component to support running ps4-waker in sudo and added more detailed documentation to to clarify the games file and how image mapping works so I would recommend reading the new version

there also seems to be an error in ps4-waker 1.2.0 so you should run 1.1.1 until I have had time to investigate what the problem is and report it.

Thanks I’ll give it a go in a bit.

I’m still not clear where the game thumbnail comes from. I noticed your code references the github repository. Does it get the cusa and the artwork from your games.json there?

New code still doesn’t work with all that bind port, credentials stuff. Do you even need it? Works for e without it…

There’s also a rogue line of code right at end of the new script - line 314 I think.

I think I’ll just stick with my amended one for now

@hmn Here is already a… “Database” even with pictures:

well it’s VERY limited, and almost no new titles exist on it, and a very low number of records have pictures.

there also is a lot of extra info on the list that is unnecessary so getting the list would take longer, and it would have to be parsed because the current format seems a bit messy, unless anyone knows how to get the content in a better format

Just saying, that there already is a database. By contributing to the wiki, it would also help this component.

True, but the format is pretty fucked up from a programmatic perspective, but I guess I can try looking into what possibilities there are for getting the table in something that could be used in the component

Can’t you just reference a local json file containing your own game titles and images n use that?

Hi and thanks for the awesome component! I’ve been using it for a couple of days now but then today it just stopped working. Then I remembered that I changed my ps4 connection from wireless to wired yesterday and checked if it had changed the local ip for my ps4 but it was the same. But I changed back to wireless just to see if that was the problem and sure enough it started to work again. Could anyone explain why this is? As I said the ps4 still has the same ip adress. Maybe I’m being a bit lazy because if I reinstall ps4-waker and the component it would probably fix itself but I thought if I could just make some minor adjustments to get it working on the wired connection to that would be great.
Any help would be greatly appreciated!

I’d like to know this as well, I tinkered with the code a little and replaced the imagemap URL with my own file but it didnt like it. It looks like it is looking for a URL?