Greetings Pioneers! I got my local dedicated server stats added to Home Assistant and wanted to share if anyone else is interested.

First off the API documentation can be found at “steamapps/common/Satisfactory/CommunityResources/DedicatedServerAPIDocs.md” or here thanks to redditor /u/suudo.

I generated an API token by opening the game client, clicking Server Manager > Console and entering the command server.GenerateAPIToken and added the following code block below to my configuration.yaml file.

NOTE: I assume this goes without saying, but just wanted to note that you need to input your own server IP at YOUR_DEDICATED_SERVER_IP and input your own API token at YOUR_TOKEN in my example below. If there’s more you want to see please consult the documentation I’ve linked above.

NOTE: I specified a unique_id for each sensor so they are customizable in the UI - this can be literally anything as long as it’s unique.

rest:
  - scan_interval: 60
    method: POST
    resource: "https://YOUR_DEDICATED_SERVER_IP:7777/api/v1"
    verify_ssl: false
    headers:
      Authorization: Bearer YOUR_TOKEN
      Content-Type: "application/json"
    payload: '{ "function": "QueryServerState" }'
    sensor:
      - name: "Satisfactory Connected Players"
        value_template: "{{ value_json.data.serverGameState.numConnectedPlayers | int }}"
        unique_id: 63628608-0139-40f0-b163-d2534d17ca78
        unit_of_measurement: "Players"
      - name: "Satisfactory Tech Tier"
        value_template: "{{ value_json.data.serverGameState.techTier | int }}"
        unique_id: 63628608-0139-40f0-b163-d2534d17ca79
      - name: "Satisfactory Average Tick Rate"
        value_template: "{{ value_json.data.serverGameState.averageTickRate | float | round(1) }}"
        unique_id: 63628608-0139-40f0-b163-d2534d17ca7a
        unit_of_measurement: "Ticks/s"
      - name: "Satisfactory Active Session Name"
        value_template: "{{ value_json.data.serverGameState.activeSessionName }}"
        unique_id: 63628608-0139-40f0-b163-d2534d17ca7b
      - name: "Satisfactory Total Game Duration"
        value_template: "{{ (value_json.data.serverGameState.totalGameDuration | int) // 3600 }}"
        unique_id: 63628608-0139-40f0-b163-d2534d17ca7c
        device_class: "duration"
        unit_of_measurement: "hours"
7 points

Nice, I did get the API working awhile back but was a little disappointed by how limited it was… But now I have a purpose for it, thanks!

It’s somewhat satisfying to automate monitoring of your automation sim using your home automation platform.

permalink
report
reply
3 points

I should have known there would be crossover between HA and Satisfactory communities.

Sure, you’ve automated reinforced iron plates, but have you automated the lighting in your home?

permalink
report
reply

Satisfactory

!satisfactory@lemmy.world

Create post

The unofficial Lemmy community for Satisfactory, the factory-building and exploration game.

Useful Links:

Looking for Group?

@MentalEdge@sopuli.xyz started a dedicated server and welcomes Fediverse users, find out more by DMing them or joining this steam chat

Rules

  1. No bigotry - including racism, sexism, ableism, homophobia, transphobia, or xenophobia.
  2. Be respectful, especially when disagreeing. Everyone should feel welcome here.
  3. No NSFW content
  4. No ads/spamming

Community stats

  • 552

    Monthly active users

  • 213

    Posts

  • 822

    Comments