--- title: Trigger a Link’nX scenario at sunrise or sunset description: Start a Link’nX scenario at sunrise or sunset, with an offset before or after of up to 5 h 59 min, calculated for the installation’s location. canonical: https://wiki.can-nx.com/en/guides/link-trigger-sun/ language: en product: Link’nX audience: - administrateur - installateur context: "Link’nX web: Sun event trigger, with the shared installation location already checked" --- # Trigger a Link’nX scenario at sunrise or sunset Context: Link’nX web: Sun event trigger, with the shared installation location already checked The **Sun event** trigger in Link’nX requests a scenario start at sunrise or sunset, with an offset before or after this event. The times are calculated for the installation’s location, which is shared by all sun-based items. Intended for administrators and installers, on a context whose installation location has already been checked. To allow a scenario only during the day or the night, use the [Day/Night condition](https://wiki.can-nx.com/en/guides/link-condition-sun/) instead. ## Create the sun event trigger 1. In **Triggers**, click **Add**, then choose **Sun event** in **Select a trigger type**, **Schedule** group. To edit an existing trigger, open its name or its pencil. 2. Fill in **Name**, required, 64 characters maximum. Fictitious example: “Outdoor lighting before sunset”. 3. In **Select a sun event**, choose **Sunrise** or **Sunset**. The corresponding time appears in **Sunrise time** or **Sunset time**. 4. Check the map and **Link'nx position**. The message **The location is shared for all conditions and triggers (Sun events)** indicates a location common to all these items, not one specific to this trigger alone. Keep the already checked location of the installation. 5. Choose **+** in **Plus** for an event after the solar time, or **-** in **Minus** for an event before it. Fill in **Hours** from 0 to 5 and **Minutes** from 0 to 59, with whole numbers. For no offset, use 0 hours and 0 minutes. 6. Review **Trigger time**. Fictitious example: **-**, 0 hours and 20 minutes requests an event twenty minutes before the chosen sunrise or sunset. 7. Click the floppy disk, then follow the [trigger save confirmations](https://wiki.can-nx.com/en/guides/link-trigger-edit/). 8. [Add this trigger to the relevant scenario](https://wiki.can-nx.com/en/guides/link-compose-scenario/), then check its conditions and its activation. ## Check the location on the map The map may request the browser’s location permission. Check that the marker matches the installation, especially if you are working remotely. Clicking the map moves the marker. Do not move it to correct the time of a single trigger: the location is used by all sun-based items. To change the shared location, contact support to check the automations concerned and the appropriate procedure. After clicking the floppy disk, a later cancellation does not necessarily restore the previous location. ## Check the result Reopen the trigger from **Triggers** and review the event, the offset and the times shown. These times are a preview for the location and the current date; to test the scenario on the installation, watch the device at the planned time and see [the history](https://wiki.can-nx.com/en/guides/link-history/). If a summary viewed from a scenario shows information that differs from the form, contact support before changing the event or the offset. ## Troubleshooting | Message or symptom | Action | | --- | --- | | **Issue with the Sun event selection field. It requires a value.** | Choose the event | | **Issue with Hours or Minutes fields. It requires a value (not empty).** | Fill in both fields, including 0 when no offset is wanted | | The map does not display | First check the browser’s location permission for the site | | Marker missing or not matching the installation | Stop the configuration and contact support to establish the appropriate location | | Start at a time other than the expected time | Check the event, the sign, the hours and minutes, the trigger’s presence in the scenario, its conditions and its activation, then the history | For an unexplained offset, a missing solar time or a question about how the times change from day to day, contact support@can-nx.com with the date, the times shown, the chosen event and the checks already made.