Custom Component: Discord status and game sensor

Hi!
I decided to share my custom component which I use to track Discord users online status and which game they are currently playing.
It creates a sensor for each configured user that has to be present on the same server as the bot this component creates.
Sensor shows online status as it’s state and game that the user is currently playing as the sensors attribute.

This component is available in the HACS central repository Store, search for Discord Game.

Thanks to @descention as an original author of this component which I’ve update for current Discord API and Home Assistant and integrated it with HACS.

6 Likes

I remember writing a component but I don’t remember where I shared it. I appreciate the attribution and thank you for publishing your work.

Thanks for this, now I can get Google Home to TTS this everytime I launch Destiny 2

Whether we wanted it or not, we’ve stepped into a war with the Cabal on Mars. So let’s get to taking out their command, one by one. Valus Ta’aurc. From what I can gather he commands the Siege Dancers from an Imperial Land Tank outside of Rubicon. He’s well protected, but with the right team, we can punch through those defenses, take this beast out, and break their grip on Freehold.

1 Like

Just a little update about just released version 1.1.1:

  • Discord avatar is now used as sensor entity_picture
  • Optimizations

I am loving this integration, only problem i have so far is a user that has spaces in their name, for example “this is my name#0000” and i cant seem to work out how to make it work

I’ll look into it. I’ve not tested it with name like that. I didn’t know that you can have spaces in your name lol.

neither did i

I’ve just pushed a fix to Github. To update before HACS finds the new version, just open the component page in HACS and it will offer you to update to version 1.1.4.

1 Like

thanks mate, that was fast

EDIT: everythings working great now thanks

Hi, I have quite the simular problem. I can’t add users with a dot in their name. It would be cool if you could look into it. I believe you maybe have to replace the dot with an underscore in the endity-name so everything is still in the right domain.

Otherwise this is a really cool component thanks for creating this!

I’ve added support for names with dots in latest release 1.1.5.
To update before HACS finds the new version, just open the component page in HACS and it will offer you to update to version 1.1.5

Thank you very much! It works great :slight_smile:

I would love to see how people are using this in their lovelace or different automations

I’m using this mainly to control my colored ambient lights in the game room based on what me or my fiancee is playing.
Or you can eg. set up a google tts to tell you that your buddies are playing so you may join them.

2 Likes

The latest version broke my install.

HASSIO 104.1

Updated to 3.0 and it wouldn’t boot. I can’t recall exactly what was in the log but removing the custom component from the folder and commenting out the sensor then rebooting fixed it.

I then reinstalled it and rebooted without issue. However, uncommenting the sensor would prevent HA from checking the config and rebooting.

Hardware reboot then commenting out sensor and it worked again. I’ve gone back to 2.0.1

It’s fixed in version 3.0.2, sorry about that. @Skully

1 Like

A little update.
This custom_component is currently not compatible with official Discord notifications integration. This will last until discord.py does officially release custom statuses.

There is a way to make it work though. Just follow the guide here: https://github.com/LordBoos/discord_game/issues/6

Hey peeps.

Newby.

How do I get a card that shows the game as well as online status in lovelace?

Thanks

@tadakatsukami I don’t think there’s any way to do that automatically, but you could use horizontal/vertical stacks or a markdown card to show the online and game states side-by-side

I was hoping to use this component along with some Discord presence homebrew to have HA sense what game I’m playing on my Nintendo Switch. Unfortunately it looks like the presence app publishes the actual game name as the subtitle, not the title:

image

There doesn’t seem to be any way to change this behaviour in the presence app, would it be possible to do it via the custom component instead? It’s quite useful as-is for my intended function of dimming lights when the Switch turns on, but it would be pretty cool to get visibility on the game title, too.

Hi, good suggestion. I’ve already released a new version, which pulls rich presence data from discord. Please update and let me know if it works for you! I don’t have a Switch myself so I was experimenting with other rich presence games and applications.