Good point!! Silly me - corrected it now
Iâll keep hoping
Good point!! Silly me - corrected it now
Iâll keep hoping
playactor is also having problems now to set it to standby, sometimes it works and sometimes it doesnât, thereâs an open issue on github for that: playactor standby doesn't work correctly ¡ Issue #37 ¡ dhleong/playactor ¡ GitHub
Hi guys, im pretty new to HA and have just started to automate my TV and audio receiver to turn on and off and switch to the correct inputs, without having to rely on the awful CEC integration of my devices.
What is the best way to get a (fast) trigger from my PS5 when i turn it on and off?
Ive read the whole thread (and others) but im quite overwhelmed right nowâŚ
âA bit off-topic â
I use Ping (ICMP) - Home Assistant (home-assistant.io) integration to ping to the PS5. In my situation I can see on/off states. PS5 needs to be really OFF for this (standby is reported as ON). Still hoping for a HA integration as available for PS4 though⌠For discussion on this please open a new topic (and mention me if you need help, I can give it a try). We should not hijack this topic
Iâm biased ofc, but if you want support for standby Iâd say my python script is the easiest way to go right now as it doesnât have any dependencies that HA doesnât have - meaning you can just drop it in and configure it with a command line sensor (binary or otherwise). Examples just above
Thank @wicol for this script, would be very nice if you get the sleep function integrated also!
Since I use a synology with docker HA, I had to change the command format to
- platform: command_line
unique_id: 1644163974631
name: ps5_wired
device_class: connectivity
command: 'python ./custom_sensors/ps5.py -b DEV_PS5'
scan_interval: 30
BTW, for now I donât really care for waking it up with HA since I cannot turn it off again, so I didnât even try to use that, but it looks like you need some additional sniffing and credentials and stuff before getting.
It would be nice if youâre able to get the sleep functionality working as well, and would you then also be so kind to post a bit more about the steps how to get the right credentials/settings/etc.?
The sleep/standby function is supported in playactor https://github.com/dhleong/playactor
There are posts above that show how to make a command_line switch⌠you can also then make that a âuniversal media playerâ so you have a media player entity like the PS4 integration did. I believe the instructions for that came from above also.
where can i find my user credential?
Youâll have to use tcpdump at this point. Unless someoneâs got a better idea? playactor has implemented the login flow so you might be able to get it through that as well. Hereâs an old instruction from ps4-waker:
</s> <s># tcpdump -s0 -X -n -i <interface> udp and port 987</s> <s>
> Youâll be looking for a packet that looks like HTTP and contains the string âuser-credential:NNNNNNNâ. Remember the âuser credentialâ number.
That wonât work here. Hereâs a working example:
tcpdump -An udp and dst PS5_IP_GOES_HERE | grep user-credential
Then wake the PS5 from your phone app, and a line should appear with the credential:
$ tcpdump -An udp and dst 192.168.0.37 | grep user-credential
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
user-credential:-XXXXXXXXXX
Hello,
I have installed HA in Docker on my Raspberry.
I have managed that the commands e.g. playactor wake --host-name PS5-639
are executed correctly on the Raspberry.
I think I need to somehow still allow the SSH connection from HA but how?
I mean this function:
switch:
- platform: command_line
switches:
playstation:
value_template: >
{% if value == 'AWAKE' %}
true
{% elif value == 'STANDBY' %}
false
{% else %}
Unknown
{% endif %}
command_state: ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] 'playactor check --host-name PS5-639 | jq -r ".status"'
command_on: ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] 'playactor wake --host-name PS5-639'
command_off: ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] 'playactor standby --host-name PS5-639'
friendly_name: Playstation 5
Hi, Trying to get this to work with very limited coding / yaml skills. attempting to use your code as a template for mine.
From what i can work out i have successfully installed Playactor on my Pi and connected to the PS5 remote play.
For the Switch, and more specifically the 3 command lines (state / on / off)
Can you clarify:
in the example pi: is this the Raspberry pi user name?
the IP address; Assume of the Pi not the PS5
Host name: The name of the PS5 discovered as part of the browse command during setup?
[email protected] 'playactor check --host-name PS5-639
Many thanks in advance
Regards
Pretty much yes to all your questions.
The strictHostkey thing is there to make sure Pi doesnât ask you for pass (logs in automatically using your id_rsa key) when you try to do the remote connection to your pi.
To test you you should be able to run this command from your HA docker instance and it should return a status of your playstation.
ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] 'playactor check --host-name PS5-639 | jq -r ".status"'
I think Iâve found the the problem but im too much of an beginner to know the solution.
With the retirement of the default pi (no password) default account on newbuilt Raspbian systems Im having to put in my chosen username substituting pi before the IP address.
When I try and run the command from the Terminal Im being asked to enter my account password in advance on getting the status response (Standby / Awake).
Is there a way to modify the commands (State / On / Off) to incorporate the pi account password?
Sorry for being such a trouble
@davy932
You guys are correct you need to login first to your Pi without the password. Here is how to set it up
ssh-copy-id [email protected]
. (pi is the username to use for my Pi)ssh [email protected]
you should be logged in without being asked for a passwordssh [email protected] âplayactor check --host-name PS5-639 | jq -r â.statusââ
(update the above to match your username, pi hostname and ps5 host name)
If everything went correctly you should get ps5 status in your terminal.
If it doesnât you can try to copy the ssh key to a HA config folder by using this command:
cp .ssh/id_rsa /config/ssh/id_rsa
⌠I donât remember if cp actually makes the folder if it doesnât exist so you might have to run mkdir /config/ssh
first before you can run the above
you can now try to connect using the key in that specific folder using this command:
ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] âplayactor check --host-name PS5-639 | jq -r â.statusââ
Hopefully it now works and you get the status of your ps5 in the console.
You can now add the command (the one that worked into your HA sensor config).
You should be all set now.
If you are still having trouble google how to generate ssh key and copy it to a different host, since thatâs what we are doing here.
ANDâŚ
IT WORKS!!! Woohoo!!
Many thanks!!
Thanks! All I needed was the binary sensory to run a automationâŚ
Hey guys, I created an add-on to make it easier to integrate Playactor with Home assistant using MQTT. You can find and install it through this repository!
Has anyone successfully install this on a original Raspberry Pi B
Im getting this error:
pi@raspberrypi:~ $ playactor browse
/usr/local/lib/node_modules/playactor/node_modules/ix/asynciterable/asyncsink.js :7
_ended;
^
SyntaxError: Unexpected token ;
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensionsâŚjs (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/usr/local/lib/node_modules/playactor/dist/util/async .js:13:21)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensionsâŚjs (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
Many thanks