Playstation 4/PS4 custom component

The PS4 component seems to run fine for a couple of days, then it logs this message a couple of times every minute.

Any idea how to avoid and fix this?

Hi Roland,

Unfortunately not. Iā€™ve focussed on other thing last few weeks, so iā€™ll give it a try soon. Keep you posted!

I am adding the art work manually now, by adding a .jpg picture of a game to the www/games folder in hassio. Works fine for now, automatic art work would be great.

Can you turn on or off the Playstation when you see this error message ?
I have encountered the same issue too. In my case, my router is to blame : my Raspberry Pi canā€™t discover the PS4. Using the ssh interface, the Raspberry pi couldnā€™t ping the PS4. I had to manually add an ARP entry in the Raspberry pi, and it fixed the issue.

Can you post a semaple of how you do the local file for the img?
thanks

Does anyone know if there is a way to automatically login with a defined user ? With this custom component, my PS4 turns on but waits on the user selection on the login screen. Is there a way to bypass that ? I donā€™t need to do that when I manually turn on my PS4 or use the PS4 second screen app.

Google search is your friend:

Thanks for your answer, but my PS4 is already configured to automatically sign me in (only user) when the system is switched on. As said in my previous post, it does sign me in when I manually power on the PS4, or use the PS4 second screen app to turn it on.
However, when I use the HomeAssistant component, the system turns on but it asks me to press the ā€œPSā€ button of the remote, and then choose the user.

Woo!

https://github.com/home-assistant/home-assistant/pull/21074

Awesome work @Ktnrg45

This custom_component is broken in 0.88.

1 Like

Think you can patch the ps4.py script like that :

Replace this (around line 10 or 11)

from homeassistant.components.media_player import (
ENTITY_IMAGE_URL, MEDIA_TYPE_CHANNEL, MediaPlayerDevice, PLATFORM_SCHEMA,
SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
)

with that

from homeassistant.components.media_player import ( DOMAIN,
MediaPlayerDevice, PLATFORM_SCHEMA, ENTITY_IMAGE_URL)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL, SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON
)

Thanks Iā€™ll try and report^

I Changed to:

"""Playstation 4 media_player using ps4-waker."""
import json
import logging
import socket
from datetime import timedelta

import voluptuous as vol

import homeassistant.util as util
from homeassistant.components.media_player 
import ( DOMAIN, MediaPlayerDevice, PLATFORM_SCHEMA, ENTITY_IMAGE_URL)
from homeassistant.components.media_player.const import ( 
    MEDIA_TYPE_CHANNEL, SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON )
from homeassistant.const import (
    CONF_FILENAME, CONF_HOST, CONF_NAME, STATE_IDLE, STATE_OFF, STATE_PLAYING,
    STATE_UNKNOWN,
)
from homeassistant.helpers import config_validation as cv
from homeassistant.util.json import load_json, save_json

That did it!

thanks!

1 Like

I updated the custom component with the latest ps4.py file but now I get the following error when I do a config check. Any idea where this is coming from?

WARNING:homeassistant.helpers.config_validation:Your configuration contains extra keys that the platform does not support.
Please remove [cmd].

My config looks like:

  • platform: ps4
    name: ā€˜Playstation 4ā€™
    host: 192.168.1.114
    cmd: ā€˜sudo ps4-wakerā€™
    filename: ā€˜ps4-wake.credentials.jsonā€™
    games_filename: ā€˜ps4-games.jsonā€™

Iā€™m getting the same warning.

- platform: ps4
host: 192.168.1.11
name: ā€œPS4ā€
cmd: ā€˜ps4-wakerā€™
filename: ā€˜/config/.ps4-wake.credentials.jsonā€™
games_filename: ā€˜/config/ps4-games.jsonā€™

thank you for this, the edit in your post solved it for me as well!

2 Likes

Will this component come with 0.89?

It should!! Iā€™m going on the podcast after experimenting with the beta that comes out this week, to discuss it so I hope so!

2 Likes

Will this remove the need to have node and ps4waker installed?

If ā€œyesā€, my excitement for this will double! :slight_smile:

Yes, as far as I understand from following the pull request.

This is awesome. I love the Home Assistant community. I search to see if a component is available for PS4 and I find out that it will probably be in the next release of Home Assistant!