PS5-MQTT: Control PlayStation 5 devices using MQTT

Hi Guys!

I recently created a Home Assistant add-on that lets you control your PlayStation 5 devices using MQTT. You can check out the add-on here.

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

The add-on currently supports:

  • Auto discovery of PlayStation 4/5 devices.
  • Toggeling power mode: Standy (rest) / Awake
  • Tracking PSN activity and matching it to PS4/PS5 devices.
  • A web-ui for easy authenticating and getting insights on device information.

I created the add-on because I wanted to (obviously) integrate my PS5 with Home Assistant. I found a thread that showed how to use the awesome playactor library, in combination with a Command Line Sensor to integrate your PS5. However, I felt like an add-on would be easier to use and maintain! :slight_smile:

Any kind of feedback, suggestions for new features, or improvements is welcome!

If you like the add-on, please :star: the Github repo. Thanks!

And if you’re really feeling generous, help me and my family stay warm this winter :cold_face: by donating so I can keep paying my gas bill, whilst working on this project! :fire:

Buy Me A Coffee

Impressions

image

ps5-mqtt-auth-ui

21 Likes

Hi FunkeyFlo,

Thank you for all your work on this!

Can you help me with one thing, please?

I’ve installed your add-on, but I’'d have any entities related to my PS5 in HASS.

Is there anything I should do to be able to see them?

Many thanks!

Thanks, but the configuration for this was extremely confusing, at least until I found out that you have a hidden documentation document.

You should add a link to the documentation document in the README and add it to the docs folder.

Sorry to hear you had such a hard time finding out how to configure the add-on.

Just a tip; every HA add-on exposes it’s documentation within HA as well. :kissing_heart:

Have you installed an MQTT broker?

Hello,

This is working as expected for me, except one thing: It does not tell me the title of the game I am in, as in your example.
image

type: entities
entities:
  - switch.ps5_power
  - sensor.ps5_activity
  - update.ps5_mqtt_update

Do you have any advice? What kind of card have you used in your example? Can you share the code?

As mentioned here the active title (game/app) can be found in the attributes of both (power/Activity) entities.

I used a custom button card and replaced the entity_picture with the url from the title_image.

Unfortunately I’m not able to share all the required templates I use to render the card as shown in the example with you at this moment.

im new to mqtt just install it, is this the right way?
the ip is my HA whear the mtqq is installd on

I also wanted to rebuild the sensor, but I can’t do it like you.
Can you not share your template for this in principle or only at this moment?

Thx :wink:

BTW Nice Addon!

1 Like

When the add-on is running in HA OS/supervised, which it is telling from the screenshot the “manual” MQTT config is optional. If you leave it empty “{}” in yaml view. HA wil configure the connection for you.

Config is complicated and requires loads of stuff like custom theme, multiple CBC templates, and I’m not willing to share/support those as they’re not really suitable for sharing.

Your best bet is creating a CBC (custom button card) yourself. Or asking for help with a new thread.

Is not a problem, but maybe you should revise the photo then something :wink: I could imagine that there may be more requests :stuck_out_tongue_closed_eyes:

Hello,
i am stuck at setting PSN account update.
Add-on doesn’t create a new sensor.my_playstation_activity for me.
What should be used as username?
Screenshot 2022-08-21 at 12.40.14
Is my configuration correct?

It won’t literally be called sensor.my_playstation_activity but the name of your playstation +_activity.

If you’ve done all the setup correctly (config add-on properly and have a MQTT broker installed) the best way to find your entities is to search HA’s devices using the name you gave your playstation. By default something LIKE: PS5-067.

Ah ok.
I have this sensor available. But i receive only 2 status updates "idle and “playing”. How do i get image designs and titles to load?

To all users: I’m currently on holiday. For questions please refer to the rest of the (discord) community.


As for your question: Please read the notes above, add-on documentation, etc.

The post 1.0.0 release notes state that these values are included as attributes.

As someone who doesn’t really know how to install and run code is anyone able to walk me through how to get the access token? I’ve gotten my npsso token but not sure how to install and run the code necessary to get the access and refresh codes

Hi, Thank you for the plugin. I’m using HA in docker, have mqtt installed and tried to set up your plugin via docker container. All runs well, PS5 is recognised in your app (Web UI), but I can’t authenticate the console. I’m following the instructions but as soon as I hit authenticate button the screen with code displayed on my PS5 screen disappears and nothing happens or shows in te Web UI… any idea what’s happening? Am I doing anything wrong?

[EDIT] forgot to mention that before or after I try to authenticate I can see two entities in HA as below:

There are (unfortunately) two types of authentication.

The first one (which you performed) is “remote play” authentication which allows you to turn the PlayStation on/off.
If you didn’t receive any errors + the log is clear, the scenario that you described means it was succesful.

The second is acquiring an npsso (see docs) for tracking PSN account activity.

I’m not sure what you’re trying to do, but I’m going to guess you’re trying to set up the add-on in HA (supervised)?

If so:
The app handles acquiring access/refresh token for you using the NPSSO.
So just configuring the app like described in the docs and performing subsequent authentication per Playstation device using the web-ui should do the trick.