Sony PlayStation 4


The ps4 component allows you to control a Sony PlayStation 4 console.

  • This component supports controlling multiple PlayStation 4 consoles for your Home Assistant instance. Additional consoles can be added by running the configuration for the PS4 Integration again.

Requirements

  • Android or iOS device
  • PS4 Second Screen App for Android or iOS installed on device.

Set up

  1. Download the Second Screen App and make sure that you can find and control your PlayStation 4 normally.

Read the section “Granting Port Access” below before continuing.

  1. Navigate to Configuration -> Integrations and select Configure for PlayStation 4.

  2. Follow instructions displayed to generate user credentials. You will know this step is completed when a form with fields appears.

  3. Pair Home Assistant to your PlayStation 4 by filling in the fields.

    • Note: To find your correct region refer to the section Regions

Granting Port Access

The PlayStation 4 component requires the use of privileged ports to work correctly, specifically UDP port 987 and TCP port 997. Depending on your OS of your Home Assistant instance you may need to allow usage of privileged ports manually. Home Assistant installed on a Debian-type OS for example, such as Debian, Hassbian, Rassbian, and Armbian may require configuration.

Do not run your Home Assistant instance itself as root or with root/sudo privileges to accomplish this. This would create a security risk for your host system.

There are varying methods to perform this, dependent on your OS that is running Home Assistant. Specifically, your Python Interpreter which runs your Home Assistant instance needs access to the mentioned ports.

If your Home Assistant device is running Hass.io on HassOS, it does not require additional configuration.

  • Example for Debian-based and most UNIX operating systems: sudo setcap 'cap_net_bind_service=+ep' /usr/bin/python3.5 Replace “/usr/bin/python3.5” with your path to Python that is running Home Assistant.

Docker

When running Home Assistant using Docker, make sure that the Home Assistant container is discoverable by the PS4. This can be achieved by ensuring that the Home Assistant container uses the host network driver (by passing --net=host to the container when creating, or adding network_mode: "host" to your compose file when using docker-compose).

Configuration

The PlayStation 4 component does not use entries from configuration.yaml. You must configure this component by using Integrations

Regions

Some titles will have different SKUs in the PlayStation Store database depending on your region. You must select your specific region in the setup in order to retrieve the cover art for such titles correctly. If you do not know your region, reference the table below:

Region ID Locales
R1 Bermuda, Canada, United States
  and U.S. territories
R2 The Middle East, Western Europe,
  Central Europe, Egypt,
  French overseas territories, Greenland,
  Japan, Lesotho, South Africa and Swaziland
R3 Southeast Asia, Hong Kong, Macau,
  South Korea and Taiwan
R4 Australasia, Central America,
  the Caribbean, Mexico, Oceania, South America
R5 The rest of Africa, Former Soviet Union,
  the Indian subcontinent, Mongolia, North Korea

Region 6: Mainland China, is not supported as there is no English database available.

Services

Service send_command

Emulate button press on PlayStation 4. This emulates the commands available for the PS4 Second Screen App. This is not to be confused with DualShock 4 controller buttons.

Service data attribute Optional Example Description
entity_id No media_player.playstation_4 The entity id for your PlayStation 4.
command No ps The command you want to send.

Available Commands

Full list of supported commands.

Command Button Emulated
ps PS (PlayStation)
option Option
enter Enter
back Back
up Swipe Up
down Swipe Down
left Swipe Left
right Swipe Right