Playstation 4/PS4 custom component

media_player
Tags: #<Tag:0x00007f1b95ddf4c0>

#102

doesn’t work for me … same error … i might open an issue on github


#103

It does actually still work for me after updating to 61.1 so I’m not sure why that is… (but I’m not complaining)


#104

Try single quotes


#105

I’d be interested to see how people are using this component in their automations (just to steal ideas). At the moment I have some automations to turn off the lights when I start a movie in Kodi, and bring them up slightly when I pause or stop. I’d like to do something similar with the PS4. Not sure if it’s just a case of doing state changes from Idle to Playing (and vice versa?) or if people have done some other cool stuff with it.


#106

Good thought. Since the custom component is a media player you could basically copy the same automation you use for kodi and swap out the entity_id media_player.my_kodi_device with media_player.my_ps4_name. Obviously you would have to remove the movie condition from the automation since it doesn’t apply to the ps4.


#107

Already tried all kind of combination


#108

Tested on Hassbian and Raspbian.
This is how I put under media_player platform.

media_player:
  - platform: ps4
    name: Playstation 4 <== name display on frontend
    host: !secret ip_ps4
    cmd: 'sudo ps4-waker' <== I use sudo because command are run by homeassistant user
    filename: '.ps4-wake.hass.credentials.json'
    games_filename: 'ps4-games.json'  <== directly in HA config folder, this is the game name created by ps4
    local_store: games  <== this games folder located in www folder all are in jpg format to display the game I choose

#109

Followed the above instructions, but is not working. I got the PS4-WAKER connected in second screen, but in HASSIO is not working, it goes from OFF to Inactive


#110

And it doesn’t complain about double quotes? Is there maybe a pswaker update I don’t know ?


#111

now I get this

bash-4.3# ps4-waker -c /data/ps4-creds.json
WAKEUP sent to device… 192.168.1.28
Logging in…
bash-4.3#


#112

Just in case someone else has this issue:
I had a massively hard time installing node on the Raspberry Pi 3B running Hassbian (Debian Stretch), as it requires libssl1.0-dev which conflicts with the libssl-dev on the Pi.
Long story short, install all of these at the same time:

sudo apt-get install nodejs npm node-semver -y

Then I also needed to upgrade node, as it was a really old version v4.*

npm install -g n

#113

I’m not sure what I’ve done wrong. Running HA on an Ubuntu Server install (so no HASSBIAN or HASS.IO for me). I’ve got PS4-Wake running by CLI, and it connects to my PS4.

When I run Home Assistant with the PS4 component, though, I get a string of “Error doing job: Task exception was never retrieved” errors from Loader.py. On review of the log, I keep getting a SyntaxError: invalid syntax at line 7 of ps4.py (that’s the “import voluptuous as vol” command).

Am I missing a dependency?


#114

I managed to install the ps4 as media_player and I see the current status/game, but non of the actions do anything. I also have the occasional:

Error doing job: Task exception was never retrieved

Commands from SSH work fine.
Btw, is it normal that despite there being a .credentials.json file in my config directory I still got asked to provide path to it inside HA UI?

Setup: Hassbian Home Assistant 0.60.1, node 9.5, python 3.5

media_player:
  - platform: ps4
  name: 'PS4 Pro'
  host: 192.168.xx.xxx
  cmd: 'sudo ps4-waker'
  filename: '.ps4-wake.credentials.json'

#115

This is my config

media_player:
  - platform: ps4
    name: Playstation 4
    host: !secret ip_ps4
    cmd: 'sudo ps4-waker'
    filename: '.ps4-wake.hass.credentials.json'  <== this file is actually in home/homeassistant  (not in the config directory home/homeassistant/.homeassistant). So where you put the file just try provide the path to it.
    games_filename: 'ps4-games.json'
    local_store: games

#116

For anyone using the custom component: here’s my modified ps4.py since there was a breaking change in 0.64.


#118

Thanks for this. Do I need to reconnect my PS4 using the companion app?


#119

It worked out of the box for me. Restarting Hass should be sufficient.


#120

@Knapoc doesn’t work for me. Any suggestions to fix?


#121

@Knapoc I add ps4_ip option like in your config but component shows errors now:

Failed to call info: Invalid URL '192.168.2.50/ps4/192.168.2.50/info': No schema supplied. Perhaps you meant http://192.168.2.50/ps4/192.168.2.50/info?

#122

The new update fro modified ps4. py from Mr. Knapoc works for hass.io but not hassbian.

Mine still use the old one and have no effect on hassbian after upgrade ha to 0.64