--- title: Limit a Link’nX scenario to daytime or night-time based on the sun description: Allow a Link’nX scenario only during the day or at night, based on sunrise and sunset, with an adjustable shift in hours and minutes on each limit. canonical: https://wiki.can-nx.com/en/guides/link-condition-sun/ language: en product: Link’nX audience: - administrateur - installateur context: "Link’nX web: Day/Night condition, installation’s shared position, Day/Night condition field" --- # Limit a Link’nX scenario to daytime or night-time based on the sun Context: Link’nX web: Day/Night condition, installation’s shared position, Day/Night condition field The **Day/Night** condition in Link’nX restricts the start of a scenario to the day period or to the night period. Its limits follow sunrise and sunset at the installation’s position, with an adjustable shift for each. Intended for administrators and installers, with an installation position already verified. To request a start at sunrise or sunset, also prepare the appropriate [solar trigger](https://wiki.can-nx.com/en/guides/link-trigger-sun/). ## Create the condition and choose the period 1. In **Conditions**, click **Add**, then choose **Day/Night** in **Select a condition type**. 2. Fill in **Name**, then choose **Day** or **Night** in the **Condition type** field located in the settings. 3. Check the map of the installation’s shared position. Keep this position for this procedure: it is also used by the other solar conditions and triggers. With limits in their usual order, **Day** runs from the start of the day until the start of the night, the latter being excluded from the day period. **Night** covers the complementary period. ## Shift the start of the day and of the night 1. Under **Sunrise time**, choose **+** in **Plus** or **-** in **Minus**, then fill in **Hours** and **Minutes** to shift the start of the day. Use whole numbers from 0 to 5 hours and from 0 to 59 minutes. Reread **Day start time**. 2. Under **Sunset time**, set the shift of the start of the night in the same way. Reread **Night start time**. 3. Enter 0 in each field where you want no shift: the two shifts are independent. | Setting (fictitious example) | Effect | | --- | --- | | Sunrise, **+**, 0 hours 30 minutes | The day starts thirty minutes after the solar sunrise time | | Sunset, **-**, 0 hours 20 minutes | The night starts twenty minutes before the solar sunset time | For a typical configuration, the start of the day must come before the start of the night in the preview. If the shifts make the limits cross or make the period hard to interpret, contact support before saving. ## Save and add the condition to the scenario 1. Click the floppy disk icon and follow the [save confirmations](https://wiki.can-nx.com/en/guides/link-condition-edit/). 2. In the scenario, choose this condition in **Day/Night condition**, then save the scenario. ## Check the result The times displayed are a preview for the current date. To view them from a scenario, open **Conditions detail**, then select the condition in the list. Viewing it this way does not add it to the scenario and does not command any equipment. ## Troubleshooting - The map is missing: check the browser’s location permission for this site. - The position is unknown or incorrect: contact support to prepare a change of the shared position. - A time is missing or the result does not match your intention: check **Day** or **Night**, the two signs, the four duration fields and the condition selected in the scenario. For a day-to-day change in the times or an unexplained shift, contact support@can-nx.com with the date, the times displayed and the checks already made.