JSPM

  • Created
  • Published
  • Downloads 1481
  • Score
    100M100P100Q113926F
  • License Apache-2.0

Dummy devices for Homebridge

Package Exports

  • homebridge-dummy
  • homebridge-dummy/dist/homebridge/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (homebridge-dummy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

homebridge-dummy

Homebridge plugin to create fake accessories for assisting with advanced Apple HomeKit automations

verified-by-homebridge hoobs-certified npm npm

Disclaimer

Any issues or damage resulting from use of this plugin are not the fault of the developer. Use at your own risk.

v1.0 Migration

tl;dr

‼️ There are significant code changes between v0.9 and v1.0 which means you will need to reconfigure HomeKit automations after upgrading. Homebridge Dummy will try to migrate old accessories in Homebridge so you don't need to recreate everything.

Why?

The original HomebridgeDummy was written almost 10 years ago and uses the now deprecated Accessory Plugin architecture.

While this still works okay for now, migrating the code to use Platform Plugins will future-proof Homebridge Dummy and allow for more modern and robust design patterns.

v1.0 doesn't include any new features but will make it much easier to improve and extend this plugin going forward.

Drawbacks

Unfortunately, there is no built-in way to migrate existing accessory plugins to platform plugins. This means that all accessories will be considered "new" by HomeKit, so any existing automations or room setups will be lost.

However, Homebridge Dummy will try to migrate the accessory configurations to the new system to prevent you having to set them all up again in Homebridge.

Migration Flow

Once you have installed v1.0, click on the icon to configure the Homebridge Dummy plugin in the Homebridge UI and it will walk you through the necessary questionnaire.

Alternatively, you can add the following to "platforms" in your config.json

{
    "name": "Homebridge Dummy",
    "platform": "HomebridgeDummy",
    "migrationNeeded": true
}

You will need to restart Homebridge after completing the flow for changes to take effect.

⚠️ If you are using child bridges with v0.9, you will need to restart Homebridge twice for migrated accessories to show up correctly.

You may safely ignore any "No plugin was found…" errors you see in the Homebridge logs. These should go away after a few Homebridge restarts.

Problems?

This is a highly experimental flow and may not work as intended. If you see "Sorry, something went wrong with the accessory migration" or encounter other issues, please create an issue.

The first thing the flow does is create a backup called config.json.bak in your Homebridge directory. If all else fails, you can replace your config.json with the backup and downgrade to Homebridge Dummy v0.9 to restore everything back to normal.

About

With this plugin, you can create any number of fake accessories that will do nothing when triggered. This can be very useful for advanced automation with HomeKit scenes.

Currently, only Lightbulbs and Switches are supported but we plan to add more options over the coming months.

Configuration

Using the Homebridge Config UI is the easiest way to set up this plugin. However, if you wish to do things manually then you will need to add the following to your Homebridge config.json:

{
    "name": "Homebridge Dummy",
    "accessories": [
        {
            "name": "string",
            "type": "Lightbulb | Switch",
            "timer": {
                "delay": 1,
                "units": "SECONDS | MINUTES | HOURS",
                "random": false
            },
            "defaultOn": false,
            "defaultBrightness": 100,
            "disableLogging": false
        }
        // ...additional accessories...
    ],
    "platform": "HomebridgeDummy"
}

All fields are optional unless noted with an asterisk (*)

  • name* - The display name for the accessory in HomeKit

  • type* - The type of accessory, currently Lightbulb and Switch are supported

  • timer.delay — If defined, the switch will automatically toggle after this many seconds/minutes/hours

  • timer.units — The units to use for delay above (SECONDS, MINUTES, or HOURS). *Required if delay is set.

  • timer.random — If true, the delay will be randomized with a maximum value of timer.delay

  • defaultOn — If true, the states are reversed so that the default state is on. Only applicable to Switches.

  • defaultBrightness — If set, lightbulb will have additional dimmer settings with this default brightness percentage

  • disableLogging — If true, state changes will not be logged

Examples

Stateful Switch

{
    "name": "Stateful",
    "type": "Switch"
}

Timer Switch

{
    "name": "Timer",
    "type": "Switch",
    "timer": {
        "delay": 10,
        "units": "SECONDS"
    }
}

"Reversed" Switch (i.e. Default On)

{
    "name": "Default On",
    "type": "Switch",
    "timer": {
        "delay": 5,
        "units": "SECONDS"
    },
    "defaultOn": true
}

Timer Lightbulb

{
    "name": "Lightbulb",
    "type": "Lightbulb",
    "timer": {
        "delay": 5,
        "units": "SECONDS"
    }
}

Stateful Dimmer Lightbulb

{
    "name": "Dimmer",
    "type": "Lightbulb",
    "defaultBrightness": 42
}

Random Timer Switch

{
    "name": "Random",
    "type": "Switch",
    "timer": {
        "delay": 2,
        "units": "MINUTES",
        "random": true
    }
}

Credits

Special thanks to @nfarina for creating the original version of this plugin and maintaining it for almost 10 (!!!) years

And to the amazing creators/contributors of Homebridge who made this plugin possible!