General Configuration

Configuration parameters

group MainConfiguration

Main configuration settings.

Defines

RUN_WITHOUT_WIFI

If you want to run the system in a minimal mode to test some basic functionality or debug something it could be useful to disable wifi functionality completely.

IS_BLYNK_ACTIVE

If you want Blynk functionality set this to true and set your authentication token. Otherwise set it to false.

BLYNK_AUTH_TOKEN

If you want Blynk functionality paste your authentication token here.

BLYNK_TEMPLATE_ID

Template ID for this device. If you want to use your own custom Template you will have to change this.

BLYNK_DEVICE_NAME

Name of this device in the Blynk app.

BLYNK_PRINT

In case the blynk communication is not working this line causes Blynk to send debug output to the serial port. If you are not worried about Blynk or have to diagnose some other issue you can comment this line out.

BLYNK_SERVER

Set the Blynk server address.

Note

I had troubles with using the proper blynk domain so I am using the IP address instead. Maybe this could create problems in the future so it is recommended to use the official domain.

ENABLE_OTA_UPLOAD

If you want to use OTA upload instead or in addition to the normal cable upload set this option to true. To actually flash something via OTA you have to uncomment the OTA flash lines in the platformio.ini file This is a nice addition to cable upload but it doesn’t replace it completely. If the microcontroller crashes because of bad configuration you still have to use a cable.

OTA_UPDATE_HOST_NAME

The host name that shall be used for OTA updates. If you change this here it must also be changed in the platformio.ini file.

NUM_RETRIES

The number of times the controller tries to connect to wifi before it fails and goes into smartConfig mode (if that is enabled)

USE_ESPTOUCH_SMART_CONFIG

Use the ESP smart config to setup the wifi network. If you want to set it manually set this to false.

WIFI_SSID

WIFI_SSID and WIFI_PW are only needed if smart setup is disabled.

WIFI_PW
HOUR_COLOR

Color of the hour segments, this will be the default color if blynk functionality is disabled.

MINUTE_COLOR

Color of the minute segments, this will be the default color if blynk functionality is disabled.

INTERNAL_COLOR

Color of the internal LEDs, this will be the default color if blynk functionality is disabled.

SEPARATION_DOT_COLOR

Color of the separation dot LEDs, this will be the default color if blynk functionality is disabled.

OTA_UPDATE_COLOR

Color of the LEDs for the OTA update progress bar.

WIFI_CONNECTING_COLOR

Color of the LEDs while searching for a WIFI network.

WIFI_CONNECTION_SUCCESSFUL_COLOR

Color of the LEDs signaling a successful WIFI connection.

WIFI_SMART_CONFIG_COLOR

Color of the LEDs if system is waiting for WIFI smart config.

ERROR_COLOR

Color of the LEDs signaling an error of some sort.

NTP_SERVER

Server for the time.

TIMEZONE_INFO

Enter the string for your timezone according to this webpage: https://remotemonitoringsystems.ca/time-zone-abbreviations.php.

TIME_SYNC_INTERVAL

Time in seconds for the interval in which the time should be synchronized with the time server.

TIMER_FLASH_TIME

Flash the current time in case a timer is expired instead of flashing 00:00.

TIMER_FLASH_COUNT

Number of flashes until an alarm is considered complete and the system goes back to normal.

ALARM_NOTIFICATION_PERIOD

For how long the Display should flash when an alarm was fired in seconds.

NOTIFICATION_BRIGHTNESS

How bright the clock should blink when an alarm or timer was triggered 0 - 255.

TIME_UPDATE_INTERVAL

How often the time is checked and the displays are updated.

DEFAULT_CLOCK_BRIGHTNESS

Default brightness of the display. If you are using blynk you may ignore this setting.

USE_NIGHT_MODE

Whether to activate night mode or not. If you want the clock to reduce brightness/switch off during certain hours set this to true. If you are using Blynk to control the settings of your clock you may ignore the default settings as they can be changed dynamically during runtime in that case.

DEFAULT_NIGHT_MODE_START_HOUR

Start hour for the night mode.

DEFAULT_NIGHT_MODE_START_MINUTE

Start minute for the night mode.

DEFAULT_NIGHT_MODE_END_HOUR

End hour for the night mode.

DEFAULT_NIGHT_MODE_END_MINUTE

End minute for the night mode.

DEFAULT_NIGHT_MODE_BRIGHTNESS

Brightness that the clock should be set to while night mode is active.

LED_DATA_PIN

Pin to which the led strip data pin is connected to.

NUM_SEGMENTS

