1.0.0 • Published 6 months ago

homebridge-minecraft v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

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 to OCCUPANCY_DETECTED (1) when there is at least one player is online, or OCCUPANCY_NOT_DETECTED (0) when there are none.
  • StatusFault: Set to GENERAL_FAULT (0) when an API request fails or the server is offline, or NO_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.

1.0.0

6 months ago

0.0.1

1 year ago