PlayStation 5 Command Line Sensor Help - Command Failed/Empty JSON

Nothing for hassio users yet? With the PS4, I had an automation running to switch the HDMI input on my TV after the console switched off, since it didn’t have the option to disable the TV HDMI-CEC switching on the PS4 (like how the XSX does). Same problem with the PS5, if the TV is switched off on HDMI-1 (PS5) and the wife switches on the TV, it switches on the PS5 as well.

Going to try and use the ‘No Signal’ state on the TV to try out an automation while I wait for something on hassio

There are a few examples above that make sensors to tell you the state… you can just use those to turn on the PS as needed if the input changes? I’m not sure I understand what you are looking for.

Looking to install the ps5-wake on an r-pi running hassio/hassos. I don’t have ssh access to the system.

Alternative is using the ping sensor, this works for me. Mind that standby is also reported as active (in my PS5 configuration, yours might be different due to automatic update settings etc.)
I use this perform TV and amplifier input changing and to remind my son every half hour of his play-time :D.
Of course an integration replacing the PS4 one would be nice

Hey,
first of all thanks for sharing this ps5-wake integration. I’m completely new to this HomeAssistant and coding stuff, and I’ve got problems with the installation process. When I type “make install” an error occurs.
That is the output:

➜  ps5-wake git:(master) ✗ make install
gcc -O2 -g -pipe -Wall -std=gnu99 ps5-wake.c sha1.c -o ps5-wake
make: gcc: Command not found
make: *** [Makefile:7: all] Error 127

I hope you can help me.

You need to install the tools before you can use them.

apt-get install build-essential

Thanks a lot. I guess it works now. But now I have to look for the user-credentials.

Hm now there is the next problem:
When I try to execute these commands then I just get the following output:
The start via the PS Remote Play works fine.

Unbenannt

Is your PS5 connected via WiFi or Ethernet? My PS5 can’t be detected on ethernet.

I plugged an Ethernet cable into my Wi-Fi repeater. And even if I connect the PS5 via Wifi it says “No device found.”

I made a ps5 sensor in python which works fine as a command line sensor (binary or with support for standby): https://github.com/wicol/ha-config/blob/800cc94a214aa4d654cfa6e72253d4a3bb38ba73/sensors/ps5.py

2 Likes

Would it be possible to integrate this into HACS or HA itself?

Sure. I made a feature request for a new integration. I think the ps4 integration could just be ported basically.

Could you show an example of use?

$ ./ps5.py --help
usage: ps5.py [-h] [-b] host

Query a PS5 for state. Prints ON/STANDBY/OFF (Unreachable host = OFF)

positional arguments:
  host

optional arguments:
  -h, --help         show this help message and exit
  -b, --binary-mode  Report standby as OFF
$ ./ps5.py 192.168.0.37
STANDBY
$ ./ps5.py -b 192.168.0.37
OFF

I have it set up like this in binary_sensors.yaml:

- platform: command_line
  name: ps5
  command: /config/sensors/ps5.py -b 192.168.0.37
  scan_interval: 10
4 Likes

Thank you!

I am unable to find the user-credential part.

I tried using tcpdump as well but no luck, any advice?

Hi all and thanks Mattias.

I’m getting:

Template variable error: ‘value_json’ is undefined when rendering ‘{% if value_json.code == ‘200’ | int %} on {% elif value_json.code == ‘620’ | int %} standby {% else %} off {% endif %}’

It could be due to the non declaration of the variables, will look into it. The rest seems to work fine!

Hello can someone help me??? I want to turn my PlayStation 5 on and off using the Home Assistant. I’ve already found out the user credentia. How can I now integrate my PlayStation as a switch in the Home Assistant? Unfortunately, I’m not getting any further.