Total number of segments that have LEDs in the shelf.

NUM_LEDS_PER_SEGMENT

Number of LEDs in each segment.

APPEND_DOWN_LIGHTERS

If you wired the down lighter LEDs to the end of the LED strips set this to true.

ADDITIONAL_LEDS

Number of LEDs For interior lights.

NUM_LEDS

Automatically calculated total number of LEDs used.

NUM_DISPLAYS

Number of displays in the shelf.

DISPLAY_0_AT_MIDNIGHT

If set to true the display will show 0 at midnight and 12 otherwise.

DISPLAY_SWITCH_OFF_AT_0

If set to true the higher displays will turn off in case they would show 0.

USE_24_HOUR_FORMAT

If set to true 24 hour format will be used. For this one additional column is needed in the shelf to display it correctly.

NUM_SEGMENTS_PROGRESS

The number of segments to use for displaying a progress bar for the OTA updates.

LOADING_ANIMATION_DURATION

The time is shall take for one iteration of the loading animation.

BRIGHTNESS_INTERPOLATION

How fast the brightness interpolation shall react to brightness changes.

DISPLAY_FOR_SEPARATION_DOT

If set to -1 the flashing middle dot is disabled, otherwise this is the index of the Display segment that should display the dot.

ANIMATION_TARGET_FPS

Target Frames per second for the smoothness of animations.

ANIMATION_AFTERGLOW

Length of sooth animation transition from fully on to black and vice versa in percent NOTE: The higher this number the less obvious easing effects like bounce or elastic will be.

DOT_FLASH_SPEED

Length of the dot/s fading animation. One flash fades in and out.

DOT_FLASH_INTERVAL

Interval in which the dot/s should flash.

NUM_SEPARATION_DOTS

Number of separation dots to use by default (or if no blynk functionality is available) allowed values are 1, 2 and 0 to turn it off.

ENABLE_LIGHT_SENSOR

Enable automatic brightness adjustments based on a light sensor.

LIGHT_SENSOR_PIN

ADC pin to which the light sensor is connected to.

LIGHT_SENSOR_AVERAGE

How many measurements shall be averaged. Higher number -> smoother but slower change.

LIGHT_SENSOR_MEDIAN_WIDTH

Width of the median calculation. Higher number -> smoother change Should never be higher than the LIGHT_SENSOR_AVERAGE.

LIGHT_SENSOR_READ_DELAY

Time that should pass before the light sensor is read again. Higher number -> slower adjustments but also changes will be more sudden.

LIGHT_SENSOR_MIN

AnalogRead value if the light sensor reads complete darkness.

LIGHT_SENSOR_MAX

AnalogRead value if the light sensor reads the brightest.

LIGHT_SENSOR_SENSITIVITY

Value between 0 and 255 that determines how much the light sensor values can influence the led brightness.

TIME_MANAGER_DEMO_MODE

enable for wifi less operation or to demo all the animations

DIGIT_ANIMATION_SPEED

The time it takes for one digit to morph into another.

FASTLED_SAFE_DELAY_MS

the minimum delay between calls of FastLED.show()

RUN_WITHOUT_WIFI

If you want to run the system in a minimal mode to test some basic functionality or debug something it could be useful to disable wifi functionality completely.

IS_BLYNK_ACTIVE

If you want Blynk functionality set this to true and set your authentication token. Otherwise set it to false.

BLYNK_AUTH_TOKEN

If you want Blynk functionality paste your authentication token here.

BLYNK_TEMPLATE_ID

Template ID for this device. If you want to use your own custom Template you will have to change this.

BLYNK_DEVICE_NAME

Name of this device in the Blynk app.

BLYNK_PRINT

In case the blynk communication is not working this line causes Blynk to send debug output to the serial port. If you are not worried about Blynk or have to diagnose some other issue you can comment this line out.

BLYNK_SERVER

Set the Blynk server address.

ENABLE_OTA_UPLOAD

If you want to use OTA upload instead or in addition to the normal cable upload set this option to true. To actually flash something via OTA you have to uncomment the OTA flash lines in the platformio.ini file This is a nice addition to cable upload but it doesn’t replace it completely. If the microcontroller crashes because of bad configuration you still have to use a cable.

OTA_UPDATE_HOST_NAME

The host name that shall be used for OTA updates. If you change this here it must also be changed in the platformio.ini file.

NUM_RETRIES

The number of times the controller tries to connect to wifi before it fails and goes into smartConfig mode (if that is enabled)

USE_ESPTOUCH_SMART_CONFIG

Use the ESP smart config to setup the wifi network. If you want to set it manually set this to false.

