Homebridge-Schedule
This Homebridge plugin allows you to create Homekit automations for more than just the default "A time of day occurrs"
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
}
]
}
Property | Description |
---|---|
Accessory | Must be "Schedule" |
Name | Unique name for the dummy switch |
Interval | Interval, in minutes |
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": "* * * * * *"
}
]
}
Property | Description |
---|---|
Accessory | Must be "Schedule" |
Name | Unique name for the dummy switch |
Cron | Cron string |
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 thrermostat temperature, check the current outside temperature at my house, and based on some conditions, set the thermostat.
Steps:
- Create new automation based on "An Accessory is Controlled"
- Find your newly created dummy switch
- Select Turns On and add any desired time or people conditions
- You can then choose a scene or another accessory to control, or at the very bottom, you can create a shortcut
- Done! You now have one automation for things you want to happen hourly rather than 24
Creating HomeKit Automations
Create new Accessory automation:
Choose the accessory created by homebridge-schedule:
Select when it turns on or turns off and any time or people configurations
Scroll all the way to the bottom and choose Convert to Shortcut
Create shortcut:
- Get the current temperature of a Homekit thermostat
- Convert to Fahrenheit
- 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.