Skip to content

Accessory Simulations

Ben edited this page Mar 3, 2021 · 80 revisions

An accessory simulation can be used to create a custom accessory in Homebridge/HomeKit from a generic single/multi-channel device.

For example, a Sonoff Dual would, by default, appear in Homebridge as two switches. If this device were wired to a garage door then you could use an accessory simulation to make the device appear as a garage door accessory in Homebridge rather than two switches.

⚠️ After setting up any Accessory Simulation in the configuration, you may need to remove the existing accessory from the cache so that it removes any existing switch services (otherwise the accessory will appear duplicated in HomeKit)

Please do take note as these accessory simulations require specific setup and configuration.

  • For any of these setups, you can use the label option within the json config block which has no effect except to be a helpful label for identifying which device this is when editing the configuration.

  • For any of these setups, you can use the overrideDisabledLogging option within the json config block to enable logging for your accessory if you have the general disableDeviceLogging set to true.

  • For any of these setups which use a LAN mode compatible device (for example Sonoff BASIC, MINI) you can use the ipAddress option within the json config block to manually set the IP for this device if the plugin cannot obtain the IP automatically.

Available Simulations

Separate Wiki Articles

On This Page


1 Garage Door (w/ single-channel device)

It is important to have the device "inched" via the eWeLink app (I would recommend 0.5 seconds).

Your garage door must be able to respond to this "pulse" by starting to move up/down and then stopping with another "pulse". The plugin will send an initial request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) and the garage door will start moving. The plugin will then send another request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) after the operationTime configuration setting to stop the garage door moving after the appropriate time.

The operationTime is defined in deciseconds so time how long it takes to open/close the garage and multiply this by ten.

Since it is impossible for the switch to report the correct position of the garage door to Homebridge, the plugin relies on a cached state which changes each time the garage door is opened/closed. There may be times when this becomes out of sync. If this happens, please make sure the garage door is fully closed, then remove the accessory from the Homebridge cache using this guide. The accessory will be added again with a CLOSED status which will match the garage door.

It is possible to use a Sonoff DW2 sensor to determine the correct position of the garage door, using the sensorId option.

It is also possible to use an existing Sonoff single-channel device (BASIC, MINI, etc) as a DIY method to set the Obstruction Detected property of the garage. If the switch is ON then Obstruction Detected will be set to Yes. This can be configured using the obstructId option.

A simple configuration example without a sensor or switch for Obstruction Detected:

[
   {
      "deviceId": "10009553c8",
      "type": "garage",
      "setup": "oneSwitch",
      "operationTime": 100
   }
]

A more complex example with both a sensor and a switch for Obstruction Detected:

[
   {
      "deviceId": "10009553c8",
      "type": "garage",
      "setup": "oneSwitch",
      "operationTime": 75,
      "sensorId": "10009553c9",
      "obstructId": "10009553c0"
   }
]

1 Garage Door (w/ multi-channel device)

It is important to have:

  • channel 0 connected to the "up" motor and channel 1 connected to the "down" motor, and
  • both channels "inched" via the eWeLink app (I would recommend 0.5 seconds).

Your garage door must be able to respond to this "pulse" by starting to move up/down and then stopping with another "pulse". The plugin will send an initial request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) and the garage door will start moving. The plugin will then send another request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) after the operationTime configuration setting to stop the garage door moving after the appropriate time.

The operationTime is defined in deciseconds so time how long it takes to open/close the garage and multiply this by ten.

It is possible to use a Sonoff DW2 sensor to determine the correct position of the garage door, using the sensorId option.

It is also possible to use an existing Sonoff single-channel device (BASIC, MINI, etc) as a DIY method to set the Obstruction Detected property of the garage. If the switch is ON then Obstruction Detected will be set to Yes. This can be configured using the obstructId option.

An simple configuration example without a sensor or switch for Obstruction Detected:

[
   {
      "deviceId": "10009553c8",
      "type": "garage",
      "setup": "twoSwitch",
      "operationTime": 50
   }
]

A more complex example with both a sensor and a switch for Obstruction Detected:

[
   {
      "deviceId": "10009553c8",
      "type": "garage",
      "setup": "twoSwitch",
      "operationTime": 120,
      "sensorId": "10009553c9",
      "obstructId": "10009553c0"
   }
]

2 Garage Doors (w/ multi-channel device)

It is important to have:

  • channel 0 connected to the "up" motor and channel 1 connected to the "down" motor for the first garage
  • channel 2 connected to the "up" motor and channel 3 connected to the "down" motor for the second garage, and
  • all channels "inched" via the eWeLink app (I would recommend 0.5 seconds).

Your garage doors must be able to respond to this "pulse" by starting to move up/down and then stopping with another "pulse". The plugin will send an initial request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) and the garage door will start moving. The plugin will then send another request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) after the operationTime configuration setting to stop the garage door moving after the appropriate time.

The operationTime is defined in deciseconds so time how long it takes to open/close the garage and multiply this by ten.

An simple configuration example:

[
   {
      "deviceId": "10009553c8",
      "type": "garage_two",
      "operationTime": 95
   }
]

4 Garage Doors (w/ multi-channel device)

It is important to have all four device channels "inched" via the eWeLink app (I would recommend 0.5 seconds).

Your garage doors must be able to respond to this "pulse" by starting to move up/down and then stopping with another "pulse". The plugin will send an initial request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) and the garage door will start moving. The plugin will then send another request to turn the switch ON (and then be turned off by the eWeLink "inching" setting) after the operationTime configuration setting to stop the garage door moving after the appropriate time.

The operationTime is defined in deciseconds so time how long it takes to open/close the garages and multiply this by ten.

Since it is impossible for the switch to report the correct position of the garage doors to Homebridge, the plugin relies on a cached state which changes each time the garage doors are opened/closed. There may be times when this becomes out of sync. If this happens, please make sure all the garage doors are fully closed, then remove the accessory from the Homebridge cache using this guide. The accessory will be added again with a CLOSED status which will match the garage doors.

An simple configuration example:

[
   {
      "deviceId": "10009553c8",
      "type": "garage_four",
      "operationTime": 105
   }
]

1 Window Blind (w/ multi-channel device)

It is important to have:

  • channel 0 connected to the "up" motor and channel 1 connected to the "down" motor

When fully opening/closing the blind, the plugin will turn the appropriate channel ON for the duration of the specified operationTime and then turn the channel OFF. When opening/closing the blinds to a custom position (e.g. 50% open) then the plugin will calculate the time that the channels need to be ON based on the operationTime.

The operationTime is defined in deciseconds so time how long it takes to open/close the window blind and multiply this by ten.

Since it is impossible for the device to report the correct position of the window blind to Homebridge, the plugin relies on a cached state which changes each time the blind is opened/closed. There may be times when this becomes out of sync. If this happens, please make sure the blind is fully closed, then remove the accessory from the Homebridge cache using this guide. The accessory will be added again with a CLOSED status which will match the blind.

A configuration example:

[
   {
      "deviceId": "10009553c8",
      "type": "blind",
      "operationTime": 80
   }
]

1 Door (w/ multi-channel device)

It is important to have:

  • channel 0 connected to the "open" motor and channel 1 connected to the "close" motor

When fully opening/closing the door, the plugin will turn the appropriate channel ON for the duration of the specified operationTime and then turn the channel OFF. When opening/closing the door to a custom position (e.g. 50% open) then the plugin will calculate the time that the channels need to be ON based on the operationTime.

The operationTime is defined in deciseconds so time how long it takes to open/close the door and multiply this by ten.

Since it is impossible for the device to report the correct position of the door to Homebridge, the plugin relies on a cached state which changes each time the door is opened/closed. There may be times when this becomes out of sync. If this happens, please make sure the door is fully closed, then remove the accessory from the Homebridge cache using this guide. The accessory will be added again with a CLOSED status which will match the door.

A configuration example:

[
   {
      "deviceId": "10009553c8",
      "type": "door",
      "operationTime": 50
   }
]

1 Window (w/ multi-channel device)

It is important to have:

  • channel 0 connected to the "open" motor and channel 1 connected to the "close" motor

When fully opening/closing the window, the plugin will turn the appropriate channel ON for the duration of the specified operationTime and then turn the channel OFF. When opening/closing the window to a custom position (e.g. 50% open) then the plugin will calculate the time that the channels need to be ON based on the operationTime.

The operationTime is defined in deciseconds so time how long it takes to open/close the window and multiply this by ten.

Since it is impossible for the device to report the correct position of the window to Homebridge, the plugin relies on a cached state which changes each time the window is opened/closed. There may be times when this becomes out of sync. If this happens, please make sure the window is fully closed, then remove the accessory from the Homebridge cache using this guide. The accessory will be added again with a CLOSED status which will match the window.

A configuration example:

[
   {
      "deviceId": "10009553c8",
      "type": "window",
      "operationTime": 100
   }
]

1 Lock (w/ single-channel device)

Single lock to mimic a "door-unlock" button

Available, documentation coming soon

1 Lock (w/ multi-channel device)

Single lock to mimic a "door-unlock" button

Available, documentation coming soon

1 Tap/Faucet (w/ single-channel device)

Available, documentation coming soon

1 Tap/Faucet (w/ multi-channel device)

Single lock to mimic a "door-unlock" button

Available, documentation coming soon

2 Taps/Faucets (w/ multi-channel device)

Available, documentation coming soon

1 Irrigation Valve (w/ single-channel device)

Available, documentation coming soon

1 Irrigation Valve (w/ multi-channel device)

Available, documentation coming soon

2 Irrigation Valves (w/ multi-channel device)

Available, documentation coming soon

Supported: Using this YUGE Device

4 Irrigation Valves (w/ multi-channel device)

Available, documentation coming soon

1 Switch + 1 Irrigation Valve (w/ multi-channel device)

Available, documentation coming soon