Tags: MQTT, Control4, Node.js
Objective: Create a Control4 Driver that controls the brightness and white temperature of multiple Zigbee lighting devices in order to smoothly change according to a dynamic circadian rhythm that is adjusted to the local sunrise and sunset time.
Stack: Control4, MQTT, REST API, Node.js
Approach: The Circadian Rhythm is a 24-hour internal clock that is running in the human brain and cycles between sleepiness and alertness at regular intervals. It is also known as the sleep/wake cycle. The aim of this project is to change the lighting inside a certain environment in order to help people focus more during daylight, and sleep better at night. To achieve this goal, I started by studying the Circadian Rhythm and analyzing examples of similar implementations, like long haul flights. I then created a Node.js service that provides sunrise, noon, and sunset times for any given location, expressed in longitude and latitude. I then created a Control4 driver that reads the GPS coordinates of the Control4 Director where it is running, passes them to the Node.js service through its REST API, and then calculates the appropriate brightness and white temperature every few minutes. It then updates all the lighting devices associated with it and smoothly changes the light in the environment.