• Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dummy switches for Homebridge: https://github.com/nfarina/homebridge

"Dummy Switches" Plugin

Example config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Switch 1",
          "disableLogging": false
        }   
    ]

With this plugin, you can create any number of fake switches that will do nothing when turned on (and will automatically turn off right afterward, simulating a stateless switch). This can be very useful for advanced automation with HomeKit scenes.

For instance, the Philips Hue app will automatically create HomeKit scenes for you based on Hue Scenes you create. But what if you want to create a scene that contains both Philips Hue actions and other actions (like turning on the coffee maker with a WeMo outlet)? You are forced to either modify the Hue-created scene (which can be a HUGE list of actions if you have lots of lights) or build your own HomeKit lighting scenes.

Instead, you can link scenes using these dummy switches. Let's say you have a Hue Scene called "Rise and Shine" that you want to activate in the morning. And you have also setup the system HomeKit scene "Good Morning" to turn on your coffee maker and disarm your security system. You can add a single dummy switch to your Good Morning scene, then create a Trigger based on the switching-on of the dummy switch that also activates Rise And Shine.

If the disableLogging option is true, state changes (On/Off) will not be logged. The disableLogging option is per switch, so you can choose which ones will get log entries. If not supplied, the default value is false and state changes will be logged.

Stateful Switches

The default behavior of a dummy switch is to turn itself off one second after being turned on. However you may want to create a dummy switch that remains on and must be manually turned off. You can do this by passing an argument in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Switch 1",
          "stateful": true
        }   
    ]

Dimmer Switches

By default, switches are toggle switches (on/off). You can configure your switch to be a dimmer switch, instead, storing a brightness value between 0 and 100. This can be done by passing the 'dimmer' argument in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Switch 1",
          "dimmer": true
        }
    ]

Reverse Switches

You may also want to create a dummy switch that turns itself on one second after being turned off. This can be done by passing the 'reverse' argument in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Switch 1",
          "reverse": true
        }   
    ]

Timed Switches

You may also want to create a timed switch that turns itself off after being on for a given time (for example, five seconds). This can be done by passing the 'time' argument in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Switch 1",
          "time": 5000
        }   
    ]

Resettable Timed Switches

You may also want to create a timed switch that is reset each time it is activated. This way, the original timer is reset instead of creating a new timer. This can be done by passing the 'resettable' argument in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Switch 1",
          "time": 5000,
          "resettable": true
        }   
    ]

Random Timed Switches

You might want to create a switch that given a random time turns itself off. This can be achieved by enabling 'random'. Each time a non-stateful, random timed switch is triggered, the time is set to a random value between 0 and 'time' milliseconds. A random period within one hour is defined as follows in your config.json:

    "accessories": [
        {
          "accessory": "DummySwitch",
          "name": "My Stateful Random Switch 1",
          "time": 3600000,
          "random": true
        }
    ]

More Repositories

1

calloutview

A lightweight callout view class for iOS mimicking UICalloutView.
Objective-C
1,197
star
2

feeds

Keep tabs on your favorite website and RSS feeds from your Mac's menubar.
Objective-C
323
star
3

xmldocument

A lightweight XML Document class for iOS.
Objective-C
276
star
4

xmldoc

A lightweight XML Document class for JavaScript.
JavaScript
269
star
5

homebridge-tesla

Tesla plugin for homebridge: https://github.com/nfarina/homebridge
TypeScript
155
star
6

homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
JavaScript
155
star
7

webrequest

A lightweight class for iOS for making asynchronous web requests.
Objective-C
102
star
8

modelobject

ObjC Model Object class using new language features.
Objective-C
69
star
9

dropdav

WebDAV frontend for Dropbox.
Python
66
star
10

homebridge-legacy-plugins

Legacy plugins for Homebridge: https://github.com/nfarina/homebridge
JavaScript
35
star
11

simpledav

Simple WebDAV Server for Google App Engine
Python
31
star
12

homebridge-liftmaster

LiftMaster support for Homebridge: https://github.com/nfarina/homebridge
JavaScript
23
star
13

homebridge-kevo

Kevo support for Homebridge: https://github.com/nfarina/homebridge
HTML
21
star
14

homebridge-eightsleep

Eight Sleep plugin for homebridge: https://github.com/nfarina/homebridge
TypeScript
11
star
15

homebridge-lockitron

Lockitron support for Homebridge: https://github.com/nfarina/homebridge
JavaScript
8
star
16

homebridge-icontrol

iControl (Xfinity Home) for Homebridge: https://github.com/nfarina/homebridge
JavaScript
7
star
17

homebridge-philipshue

PhilipsHue plugin for homebridge: https://github.com/nfarina/homebridge
JavaScript
3
star
18

pooljs

Manage parallel workers with optional rate limits
TypeScript
1
star
19

run

Executes scripts in your package.json much faster than NPM or Yarn, especially for projects using Yarn Workspaces. And with less typing.
TypeScript
1
star
20

homebridge-stack

Stack Lighting plugin for homebridge: https://github.com/nfarina/homebridge
1
star