Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents
  1. About The Project
  2. Prerequisites
  3. Getting Started
  4. Colours
  5. License

About The Project

A NodeJS script that can be run periodically to check your calendar and change the colour of a smart bulb to Red-Amber-Green depending on your availability.

(back to top)

Prerequisites

  1. A Tuya supported smart bulb.
  2. Follow instructions here to get the localKey for your light.
  3. Create a Google Cloud Project with access to Google Calendar API and place the client_secret.json in config/ folder.

Getting Started

  1. Install all dependencies
    yarn install
  2. Authorize your Google Project to access your calendar.
    yarn authorize
  3. Create device.json file in config folder with id and localKey
    {
       "id": "xxxxx",
       "localKey": "yyyyy"
    }
  4. Execute node index.js to change the colour of the bulb.
  5. Configure a cron job to run the script every 2 minutes (check attached launchd plist).

(back to top)

Colours

The following colour changes are supported.

  • 🔴 : DND mode; An event name in calendar contains DND_EVENT_NAMES in calendar.js
  • 🟠 : Amber; Meeting ongoing.
  • 🟢 : Available.
  • 🔵 : Error.

(back to top)

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

About

A NodeJS script that checks Google calendar events and changes a Tuya smart bulb's colour to Red-Amber-Green based on your availability.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages