Skip to content

Home Assistant Integration

The add-on deploys a companion integration (bruh_minecraft) that Home Assistant auto-discovers — turning the server into a first-class smart-home citizen with sensors, buttons, and services you can automate like anything else.

Device & entities

Everything lives under one BRUH Minecraft device:

EntityWhat it tells you
sensor.…_players_onlinePlayer count, with the players name list in attributes
sensor.…_players_maxSlots
sensor.…_tps_1m/5m/15mServer tick rate (Paper/Purpur) — the lag early-warning
sensor.…_latency_msStatus ping latency
sensor.…_uptime / version / server_type / motd / difficulty / gamemodeServer facts
binary_sensor.…_reachableStatus ping succeeds
binary_sensor.…_rcon_okRCON handshake OK (disabled by default)
Buttonsbackup_now, restart_server, stop_server, save_all

Services

ServiceFieldsWhat it does
bruh_minecraft.saymessageBroadcast to everyone online
bruh_minecraft.rcon_commandcommandAny Minecraft command over RCON
bruh_minecraft.giveplayer, item, amountGive items (player must be online)
bruh_minecraft.set_weatherweatherclear / rain / thunder
bruh_minecraft.set_timetimeday, night, noon, midnight, or ticks
bruh_minecraft.backup_nowGit or archive backup, per your config
bruh_minecraft.restart_serverGraceful save + restart
bruh_minecraft.stop_serverGraceful save + stop (stays stopped)
bruh_minecraft.op_player / deop_player / kick_player / ban_player / whitelist_add / whitelist_removeplayerPlayer management

Recipes

Bedtime enforcement

automation:
- alias: Minecraft - bedtime
trigger:
platform: numeric_state
entity_id: sensor.bruh_minecraft_players_online
above: 0
condition:
condition: time
after: "22:30:00"
before: "06:00:00"
action:
- service: bruh_minecraft.say
data: { message: "Server going to sleep in 60s — save your work!" }
- delay: "00:01:00"
- service: bruh_minecraft.stop_server

Nightly backup

automation:
- alias: Minecraft - nightly backup
trigger: { platform: time, at: "04:00:00" }
action:
service: bruh_minecraft.backup_now

Announce over the server

Paired with a brAIn voice assistant, “tell everyone dinner’s ready” does this hands-free:

- service: bruh_minecraft.say
data:
message: "Dinner's ready — pause your builds!"

TPS watchdog

automation:
- alias: Minecraft - lag alert
trigger:
platform: numeric_state
entity_id: sensor.bruh_minecraft_tps_1m
below: 15
for: "00:05:00"
action:
service: notify.mobile_app_phone
data:
message: "Minecraft TPS dropped to {{ states('sensor.bruh_minecraft_tps_1m') }} — {{ state_attr('sensor.bruh_minecraft_players_online','players') | join(', ') }} online."

Under the hood, services run through a file-based IPC bridge at /config/.bruh_minecraft/ — HA drops a JSON request, the add-on executes it over RCON and writes the response back. See the Reference for RCON and backup configuration.