-
Notifications
You must be signed in to change notification settings - Fork 24
media_player_ps4
ps4.py is a custom media_player component for home assistant, that uses the tool ps4-waker to communicate with your PS4
Because it uses the ps4-waker tool witch is nodejs and not python it has not been committed to the main repository.
The module requires you to have ps4-waker running already
- Install nodejs
- Install ps4-waker
- Download the Playstation app so you can setup a remote device
- Start the pairing process ps4-waker -c .ps4-wake.credentials.json -d 10.0.0.4
- Save credentials file in the config dir, default location is .ps4-wake.credentials.json in the config dir
- Test that ps4-waker -c .ps4-wake.credentials.json -d 10.0.0.4 search works
This docker images has node and ps4-waker installed https://hub.docker.com/r/hnicolaisen/home-assistant
To use the ps4 custom component you need to install it by doing this :
- Copy https://github.com/hmn/home-assistant-config/tree/master/custom_components/media_player to your config dir under custom_components/media_player
- Add platform: ps4 to your configuration.yaml
Example config:
media_player:
- platform: ps4
host: 10.0.0.4
- host: ip of the ps4
- port: ps4-waker bind port
- name: device name (Default: Playstation 4)
- cmd: ps4 waker command (Default: ps4-waker)
- filename: credentials filename for ps4-waker (Default: .ps4-wake.credentials.json)
- games_filename: games json file, data file of the games started on your playstation (Default: ps4-games.json)
- imagemap_json: imagemap json file (Default: https://github.com/hmn/ps4-imagemap/raw/master/games.json)
- local_store: local www folder to use instead of imagemap (Default: None)
The json games file is automaticly written and updates every time you start a game, but if you need to edit it manually the format is :
{
"CUSA02491": "Mass Effect\u2122",
"CUSA01116": "YouTube",
"CUSA01262": "Tom Clancy's The Division\u2122",
"CUSA01703": "Plex"
}
Multiple Playstation example with seperate games list and credentials for each ps4
media_player:
- platform: ps4
name: 'Living room PS4'
host: 10.0.0.4
filename: '.ps4-wake.livingroom.credentials.json'
games_filename: 'ps4-games-livingroom.json'
- platform: ps4
name: 'Games room PS4'
host: 10.0.0.5
filename: '.ps4-wake.gamesroom.credentials.json'
games_filename: 'ps4-games-gamesroom.json'
Alternative ps4-waker run command with custom config files
media_player:
- platform: ps4
host: 10.0.0.4
cmd: 'sudo ps4-waker'
filename: 'ps4-wake.credentials.json'
games_filename: 'ps4-games.json'
Load images from local www dir. Naming convention for images is www/{local_store folder}/{titleid}.jpg
media_player:
- platform: ps4
host: 10.0.0.4
local_store: games
Images are mapped using a json file The project is here https://github.com/hmn/ps4-imagemap If a game is missing you can fork the project and create a pull request
Look into writing a python module to replace ps4-waker