Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.93 KB

README.md

File metadata and controls

77 lines (54 loc) · 1.93 KB
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)