0.2.2 • Published 7 months ago

@uboness/homebridge-virtual v0.2.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

Homebridge Virtual Plugin

Enables defining virtual accessories/devices.

!! Experimental !!

Settings

Light Switch Button Garage Door Lock Outlet Smoke Sensor Contact Sensor Motion Sensor Leak Sensor CO Sensor CO2 Sensor

Light

A virtual light.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typelightrequiredMust be set to light
namestringoptionalWill determine the name of the device
dimmerbooleanoptionalDetermines whether this light can be dimmed
variantrgb or warm-coldoptionalDetermines the type of light. An RGB light or a light with varying color temperatures

Example:

{
  "id": "test",
  "name": "Test Light",
  "type": "light",
  "dimmer": true,
  "variant": "rgb"
}

Switch

A virtual switch. Can be configured to auto-close after a specific timeout.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typeswitchrequiredMust be set to switch
namestringoptionalWill determine the name of the device
turnOffAfternumberoptionalWhen set, the switch will automatically turn off after this number of seconds

Example:

{
    "id": "switch",
    "name": "Test Switch",
    "type": "switch",
    "turnOffAfter": 5000
}

Button

A virtual button accessory. Next to the main StatelessProgrammableSwitch button. This accessory will also create 3 additional swtiches:

  • singlePress - will trigger a singlePress event for the button
  • doublePress - will trigger a doublePress event for the button
  • longPress - will trigger a longPress event for the button
ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typebuttonrequiredMust be set to button
namestringoptionalWill determine the name of the device
singlePressstringoptionalDetermines the name of the single press switch that will be created. Can be left empty to avoid creating this button
doublePressstringoptionalDetermines the name of the double press switch that will be created. Can be left empty to avoid creating this button
longPressstringoptionalDetermines the name of the long press switch that will be created. Can be left empty to avoid creating this button

Example:

Here, two momentary switches will be created:

  • Turn On switch that will trigger the single press event of the button
  • Turn Off switch that will trigger the double press event of the button

No switch will be created for the long press event.

{
    "id": "button",
    "type": "button",
    "name": "Test Button",
    "singlePress": "Turn On",
    "doublePress": "Turn Off"
}

Garage Door

A virtual garage door accessory.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typegarage-doorrequiredMust be set to garage-door
namestringoptionalWill determine the name of the device
openingTimenumberoptionalSimulates the time it takes to open the door (in seconds). Defaults to 10 seconds.
closingTimenumberoptionalSimulates the time it takes to close the door (in seconds). Defaults to openingTime or 10 seconds

Example:

{
  "id": "garage",
  "name": "Garage",
  "type": "garage-door",
  "openingTime": 10,
  "closingTime": 5
}

Lock

A virtual Lock accessory.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typelockrequiredMust be set to lock
namestringoptionalWill determine the name of the device

Example:

{
    "id": "test-lock",
    "type": "lock",
    "name": "Test Button"
}

Outlet

A virtual outlet accessory.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typeoutletrequiredMust be set to outlet
namestringoptionalWill determine the name of the device
turnOffAfternumberoptionalWhen set, the outlet will automatically turn off after this number of seconds

Example:

{
    "id": "test-outlet",
    "type": "outlet",
    "name": "Test Outlet"
}

Smoke Sensor

A virtual smoke sensor accessory. The sensor will have a switch to control the smoke alert - when the switch is turned on the smoke alert will be triggered.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typesmoke-sensorrequiredMust be set to smoke-sensor
namestringoptionalWill determine the name of the device
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-smoke-sensor",
    "type": "smoke-sensor",
    "name": "Test Smoke Sensor",
    "hasBattery": true
}

Contact Sensor

A virtual contact sensor accessory. The sensor will have a switch to control the contact alert - when the switch is turned on the contact alert will be triggered.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typecontact-sensorrequiredMust be set to contact-sensor
namestringoptionalWill determine the name of the device
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-contact-sensor",
    "type": "contact-sensor",
    "name": "Test Contact Sensor",
    "hasBattery": true
}

Motion Sensor

A virtual motion sensor accessory. The sensor will have a button to trigger a motion alert - The timeout parameter determines how long the sensor maintains its "detected" state, after which it will reset to "not detected". If a motion is triggered while the sensor is in a "detected" state, the timeout will reset - meaning, the motion state will be set to "not detected" after the timeout has passed since the last motion trigger.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typemotion-sensorrequiredMust be set to motion-sensor
namestringoptionalDetermine the name of the device
motionTimeoutnumberoptionalWhen set, the trigger switch acts as a motion signal button which when pressed will put the sensor in a "detected" state for the duration of the timeout (in seconds).Every press (motion signal) resets any existing timeout.
asOccupancybooleanoptionalwhen true this sensor will show up as an occupancy sensor (default: false)
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-motion-sensor",
    "type": "motion-sensor",
    "name": "Test Motion Sensor",
    "timeout": 30,
    "hasBattery": true
}

Leak Sensor

A virtual leak sensor accessory. The sensor will have a switch to control the leak alert - when the switch is turned on the leak alert will be triggered.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typeleak-sensorrequiredMust be set to leak-sensor
namestringoptionalWill determine the name of the device
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-leak-sensor",
    "type": "leak-sensor",
    "name": "Test Leak Sensor",
    "hasBattery": true
}

CO Sensor

A virtual CO sensor accessory. The sensor will have a switch to control the CO alert - when the switch is turned on the CO alert will be triggered.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typeco-sensorrequiredMust be set to co-sensor
namestringoptionalWill determine the name of the device
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-co-sensor",
    "type": "co-sensor",
    "name": "Test CO Sensor",
    "hasBattery": true
}

CO2 Sensor

A virtual CO2 sensor accessory. The sensor will have a switch to control the CO2 alert - when the switch is turned on the CO2 alert will be triggered.

ParameterstyperequiredDescription
idstringrequiredMust be unique among all configured devices. Changing the id will remove previously added devices which also means all related automations will be removed
typeco2-sensorrequiredMust be set to co2-sensor
namestringoptionalWill determine the name of the device
hasBatterybooleanoptionalWhen true a battery alert simulation switch will be added (when turned on, the battery alert of the sensor will be triggered)
hasFaultbooleanoptionalWhen true a fault status alert simulation switch will be added (when turned on, the fault status alert of the sensor will be triggered)
hasTamperedbooleanoptionalWhen true a tampered status alert simulation switch will be added (when turned on, the tampered status alert of the sensor will be triggered)

Example:

{
    "id": "test-co2-sensor",
    "type": "co2-sensor",
    "name": "Test CO2 Sensor",
    "hasBattery": true
}

Development

If not installed yet, install Homebridge

sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x

and

npm link

Build:

pn build

Run homebridge:

homebridge -D -I -U .homebridge
0.2.2

7 months ago

0.2.1

9 months ago

0.1.0

10 months ago

0.1.2

10 months ago

0.2.0

10 months ago

0.1.1

10 months ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago