Table of Contents
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.
- A Tuya supported smart bulb.
- Follow instructions here to get the
localKey
for your light. - Create a Google Cloud Project with access to Google Calendar API and place the
client_secret.json
inconfig/
folder.
- Install all dependencies
yarn install
- Authorize your Google Project to access your calendar.
yarn authorize
- Create
device.json
file inconfig
folder with id and localKey{ "id": "xxxxx", "localKey": "yyyyy" }
- Execute
node index.js
to change the colour of the bulb. - Configure a cron job to run the script every 2 minutes (check attached launchd plist).
The following colour changes are supported.
- 🔴 : DND mode; An event name in calendar contains
DND_EVENT_NAMES
incalendar.js
- 🟠 : Amber; Meeting ongoing.
- 🟢 : Available.
- 🔵 : Error.
Distributed under the MIT License. See LICENSE.md
for more information.