WIFI_SSID

WIFI_SSID and WIFI_PW are only needed if smart setup is disabled.

WIFI_PW
HOUR_COLOR

Color of the hour segments, this will be the default color if blynk functionality is disabled.

MINUTE_COLOR

Color of the minute segments, this will be the default color if blynk functionality is disabled.

INTERNAL_COLOR

Color of the internal LEDs, this will be the default color if blynk functionality is disabled.

SEPARATION_DOT_COLOR

Color of the separation dot LEDs, this will be the default color if blynk functionality is disabled.

OTA_UPDATE_COLOR

Color of the LEDs for the OTA update progress bar.

WIFI_CONNECTING_COLOR

Color of the LEDs while searching for a WIFI network.

WIFI_CONNECTION_SUCCESSFUL_COLOR

Color of the LEDs signaling a successful WIFI connection.

WIFI_SMART_CONFIG_COLOR

Color of the LEDs if system is waiting for WIFI smart config.

ERROR_COLOR

Color of the LEDs signaling an error of some sort.

NTP_SERVER

Server for the time.

TIMEZONE_INFO

Enter the string for your timezone according to this webpage: https://remotemonitoringsystems.ca/time-zone-abbreviations.php.

TIME_SYNC_INTERVAL

Time in seconds for the interval in which the time should be synchronized with the time server.

TIMER_FLASH_TIME

Flash the current time in case a timer is expired instead of flashing 00:00.

TIMER_FLASH_COUNT

Number of flashes until an alarm is considered complete and the system goes back to normal.

ALARM_NOTIFICATION_PERIOD

For how long the Display should flash when an alarm was fired in seconds.

NOTIFICATION_BRIGHTNESS

How bright the clock should blink when an alarm or timer was triggered : 0 - 255.

TIME_UPDATE_INTERVAL

How often the time is checked and the displays are updated.

DEFAULT_CLOCK_BRIGHTNESS

Default brightness of the display. If you are using blynk you may ignore this setting.

USE_NIGHT_MODE

Whether to activate night mode or not. If you want the clock to reduce brightness/switch off during certain hours set this to true. If you are using Blynk to control the settings of your clock you may ignore the default settings as they can be changed dynamically during runtime in that case.

DEFAULT_NIGHT_MODE_START_HOUR

Start hour for the night mode.

DEFAULT_NIGHT_MODE_START_MINUTE

Start minute for the night mode.

DEFAULT_NIGHT_MODE_END_HOUR

End hour for the night mode.

DEFAULT_NIGHT_MODE_END_MINUTE

End minute for the night mode.

DEFAULT_NIGHT_MODE_BRIGHTNESS

Brightness that the clock should be set to while night mode is active.

LED_DATA_PIN

Pin to which the led strip data pin is connected to.

NUM_SEGMENTS

Total number of segments that have LEDs in the shelf.

NUM_LEDS_PER_SEGMENT

Number of LEDs in each segment.

APPEND_DOWN_LIGHTERS

If you wired the down lighter LEDs to the end of the LED strips set this to true.

ADDITIONAL_LEDS

Number of LEDs For interior lights.

NUM_LEDS

Automatically calculated total number of LEDs used.

NUM_DISPLAYS

Number of displays in the shelf.

DISPLAY_0_AT_MIDNIGHT

If set to true the display will show 0 at midnight and 12 otherwise.

DISPLAY_SWITCH_OFF_AT_0

If set to true the higher displays will turn off in case they would show 0.

USE_24_HOUR_FORMAT

If set to true 24 hour format will be used. For this one additional column is needed in the shelf to display it correctly.

NUM_SEGMENTS_PROGRESS

The number of segments to use for displaying a progress bar for the OTA updates.

LOADING_ANIMATION_DURATION

The time is shall take for one iteration of the loading animation.

BRIGHTNESS_INTERPOLATION

How fast the brightness interpolation shall react to brightness changes.

DISPLAY_FOR_SEPARATION_DOT

If set to -1 the flashing middle dot is disabled, otherwise this is the index of the Display segment that should display the dot.

ANIMATION_TARGET_FPS

Target Frames per second for the smoothness of animations.

ANIMATION_AFTERGLOW

Length of sooth animation transition from fully on to black and vice versa in percent NOTE: The higher this number the less obvious easing effects like bounce or elastic will be.

DOT_FLASH_SPEED

Length of the dot/s fading animation. One flash fades in and out.

DOT_FLASH_INTERVAL

Intervale in which the dot/s should flash.

NUM_SEPARATION_DOTS

Number of separation dots to use by default (or if no blynk functionality is available) allowed values are 1, 2 and 0 to turn it off.

ENABLE_LIGHT_SENSOR

Enable automatic brightness adjustments based on a light sensor.

LIGHT_SENSOR_PIN

ADC pin to which the light sensor is connected to.

LIGHT_SENSOR_AVERAGE

How many measurements shall be averaged. Higher number -> smoother but slower change.

LIGHT_SENSOR_MEDIAN_WIDTH

Width of the median calculation. Higher number -> smoother change Should never be higher than the LIGHT_SENSOR_AVERAGE.

LIGHT_SENSOR_READ_DELAY

Time that should pass before the light sensor is read again. Higher number -> slower adjustments but also changes will be more sudden.

LIGHT_SENSOR_MIN

AnalogRead value if the light sensor reads complete darkness.

LIGHT_SENSOR_MAX

AnalogRead value if the light sensor reads the brightest.

LIGHT_SENSOR_SENSITIVITY

Value between 0 and 255 that determines how much the light sensor values can influence the led brightness.

TIME_MANAGER_DEMO_MODE

enable for wifi less operation or to demo all the animations

DIGIT_ANIMATION_SPEED

The time it takes for one digit to morph into another.

FASTLED_SAFE_DELAY_MS

the minimum delay between calls of FastLED.show()

Enums

enum DisplayIDs

These enum definitions are used in the code do address the different Seven segment displays. The numbers have to match with the place of the display in the #DisplayManager::SegmentDisplayModes array in the file DisplayConfiguration.cpp.

Values:

enumerator HIGHER_DIGIT_HOUR_DISPLAY
enumerator FIRST_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_HOUR_DISPLAY
enumerator SECOND_INTERMEDIATE_DISPLAY
enumerator HIGHER_DIGIT_MINUTE_DISPLAY
enumerator THIRD_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_MINUTE_DISPLAY
enumerator HIGHER_DIGIT_HOUR_DISPLAY
enumerator FIRST_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_HOUR_DISPLAY
enumerator SECOND_INTERMEDIATE_DISPLAY
enumerator HIGHER_DIGIT_MINUTE_DISPLAY
enumerator THIRD_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_MINUTE_DISPLAY
enum DisplayIDs

These enum definitions are used in the code do address the different Seven segment displays. The numbers have to match with the place of the display in the #DisplayManager::SegmentDisplayModes array in the file DisplayConfiguration.cpp.

Values:

enumerator HIGHER_DIGIT_HOUR_DISPLAY
enumerator FIRST_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_HOUR_DISPLAY
enumerator SECOND_INTERMEDIATE_DISPLAY
enumerator HIGHER_DIGIT_MINUTE_DISPLAY
enumerator THIRD_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_MINUTE_DISPLAY
enumerator HIGHER_DIGIT_HOUR_DISPLAY
enumerator FIRST_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_HOUR_DISPLAY
enumerator SECOND_INTERMEDIATE_DISPLAY
enumerator HIGHER_DIGIT_MINUTE_DISPLAY
enumerator THIRD_INTERMEDIATE_DISPLAY
enumerator LOWER_DIGIT_MINUTE_DISPLAY

Display configuration

group DisplayConfiguration

Configuration to tell the system how the LEDs are wired together and arranged.

Variables

static SevenSegment::SegmentPosition SegmentPositions[NUM_SEGMENTS]

Each segment belongs to some display. This array defines the segment position within this one display. The order of these has to mach the order in which the LEDs are wired.

static Segment::direction SegmentDirections[NUM_SEGMENTS]

Each segment has a direction, this is important for animation. The order of them is the same as #DisplayManager::SegmentPositions and the direction has to match the sequence in which the LEDs are wired.

static SevenSegment::SevenSegmentMode SegmentDisplayModes[NUM_DISPLAYS] = {SevenSegment::ONLY_ONE, SevenSegment::HALF_SEGMENT, SevenSegment::FULL_SEGMENT, SevenSegment::HALF_SEGMENT, SevenSegment::FULL_SEGMENT, SevenSegment::HALF_SEGMENT, SevenSegment::FULL_SEGMENT}

Displays that are present. These define the displays in the order that is set in the #DisplayManager::diplayIndex array.

static uint8_t diplayIndex[NUM_SEGMENTS]

These indicies correspond to the index of a Diplay in the array above (#DisplayManager::SegmentDisplayModes). They define which segment belongs to which Display in the order that they are wired in. The enum DisplayIDs from Configuration.h can also be used to create a more readable config.