homebridge-minecraft

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i homebridge-minecraft

Weekly Downloads

0

Version

1.0.0

License

Apache-2.0

Unpacked Size

11.4 kB

Total Files

5

Last publish

Collaborators

  • oof-studio