michaellunzer/Home-Assistant-Custom-Component-Fortnite
This is a Home-Assistant custom component that pulls Fortnite stats using the python API library from the site fortnitetracker.com
Fortnite Stats Sensors
Component to integrate with fortnite.
Fortnite Stats
This 'fortnite' component is a Home Assistant custom sensor which shows you various stats accumulated while playing the very popular F2P game, Fortnite: Battle Royale.
Why?
It can show you how well you're playing the game with stats like:
- How many eliminations you've earned
- Kill/Death Ratio
- Eliminations Per Game
- Total Matches Played Per Mode
- Your Fortnite Score
- Your Score Earned Per Match
- Your Win Ratio
And how many times you finish in the:
- Top 1
- Top 3
- Top 5
- Top 6
- Top 10
- Top 12
- Top 25
Purpose
This is my first Home-Assistant Custom Component, so it's been a fun learning experience for me contributing to Open Source Software! This wouldn't been possible without the help from @xcodinas for building the fortnite-python library and from @clyra for helping refine my initial script and idea by further developing it towards a more finished product. From there I've added some extra tweaks, wrote the documentation, and published it in the Home-Assistant Community Store (HACS).
Screenshots
Sensor List View
Clean sensor names showing Console/PC platforms with all game modes and statistics
Detailed Sensor View
Detailed sensor view showing wins, attributes, and real-time data from fortnite-api.com
My Dashboard
This component will set up the following platforms.
| Platform | Description |
|---|---|
sensor |
Show stats pulled from fortnite API on https://fortnite-api.com/ |
Manual Installation
Download the fortnite.zip file from the latest release.
Unpack the release and copy the custom_components/fortnite directory into the custom_components directory of your Home Assistant installation.
Configure the fortnite sensor.
Restart Home Assistant.
Installation via HACS (Preferred Method)
- Ensure that HACS is installed
- Search for and install the "Fortnite Stats" integration
- Restart Home Assistant
- Add the integration via the UI (see Configuration section above)
Configuration via UI
Note: As of version 2.0, this integration uses the modern Home Assistant UI configuration instead of YAML and has been completely modernized for Home Assistant 2024+.
Getting Your API Key
- Visit fortnite-api.com
- Click Dashboard / Docs in the navigation
- Sign up for a free account or log in
- Navigate to the API Keys section
- Generate a new API key for your Home Assistant integration
- Copy the API key (you'll need this for setup)
Getting Your Epic Username
Your Epic username is the display name you use in Fortnite. This is different from your Epic Games account email. You can find it by:
- Launch Fortnite
- Look at the top-right corner of the main menu - your display name is shown there
- Or check your Epic Games profile at epicgames.com
Note: Use your Epic display name, not your Epic Games account email.
Setup Steps
- Go to Settings > Devices & Services
- Click Add Integration
- Search for Fortnite Stats
- Follow the setup wizard:
- Enter your Fortnite API key (from fortnite-api.com)
- Enter your Epic username/display name
- The integration will automatically create sensors for all platforms and game modes
What You Get
The integration automatically creates 54 sensors covering all platforms and game modes:
Platforms:
- Console (Xbox, PlayStation, Nintendo Switch)
- PC (Keyboard & Mouse)
Game Modes:
- Solo - Individual battle royale matches
- Duo - Two-player team matches
- Squad - Four-player team matches
Stats for Each Combination:
- Eliminations, Wins, Matches, Win Rate, K/D Ratio
- Top 10 Finishes, Top 25 Finishes, Score, Minutes Played
Example Sensors Created
For username Captain_Crunch88, you'll get sensors like:
sensor.captain_crunch88_console_squad_eliminationssensor.captain_crunch88_console_squad_winssensor.captain_crunch88_pc_solo_eliminationssensor.captain_crunch88_console_duo_win_rate- And 50 more...
Features
- Real-time Updates: Automatic updates every 5 minutes
- Multiple Platforms: Tracks both Console and PC gameplay
- All Game Modes: Solo, Duo, and Squad statistics
- Comprehensive Stats: 9 different statistics per platform/mode combination
- Modern Architecture: Built for Home Assistant 2024+ with async/await patterns
- Easy Setup: Just API key and username - no complex configuration
This custom-component (v2.0.0) is compatible with Home Assistant 2023.1.0 and later
Contributions are welcome!
If you want to contribute to this please read the Contribution guidelines



