Biorhythm

Last Updated on : 2022-12-25 09:21:03download

This topic describes the common questions about the biorhythm feature to help you troubleshoot problems that might occur when you set up biorhythm.

Background and features

What is the benefit of biorhythm?

The 2017 Nobel Prize in Physiology or Medicine was awarded to Jeffrey Hall, Michael Rosbash, and Michael Young for their discoveries of molecular mechanisms controlling the circadian rhythm.

Scientific studies have shown that biorhythmic lighting can interact with the circadian rhythm and provide positive effects on performance levels and physical wellbeing. The light biorhythm features allow users to personalize the brightness and color temperature of lights so that it is tailored-made to the individual needs, the rhythm of a day, and mood.

What features does biorhythm support?

  1. The supported light colors are cool white, cool and warm white (CW), cool white and colored (RGBC), and white and colored (RGBCW).
  2. Up to eight time nodes can be set up.
  3. The interval between time nodes is between 15 minutes to 24 hours.
  4. There are two ways in which the lighting moves to the next light phase.
  5. The gradient mode is available.

How many gradient modes are available?

  • Direct gradient: The light change happens within 15 minutes after a time node is reached. The light changes very clearly by 10% every 90 seconds. For example:

    • Time node A: at 07:00, brightness of 20%, color temperature of 30%.
    • Time node B: at 08:00, brightness of 30%, color temperature of 40%.
    • Time node C: at 09:00, brightness of 40%, color temperature of 50%. From node A to node B, the light change happens between 08:00 to 08:15, during which the brightness and color temperature will change to the values specified for node B in gradient.

    If the current time is at 07:30 and the biorhythm feature is enabled then, the light will instantly change to the values specified for node A.

  • Full gradient: The reaction time is the time interval between two time nodes. This is a linear gradient, with a minimum step of one. The light color changes to the specified value slowly until the next time node is reached. For example:

    • Time node A: at 07:00, brightness of 20%, color temperature of 30%.
    • Time node B: at 08:00, brightness of 30%, color temperature of 40%.
    • Time node C: at 09:00, brightness of 40%, color temperature of 50%. From node A to node B, the light change happens between 07:00 to 08:00, during which the brightness and color temperature will change to the values specified for node B in gradient.

    If the current time is at 07:30 and the biorhythm feature is enabled then, the light will instantly change to the average of values specified for node A and node B. In this example, the brightness and color temperature will instantly change to 25% and 35% respectively.

    Biorhythm

What are the preset time nodes?

The following table lists the preset time nodes for cool white and cool white and colored (RGBC) lights.

No. Node name Start time Initial status
1 Wake up 06:20 Brightness of 20%
2 Sunlight 10:00 Brightness of 100%
3 Comfortable 20:00 Brightness of 80%
4 Night light 23:00 Brightness of 5%

The following table lists the preset time nodes for cool and warm white (CW) and white and colored (RGBCW) lights.

No. Node name Start time Initial status
1 Wake up 06:30 Color temperature of 25% and brightness of 20%
2 Sunlight 10:30 Color temperature of 100% and brightness of 100%
3 Comfortable 20:00 Color temperature of 50% and brightness of 80%
4 Night light 23:00 Color temperature of 0% and brightness of 5%
  • The preset and created time nodes can be edited and deleted. Tapping the reset button will restore the biorhythm feature to the preset four time nodes and default values.
  • The repetition time allows users to schedule their biorhythm tasks on a weekly basis, which can be one-time or recurring. To enable an original inactive day of a week, the light must be turned on again. To make a new biorhythm schedule take effect, the biorhythm feature must be enabled again.
  • The time node can be enabled or disabled individually with the switch button.

How the biorhythm feature works?

The idea of the biorhythm is that the brightness and color temperature of the light can change to the preset values as time goes on.
To make it work, we need to have the following things implemented.

  1. Get the current time node. The time unit must include hours, minutes, and days.

  2. Get the preset brightness and color temperature specified for a time node.

  3. Calculate the step changes and achieve the biorhythm schedule on a weekly basis. See the following block diagram:

    Biorhythm

How to implement the protocol designed for biorhythm?

