npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-schedule

v1.0.136

Published

Scheduled, repeatable triggers for Homebridge automation with HomeKit

Downloads

25

Readme

Automate Homebridge based on interval or cron

CI/CD npm downloads

verified-by-homebridge

This Homebridge plugin allows you to create HomeKit automations for more than just the default "A time of day occurs"

The original thought for this was to create an hourly automation to check my thermostat in the house and send me a notification if it was above or below a certain threshold

Homebridge-Schedule is similar to Homebridge-Dummy, in the sense that it creates some dummy switches in HomeKit that turn on at your desired interval. They will turn off one second later. This is useful for triggering automations, or even shortcuts.

Installation

sudo npm i homebridge-schedule@latest -g

Usage

Interval Based

Add accessories to your config.json similar to below for interval based schedules:

{
  "accessories": [
    {
      "accessory": "Schedule",
      "name": "Hourly",
      "interval": 60,
      "serial": "123456789"
    }
  ]
}

| Property | Description | | --------- | --------------------------------------------------------------------- | | Accessory | Must be "Schedule" | | Name | Unique name for the dummy switch | | Interval | Interval, in minutes | | Serial | Serial number to give the accessory in HomeKit. Defaults to 123456789 |

Upon startup of Homebridge, the device will turn on at the specified interval

Notes

The interval starts when Homebridge is started up. If you want something to run hourly on the hour, then you need to make sure Homebridge is started up on the hour

Cron Based

Add accessories to your config.json similar to below for cron based schedules:

{
  "accessories": [
    {
      "accessory": "Schedule",
      "name": "Hourly",
      "cron": "* * * * * *",
      "serial": "123456789"
    }
  ]
}

| Property | Description | | --------- | --------------------------------------------------------------------- | | Accessory | Must be "Schedule" | | Name | Unique name for the dummy switch | | Cron | Cron string | | Serial | Serial number to give the accessory in HomeKit. Defaults to 123456789 |

Cron string details: https://www.npmjs.com/package/cron

Cron string uses seconds, so for an hourly cron string use:

"0 0 * * * *"

"{seconds} {minutes} {hours} {days} {months} {weeks}"

Use Cases

I have created a "room" called Automation in my HomeKit, which then allows me to create an automation "When the Automation Hourly turns on" to check my thermostat temperature, check the current outside temperature at my house, and based on some conditions, set the thermostat.

Steps:

  1. Create new automation based on "An Accessory is Controlled"
  2. Find your newly created dummy switch
  3. Select Turns On and add any desired time or people conditions
  4. You can then choose a scene or another accessory to control, or at the very bottom, you can create a shortcut
  5. Done! You now have one automation for things you want to happen hourly rather than 24

Creating HomeKit Automations

Create new Accessory automation: Step1

Choose the accessory created by homebridge-schedule: Step2

Select when it turns on or turns off and any time or people configurations Step3

Scroll all the way to the bottom and choose Convert to Shortcut Step4

Create shortcut:

  1. Get the current temperature of a HomeKit thermostat
  2. Convert to Fahrenheit
  3. If the indoor temperature is greater than a threshold
    • Get current weather outside
    • Convert to Fahrenheit
    • If the current weather outside is also above a threshold
      • Turn on fans, set thermostat, etc.

Step5 Step5

Development

Clone the latest and run

npm run prep

to install packages and prep the git hooks