Code Monkey home page Code Monkey logo

homebridge-cron-switch's Introduction

Homebridge CRON Switch

A homebridge plugin that exposes to Homekit a switch that is momentarily turned on using a schedule derived from a CRON job expression.

Configration

Configuration can be done using Homebridge Config UI X.

Sample Configuration

"accessories": [
    {
      "accessory": "CronSwitch",
      "name": "Turn Something On Every 5 Seconds Switch",
      "cron": "0/5 * * * * *"
    }   
]

The above configuration will result in this:

Switch

Configuration Definition

  • accessory: The identifier for the accessory (CronSwitch).
  • name: The name of the switch exposed.
  • cron: The cron expression.

homebridge-cron-switch's People

Contributors

kurtwarwick-new avatar

Stargazers

 avatar Shaun Grady avatar

Watchers

 avatar

homebridge-cron-switch's Issues

CRON sensor ?

Nice plugin, works perfectly, but there is one small problem. Not every automation can be set to run with a switch. In my case, a sensor is required and only the sensor can trigger my automation.

Is it possible to change this plugin to make it visible as a motion or presence sensor?

Error: Too many fields

Have been using this plugin before running in Homebridge, but did not need it for a while so I uninstalled it. Now I need it again so tried to re-install, so did that using the UI config panel in HB, but HomeBridge gives me error below when I try to restart the server. Have tried to install other plugins and they work fine.
Fair warning, I'm in no way a programmer and the whole HomeBrigde thing is new to me, so this might be caused by user error.

[2/11/2021, 5:44:18 PM] Error: Too many fields
    at CronTime._parse (/usr/local/lib/node_modules/homebridge-cron-switch/node_modules/cron/lib/cron.js:421:11)
    at new CronTime (/usr/local/lib/node_modules/homebridge-cron-switch/node_modules/cron/lib/cron.js:46:9)
    at new CronJob (/usr/local/lib/node_modules/homebridge-cron-switch/node_modules/cron/lib/cron.js:565:19)
    at Accessory.configureAccessory (/usr/local/lib/node_modules/homebridge-cron-switch/src/accessory.js:41:19)
    at new Accessory (/usr/local/lib/node_modules/homebridge-cron-switch/src/accessory.js:21:14)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
    at Array.forEach (<anonymous>)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:330:29)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:12)
    at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
[2/11/2021, 5:44:18 PM] Got SIGTERM, shutting down Homebridge...

Not work

I have created two switches and want one to turn on at 9:00 and turn off at 17:00. The other should switch on and off every minute.
0 9,17 * * *
*/1 * * * *
however, the switch now flashes briefly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.