The protocol is used for the communication between the network module and the mobile app. The raw data is transmitted between them. DP 30 is used for the biorhythm feature.

  • What does each field mean in the protocol?

    Version number Biorhythm switch Gradient mode selection Repetition time setting Time node Time node 1 …… Time node N
    1 byte 1 byte 1 byte 1 byte 1 byte 9 bytes 9 bytes
  • Field description

    Field No. Length (byte) Description
    Version number 1 1 0x00: the initial version.
    Biorhythm switch 2 1 0x00: Biorhythm is disabled.
    0x01: Biorhythm is enabled.
    Gradient mode selection 3 1 0x00: full gradient.
    0x0F: direct gradient. The minimum value is 15 minutes.
    Repetition time setting 4 1 1 indicates a day of a week is scheduled to execute biorhythm. The following table details each field.
    Time nodes 5 1 0x01: one time node. The value ranges from 1 to 8, indicating up to 8 time nodes can be set up.
    Time node switch 6 1 The biorhythm switch is prioritized over the time node switch. Determining the switch status of the time node is necessary only when the biorhythm switch is on.
    0x00: A time node is disabled.
    0x01: A time node is enabled.
    Hour 6 1 0x10: a value in hexadecimal format, ranging from 0 to 23.
    Minute 6 1 0x10: a value in hexadecimal format, ranging from 0 to 59.
    Hue 6 2 0x03 and 0x10 are in hexadecimal format and represented in big endian. The first byte indicates hundreds. The second byte indicates tens and ones. The value ranges from 0 to 360.
    Saturation (%) 6 1 0x10: a value in hexadecimal format, ranging from 0 to 100.
    Value (%) 6 1 0x10: a value in hexadecimal format, ranging from 1 to 100.
    Brightness (%) 6 1 0x10: a value in hexadecimal format, ranging from 1 to 100.
    Color temperature (%) 6 1 0x10: a value in hexadecimal format, ranging from 0 to 100.
  • Field description of repetition time setting

    If all the bits are 0, it indicates a one-time biorhythm task. Otherwise, a recurring task.

    If a bit is set to 1, it indicates the biorhythm task is enabled on that day of a week.

    Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
    bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
  • What other configurations are needed?

    To use the biorhythm feature, you need to add DP 30 to your product created on the Tuya IoT Platform. Select the supporting control panel, such as the European style template.

    Biorhythm

How the data communication works?

How does the mobile app receive data?

When users turn on the biorhythm switch on the mobile app, the app will sort the time nodes in ascending order and send data to the smart light. If you develop with the SDK, the light will register the raw data handler to receive biorhythm data.

When does the mobile app send data to the light?

Each time users edit the biorhythm parameters, such as time node, repetition time, color temperature, and time nodes, the mobile app will send the new biorhythm setting to the light.

How does the light respond to and process biorhythm data?

The light will calculate the initial status and task execution procedure based on the current timestamp and gradient mode and execute the biorhythm task accordingly.

  • In the direct gradient mode, the light will instantly change to the values specified for the nearest time node prior to the current time. Then, when the next time node is reached, the light change happens within 15 minutes. A biorhythm task is executed as per such pattern.
  • In the full gradient mode, the light will instantly change to the average of values specified for the nearest time nodes prior to and later than the current time. Then, light changes as per the biorhythm setting.

How hardware reset works?

If the light with enabled biorhythm is reset with a hardware operation, after it is powered on, the light will read the saved biorhythm data and determine whether to initialize the biorhythm feature depending on biorhythm enablement. After the light is connected to the cloud and gets the current timestamp, it will execute the biorhythm task.

During a biorhythm task, how data reporting and flash memory works?

When a light receives the biorhythm command for the first time, it must return the biorhythm data to the mobile app.

Regular status reporting is not necessary during a biorhythm task. The light reports data to the mobile app only when the brightness changes to zero in a time node. The brightness and color temperature data of a biorhythm task will not be stored on the flash memory.

What operations will delete the biorhythm data?

  • Production test on the end product is performed.
  • Reset a light with hardware operation.
  • Restore to factory settings or remove a light by using the mobile app.

Which features does the biorhythm conflict with?

With the biorhythm turned on, some operations on lighting by using the mobile app will interrupt the biorhythm task on the current day of that week. These operations can be:

  • Turn on or off the light by using the mobile app.
  • Adjust light colors or brightness.
  • Change the mode.
  • Turn on music sync.
  • Turn on a timer or add a schedule.

For lighting schedules, the biorhythm will be interrupted only when the start time of a schedule is reached. However, the biorhythm will be interrupted as long as a timer is turned on. If a light receives data of DP 28 of real-time adjustment, it will stop the biorhythm task without reporting the current status and wait for the new biorhythm data, which is why users can preview the lighting effect when setting the biorhythm.

Are there any special situations that should be considered?

  • If only one time node is set, it must be active when the biorhythm feature is turned on.
  • If users activate a day of a week in the repetition time setting but this specified day has passed in that week, the new schedule setting will take effect in next week.
  • If users deactivate a day of a week in the repetition time setting, the final lighting state of the last schedule period will recur on this inactive day of the following scheduled weeks.