How To Create Steam Card in Home Assistant

by Danny
0 comment

READING TIME: 4 MINUTES

In this guide, I’ll show you how to setup a Home Assistant card using the Steam integration. This will let you view things such as the online status, the title and picture of the currently played game, last online time, and much more.

This integration works for both your own Steam account as well as the account status of your friends.

We are using the official Steam integration for this, but then also grabbing some attributes to create our card.

Let’s get started!


Step 1: Get Free Steam API Key

To get your API key, go here and sign in: https://steamcommunity.com/dev/apikey

After signing it, a screen will tell you to add a domain name. I added “smarthomepursuits” there, but anything in that field will work (for example, I tested adding ‘test’ and it gave me an API key).

Step 2: Get Steam Account ID

Next, you need to grab the Steam Account ID for the account you plan on adding. There’s a couple ways to find this, but this easiest way is to go to steamid.io and type in the username of yourself or one of your friends. If you want to track multiple people, do this for each person.

The account ID you’ll use in Home Assistant is the steamID64.


Step 3: Add Steam sensor to Configuration.yaml

Now that you have your API key and account ID’s, we need to create a sensor that will track the online status of public Steam accounts.

File Editor > configuration.yaml. paste in this code:

sensor:
  - platform: steam_online
    api_key: 18A8xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    accounts:
      - 76444444444444444
      - a766666666666666666

Then, reboot Home Assistant from Configuration > Server Controls so the sensors become active.


Step 4: Verify sensors show up

Next, you need to check if the new steam_online sensors show up for all of your users.

Configuration > Devices & Services > Entities tab. Search for ‘steam‘:


Add Basic Steam Sensors to Home Assistant

The most basic card you can add is a simple card that shows you and your friends name and their status. You can do this by adding an Entities card to one of your dashboards. Search for Steam, and they’ll show up like this:


Recommended: Add Steam Card from HACS

A much cleaner way to display the data is by using a Home Assistant Community Store (HACS) card called Steam Card.

Open HACS from the sidebar > Frontend > Explore & Download Repositories > search for Steam. Then download and install it.

Add ‘Steam Card” Cards to Home Assistant

Once installed, you can add a Manual card to one of you dashboards. Here are some of the available cards and options to customize them.

Just copy and paste the YAML below into a Manual card and change out the sensor with your own.


Single User Steam Card

entity: sensor.steam_764444444444
type: 'custom:kb-steam-card'

Multiple User Steam Card

Notice the status icon to represent the online status instead of the word “online”

entities:
  - sensor.steam_764444444444
  - sensor.steam_a76555555555555
type: custom:kb-steam-card

Now Playing Card

type: custom:kb-steam-card
entity:
  - sensor.steam_7644444444444
friendly_name: SmartHomePursuits
game_background: true

There’s a few more options to customize if you glance at the Steam Card github page. Also, there are some promising sensors and use cases in this Reddit thread.

Note: You may need to restart Home Assistant if you’ve just changed your profile picture or started playing a game. (I didn’t wait long enough to see if those would update on their own, but I’m assuming they probably would.)


Wrapping Up

Hopefully this simple guide helps you integrate Steam stats into Home Assistant! It’s a really neat way to see who is online and what they are playing at a glance.

You can use this integration to change the light color when the game sensor changes from None to Anything. Here’s the list of available attributes if you choose to customize your card even further.

  • game
  • game_id
  • game_image_header
  • game_image_main
  • game_icon
  • last_online
  • level

My Favorite Home Assistant Devices

Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.

Smart Home Product Finder

What hub do you currently use?


SmartThings

Home Assistant

Hubitat

Step 1 of 3

What product are you looking to add?


Lights

Locks

Thermostats

Cameras

Garage Door Opener

Switches

Sensors

Motion, Door & Window, Leak

Smart Plugs

Buttons

Step 2 of 3

What protocol?


Z-Wave

Zigbee

Wifi

Step 3 of 3

Retake quiz? Click here!

0 comment

You may also like

Leave a Comment