---
title: "Configuration of Sunrise Sunset Timer"
canonical: "https://docs.cuesystem.com/space/CVCAPPLETS/440401921/Configuration%20of%20Sunrise%20Sunset%20Timer"
format: markdown
---
> Macro (toc)

---

First, you have to add SunriseSunsetTimer to your resources. Go to MyProject Resources to the Applet collections tab, right-click on the free area, and select Insert. Choose file CUE_SunriseSunsetTimer_x.xx.cvcl and click on Open button. The recommended path for storing of the applets is: “DEFAULT_FILE_LOCATIONS\Cue Visual Composer\User Applets”

Now you can create an instance of SunriseSunsetTimer in your project. Open MyProject Instances window, select the CUEunit where the instance will be created (Touchpanel1 in example) and select Applets section. Drag and drop SunriseSunsetTimer from resources to the CUEunit Applets tab. An instance of the applet will be created ( SunriseSunsetTimer1 in the example). You can change the name of the instance to the desired value in the Properties section.

![image](media://f05f03b0-4c12-4558-960b-a4b01f5e28a0)

You can configure an instance of the the SunriseSunsetTimer in two ways (or their combinations):

- By filling properties of SunriseSunsetTimer applet instance while programming

- By API commands in runtime

# SunriseSunsetTimer Behavior Group of Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Zenith | Double | Civil   
Official  
Nautical  
Astronomical | Civil := 96 | Current zenith angle, for which the sunrise/sunset is calculated, see note 1 |
| EnableEvents | Boolean | Any | True | Enables or disables raising of events OnSunrise and OnSunset |

> 📝 Sun's zenith for which sunrise/sunset are calculated. You have the following values available:
> 📝 
> 📝 - Official := 90.833 (90 degrees 50', the zenith angle in which sun is just below the horizon)
> 📝 
> 📝 - Civil := 96 (the center of sun disk is 6 degrees below the horizon, civil twilight begins - ends)
> 📝 
> 📝 - Nautical := 102 (the center of sun disk is 12 degrees below the horizon, nautical twilight begins - ends)
> 📝 
> 📝 - Astronomical := 108 (the center of sun disk is 18 degrees below the horizon, astronomical twilight begins – ends)
> 📝 
> 📝 For detailed description, see for example [http://en.wikipedia.org/wiki/Twilight](http://en.wikipedia.org/wiki/Twilight) .

![image](media://0ae450d2-0bda-4baf-b054-7bf3a446586f)

# SunriseSunsetTimer Location Group of Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Latitude | Double | -90 to +90 | 51,5 (London) | Latitude of current location for which the sunrise-sunset is calculated, positive for North, negative for South |
| Longitude | Double | -180 to 180 | 0 (London) | Longitude of current location for which the sunrise-sunset is calculated, positive for East, negative for West |