Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
homebridge-delay-switch
Advanced tools
Delay switches for Homebridge: https://github.com/nfarina/homebridge
With this plugin, you can create any number of fake switches that will start a timer when turned ON, when the delay time is reached the switch will automatically turn OFF and trigger a dedicated sensor (motion/contact/occupancy) for 3 seconds. This can be very useful for advanced automation with HomeKit scenes - when delayed actions are required.
This plugin is Homebridge verified and HOOBS certified and can be easily installed and configured through their UI.
If you don't use Homebridge UI or HOOBS, keep reading:
sudo npm install -g homebridge-delay-switch
"accessories": [
{
"accessory": "DelaySwitch",
"name": "DelaySwitch",
"delay": 5000,
"sensorType": "motion",
"flipSensorState": false,
"startOnReboot": false
}
]
Parameter | Description | Required | Default | type |
---|---|---|---|---|
accessory | always "DelaySwitch" | ✓ | - | String |
name | Name for your accessory | ✓ | - | String |
delay | Delay/Timer in milliseconds | ✓ | - | Integer |
sensorType | The sensor type that will trigger when the time has ended (null for no sensor) | "motion" | Integer | |
flipSensorState | Flips the trigger sensor state (close/open, detected/not detected) | false | Boolean | |
startOnReboot | When set to true , the switch will be turned ON and start the timer when HomeBridge restarts | false | Boolean |
The most common use of this plugin is to turn ON/OFF lights based on a motion/door sensor. This can be achieved by setting an automation to turn ON a light and the delay switch when motion is detected and turn OFF the light when the dedicated delay sensor is triggered (or delay switch is turned OFF).
Another great example, when using a smart wall switch (to turn ON) and RGB light bulb (to switch color) together on the same scene can cause no action on the bulb since the bulb might not even be ON when the command is sent from Homebridge. To fix this, we can set an automation to change the bulb color a few seconds after the wall switch ON command.
Also it can be use with any device that requires a certain delay time after other devices (TV + RPi-Kodi / PC + SSH / etc...)
Basically, all you need to do is:
delay
time in the config file (in milliseconds).A sensor (motion/contact/occupancy) is created for each accessory in order to be able to cancel the timer and the attached automations.
How does it works? You can set the automation to be triggered from the attached "trigger" sensor instead of the switch OFF command and therefore you can turn OFF the switch and prevent the sensor from triggering or any attached automations from executing.
If you have no use of the sensor you can remove it by setting "sensorType": null
to your config.
When manualy turning OFF the switch, the timer will stop and the sensor will NOT be triggered.
When the delay switch receives ON command while it's already ON, the timer will restart and the sensor trigger will be delayed.
homebridge-delay-switch is a free plugin under the MIT license. it was developed as a contribution to the homebridge/hoobs community with lots of love and thoughts. Creating and maintaining Homebridge plugins consume a lot of time and effort and if you would like to share your appreciation, feel free to "Star" or donate.
FAQs
Delay switches for Homebridge
The npm package homebridge-delay-switch receives a total of 23 weekly downloads. As such, homebridge-delay-switch popularity was classified as not popular.
We found that homebridge-delay-switch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.