Homebridge Minecraft Plugin
This plugin creates an OccupancySensor
accessory that derives its value from the result of the Minecraft Server Status API.
Failures in the API connection also set a "fault" state on the accessory.
Services
Status
An OccupancySensor
service is defined, with two Characteristics:
-
OccupancyDetected
: Set toOCCUPANCY_DETECTED
(1
) when there is at least one player is online, orOCCUPANCY_NOT_DETECTED
(0
) when there are none. -
StatusFault
: Set toGENERAL_FAULT
(0
) when an API request fails or the server is offline, orNO_FAULT
(1
) when operating normally.
Information
Declares some static information that will appear in the Home app when inspecting the accessory.
Configuration
The plugin is set up to be configured via the Homebridge GUI, but you can also add an object to the accessories
array of your config file:
{
"accessories": [
{
"name": "Minecraft Server",
"host": "192.168.0.128",
"port": 25565,
"type": "java",
"updateInterval": 60000,
"accessory": "MinecraftServer"
}
]
}
The accessory
property must be MinecraftServer
, but the other values are up to you. Provide updateInterval
in milliseconds; only values greater than one minute will be honored, so that the Minecraft Server Status API is not overwhelmed.
Be sure and select the correct type
—Java and Bedrock servers are handled separately in the API and must be queried separately.