interface HSBConfig {
    accessoryName: string;
    callbackCommandTimeout: number;
    callbackCommandType: "Default (display notification)" | "Custom unix command" | "Shortcut name";
    callbackCustomCommand?: string;
    callbackServerEnabled: boolean;
    callbackServerHostname: string;
    callbackServerPort: number;
    callbackServerProtocol: "http" | "https";
    name: string;
    services: {
        serviceName: string;
        shortcutName: string;
    }[];
    serviceType: "Outlet" | "Switch";
}

Hierarchy

  • Pick<PlatformConfig, "_bridge" | "platform">
    • HSBConfig

Properties

accessoryName: string

Display name of the accessory.

"Shortcuts"
callbackCommandTimeout: number

The time in milliseconds that the x-callback-url server should wait for the callback command execution to complete before timing out. Note: this matters only in case of custom callback command; if you chose a shortcut, the actual command executed is only the launch of it, the run itself is indipendent from the plugin.

5000
callbackCommandType: "Default (display notification)" | "Custom unix command" | "Shortcut name"

With the default option, after the shortcut completion, a notification with the outcome of the shortcut run is displayed on the host running Homebrige. If you choose to customize the callback behaviour, you have two choices: use any unix command that your host is able to execute, or just use another shortcut to handle the callback if you like. Depending on which choice you make, you'll have to fill in the next field accordingly. Please consult the dedicated documentation for more detail: Callback command.

"Default (display notification)"
callbackCustomCommand?: string

Either a unix command or the name of a shortcut to run, depending on the value selected in the previous field. In the former case, all the content of the field will be treated as a command and executed: in the latter, this field expects just the plain name of the shortcut as displayed in the Shortcuts app. If you left the previous field on the default value, any text inserted here will be ignored. Please consult the dedicated documentation for more details also regarding the runtime variables available during your command/shortcut execution: Callback command.

callbackServerEnabled: boolean

Whether the plugin should execute a command once a shortcut run completes. This determines whether to run an internal x-callback-url http server in the background. All fields below depend on this one: any value inserted in the following fields will be ignored if this one value is set to false.

true
callbackServerHostname: string

IPv4 address or hostname to expose the internal x-callback-url http server (must be accessible from a browser on the machine running Homebridge).

"127.0.0.1"
callbackServerPort: number

A free port number to be used by the internal x-callback-url http server.

63963
callbackServerProtocol: "http" | "https"

If you access other Homebridge services (e.g. UI) behind a reverse proxy with TLS certificate installed, you may want to access the x-callback-url server via https as well.

"http"
name: string

Name of the platform bridge.

"Homebridge Shortcuts Buttons"
services: {
    serviceName: string;
    shortcutName: string;
}[]

List of buttons configuration objects.

Type declaration

  • serviceName: string

    A name to display for this button.

  • shortcutName: string

    Name of the Apple Shortcut to trigger, as displayed in the Shortcuts app. The machine running Homebridge must have access to it (i.e. be logged to the correct iCloud account).

1

serviceType: "Outlet" | "Switch"

Display the buttons services as outlets or as switches.

"Outlet"